Jump to content

Overriding java code with lua?


Soul Filcher

Recommended Posts

I've found this: http://projectzomboid.com/modding/se/krka/kahlua/integration/expose/LuaJavaClassExposer.html on exposing java classes to lua, but I know the class I want to use is already exposed (IsoPlayer). Could anyone tell me if it is possible to modify/override a public boolean or float in that class? Something like whenever public float x is called my own lua code runs and returns the needed changes. I've been able to learn a lot from this forum and existing mods out there but I couldn't find anything on this, and I'd rather avoid changing class files if I can.

Link to comment
Share on other sites

So, in luajava I can call luajava.bindclass("myclass") and then do something like:

 

Spoiler

    local myClass = luajava.bindclass("MyClass");
    local x = myClass.DesiredFloat(); --to get a public float called DesiredFloat inside that class and be able to change it.

 

But that is luajava, what is the equivalent here? My example uses a public float but I actually want to use a public void. Higher powers, I'm trying to invoke you!

Link to comment
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
×
×
  • Create New...