PDA

View Full Version : Getting a "global" variable in a global script



celestian
April 19th, 2018, 01:04
I am attempting to not have to "replace" the entire CoreRPG script "manager_tokens.lua" ... with just the function I need to alter (updateHealthHelper).

I can override the function with my own but I can't seem to figure out how to access the global variable fGetHealthInfo within TokenManagers script manager_tokens.lua. I've tried a few methods I thought might work but nothing seems to work properly.

I've even attempted to also override the addDefaultHealthFeatures function where it's set and have a "global" on my own "ManagerTokenDI" script and that didn't work either.

Thoughts?

Andraax
April 19th, 2018, 04:29
TokenManager.fGetHealthInfo doesn't work for you?

celestian
April 19th, 2018, 04:56
TokenManager.fGetHealthInfo doesn't work for you?

Nope.

Moon Wizard
April 19th, 2018, 23:50
TokenManager.fGetHealthInfo is a "local" variable, which means that it can't be accessed outside the scope of the script.

Regards,
JPG

celestian
April 20th, 2018, 04:09
TokenManager.fGetHealthInfo is a "local" variable, which means that it can't be accessed outside the scope of the script.

Regards,
JPG

Bugger, that's what I thought. Was hoping I could just swap out the one function but for now big hammer it works.

Bidmaron
April 22nd, 2018, 14:56
Sounds like a good candidate for 3.3.6 to make this accessible perhaps.