I'm experiencing an odd quirk where one of my stats which derives its value from a formula isn't transferring said value correctly. The stat, 'Weight_Current' is linked to a formula called 'Weight_Total' that will typically display values like '64211' when tested, depending on other stats and sub-formula calculations. I can also call and duplicate this value directly inside of other formulas without fail using the 'Status Value' node. I have another stat for instance, called 'Weight_Declared', linked to a formula which merely calls the current value of 'Weight_Current' and divides it a couple of times to convert from grams to pounds, and it always tests accurately.
I can reference either of these stat values inside any formula, and said formula will appear to incorporate them as it should. The problem, however, is that a degree of separation appears to exist somewhere that causes any stat linked directly to either of these two to return a value of zero. If I create a new stat and call it, 'Test', for example, and then link this new stat to a formula which merely assigns the value from 'Weight_Current' or its counterpart, it will display the correct value inside its initial formula. If I bring it out one step further, attempting to call the value of 'Test' inside a new formula, well this is where I discover that things are not really as honky-dory as they'd erstwhile appeared: the value is always zero.
If I go to my combatant and directly assign a value of 12 to either weight stat, then the value of 'Test' becomes 12. If I run my game setup and make a new combatant, the U.I. will show its declared weight to be greater than zero, but not correct. It will often be something like 47 where it should be more like 138, given the corresponding stats. Another thing is that I've tried unlinking 'Weight_Current' from its various sub-formula stages to test each individually, as well as bypassing all of them and assigning a direct value to its formula, but nothing will make it work. That third step out is always a zero. I can link a stat to a different stat's value, though, and it will give me the proper number no matter how many steps out I take it. I'm kind of stumped here. Any ideas?
They're initialized in order they're set up in the editor, i.e. based on their ID/index. Status values are initialized in 2 rows, first initializing the regular stats, afterwards initializing the combined stats (i.e. those using formulas for their value).
E.g. if one of the formulas is used before the weight stat is initialized, it'll have the wrong value.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Anyway, there's a work around. Pain in the ass that it is, I believe I'm going to create a block of formulas linking each of my current stat values independently so that I can reference those formulas in the future rather than the stats themselves. It will also provide a ready outlet for a quick fix when and if this issue pops up again, which is likely considering how circular my stat system is. Fortunately, its also quite hierarchical, and I've set up my list in order of priority from top to bottom, which is also the probable reason I hadn't noticed this issue earlier. Come to think of it, it's probably a good idea to create another block for base values as well. Let the good times roll!
Honestly, I'm not even sure I'd ever be able to get that to work, even after hours and hours of troubleshooting... although, it might be possible by duplicating all of my stats and linking the new ones to their former counterparts. That's a messy solution though (again, assuming it will even work), and there's got to be another way. Might it be possible to force a conditional check when a combined stat is initialized, so that it can recheck its formula after the list is pinged through, in the case of its value being equal to zero?
Use that game event in the combatant's settings (Base Settings > Game Event Settings) as the Init Game Event.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!