Jump to content

Changing ZomboidGlobals via function


Suomiboi

Recommended Posts

Hey, I was wondering if there is a way of changing the defines.lua ZomboidGlobals with a function and without editing the file itself?

 

For example:

function KnifeTest();    local player = getPlayer(0);    local weapon = player:getPrimaryHandItem();    if weapon:getType() == "KitchenKnife" then              -- this would be where it would change the info in ZomboidGlobals              CatchAColdIncreaseRate = 0.000, --this is normally 0.003 Events.OnPlayerUpdate.Add (KnifeTest);

Now I know this code doesn't work and it's just an example to demonstrate what I'd like to do. I've tried multiple ways of getting the info from the ZomboidGlobals and change it but nothing seems to work.(Too many to list and remember. I'm in the point where I just try anything that pops to my head that would have a 1% chance of working.) This is probably either because it can't be done or because I'm stupid and don't know the code... So if anyone knows anything that might help or that it can't be done, I'd be extremely grateful!

Link to comment
Share on other sites

Allright! I'll start testing with it. It didn't work straight as it is but I'll try and figure out the system behind it.

 

Thanks!

 

EDIT: I've gotten it to change the numbers but the effect doesn't seem to be working yet. Gonna continue testing

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...