Jump to content
Peace

Creating new java classes in lua

Recommended Posts

I can create a class like this

local noise = InventoryItemFactory.CreateItem("Peace.SoundBeacon");
local noiseTrap = IsoTrap.new(noise, cell, square);
noiseTrap:addToWorld();

but I cant create some classes, i get an is nil error

local radioLinePre = RadioLine.new("Test Message", 1, 1, 1);

Is it just that some of the classes arent accessible in lua, or am i missing a namespace or something?

I dont have much experience with lua.

Share this post


Link to post
Share on other sites

I think it might be down to RadioLine not being exposed in LuaManager, but these ones are available:


            setExposed(zombie.radio.RadioAPI.class);
            setExposed(zombie.radio.devices.DeviceData.class);
            setExposed(zombie.radio.devices.DevicePresets.class);
            setExposed(zombie.radio.devices.PresetEntry.class);
            setExposed(zombie.radio.ZomboidRadio.class);
            setExposed(zombie.radio.RadioData.class);

            setExposed(zombie.radio.scripting.RadioScriptManager.class);
            setExposed(zombie.radio.StorySounds.SLSoundManager.class);
            setExposed(zombie.radio.StorySounds.StorySound.class);
            setExposed(zombie.radio.StorySounds.StorySoundEvent.class);
            setExposed(zombie.radio.StorySounds.EventSound.class);
            setExposed(zombie.radio.StorySounds.DataPoint.class);
 

None of them seem to provide an easy way to access RadioLine, unfortunately. 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...