celestian
October 27th, 2017, 05:13
Okay, so I've been digging into finding out why effects in my ruleset don't expire like they should (such as action effects expiring when it's that characters turn) and I figured out why. It's because I use ascending initiative and CoreRPG uses descending (higher is better there).
Long story short I found the problem in manager_effect.lua, processEffects(). I fixed what I needed and then tried to over ride the other function using these methods.
EffectManager.processEffects = manager_effect_processEffects;
CombatManager.aCustomInitChange = {};
CombatManager.setCustomInitChange(manager_effect_p rocessEffects);
These are in an onInit for my own manager. So, at first I simply tried " EffectManager.processEffects = manager_effect_processEffects;" thinking it would let me use my local copy of the function called "manager_effect_processEffects" but it did not. I then added the "CombatManager.setCustomInitChange(manager_effect_p rocessEffects);" which appeared to work but ... the other one is run also (default one of "CombatManager.setCustomInitChange(processEffects);" so it runs processEffects twice, mine and the broken one. Lastly I thought I could remove the previous by "CombatManager.aCustomInitChange = {};" but that doesn't seem to work either.
So, other than just having a local copy of the CoreRPG manager_effect.lua in my ruleset, is there a way to get around this? I.E. replace the processEffects() function with my own?
edit: Just so im clear, I can replace manager_effect.lua with my own and tag it as "EffectManager" and it works. Just trying to not use such a big hammer.
Long story short I found the problem in manager_effect.lua, processEffects(). I fixed what I needed and then tried to over ride the other function using these methods.
EffectManager.processEffects = manager_effect_processEffects;
CombatManager.aCustomInitChange = {};
CombatManager.setCustomInitChange(manager_effect_p rocessEffects);
These are in an onInit for my own manager. So, at first I simply tried " EffectManager.processEffects = manager_effect_processEffects;" thinking it would let me use my local copy of the function called "manager_effect_processEffects" but it did not. I then added the "CombatManager.setCustomInitChange(manager_effect_p rocessEffects);" which appeared to work but ... the other one is run also (default one of "CombatManager.setCustomInitChange(processEffects);" so it runs processEffects twice, mine and the broken one. Lastly I thought I could remove the previous by "CombatManager.aCustomInitChange = {};" but that doesn't seem to work either.
So, other than just having a local copy of the CoreRPG manager_effect.lua in my ruleset, is there a way to get around this? I.E. replace the processEffects() function with my own?
edit: Just so im clear, I can replace manager_effect.lua with my own and tag it as "EffectManager" and it works. Just trying to not use such a big hammer.