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?
  • Hm, can't really get a clear picture of your setup, but my first guess would be the order of your status values.

    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.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Well, sh!t on my sunday and tell me it's raining, if that isn't the rub right there. Holy migraine headaches, Batman, that is both highly useful information and one hell of a giant potential stumbling block that I wish I'd known about before setting up all of my combined stats. It certainly changes one's view of haphazardly moving things around in that particular list. are abilities in the same boat?

    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!
  • Nope, that solution I mentioned above isn't going to cut it. I must have fudged something when I tested it the first time, because I set it up again and wasn't able to get the 'Test' stat positioned before 'Weight_Current' to show a value by linking it to a stat-value formula rather than the stat. Either way is zero. Only the 'Test' stat listed after 'Weight_Current' will show a value, and that is muy, muy no bueno my friend. This is an absolute catastrophe for my project. I can't be moving three hundred stats up and down through a list of three hundred other stats, one click at a time, praying each time that it's new position hasn't broken something else.

    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?
  • You might be able to do what you need by using an Init Game Event. Set up a game event that uses a Change Status Value node to set a status value (you can also initialize them to a value), or does whatever else you need when first initializing a combatant.

    Use that game event in the combatant's settings (Base Settings > Game Event Settings) as the Init Game Event.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • I thank you for the advice, but I believe that, if I were successful, it would simply apply a flimsy patch that would only cause me problems down the line. I've decided that going the duplicate route is the best solution here. I'm going to create a new status type called, "StatCalc", and then duplicate all of my stats that need to be moved back on the list and rename the old stats accordingly. I'll just view it as an example of why I'm glad to have resolved at the beginning of this project to create and solidify my core system before I began dabbling with the game environment. I'm fortunate at least to have caught it now, before I'd created a host of events referencing values that might become obsolete. As my great uncle Olaf used to say before the skydiving accident, "ain't no thing but a chicken wing dangling from a string, from Burger King." He was senile.
  • You can also move data in the lists around, so it's not needed to recreate them in the order you need.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.