Creating new java classes in lua
1 1

2 posts in this topic

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
1 1