I've come across an odd behavior where attempting to add 1 to the float of an ability variable inside a formula gives two extra points. If I check against an original value of 1, it shows the value to be 3, and if the original value is 1 then 4 is correct. I'm selecting only one ability, and it has only 1 level with just the one variable, so the issue shouldn't be stemming from there. I've also simplified the formula to basic steps:
Step 1 - Select ability
Step 2 - Change the value
-type: selected
-selected key: set as value and left blank (I didn't assign a name to the value field of the selected variable, so it just checks against whichever variable is currently selected)
-value type: value
-value: (the variable's name)
-type: float
-operator: add
-float value, value type: value
-value: add
-Step 3: check game variable. I set up the basics as above and check whether the float equals a specific number
-Step 4: the check node empties into a pair of value nodes. 1 for pass, 0 for fail. If the proceeding check node is set to 1 after adding one via the change variable node, then the ultimate value is 0. If I set it to check whether the value is 3, then the formula value becomes 1. aka true. Any thoughts on where those extra two points might be coming from?
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
E.g. the hit chance formula would be calculated for each target separately, so without reset, the ability variable value will increase with each calculation.
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!
Step 1- Inside of an event, I create a 'Change Game Variables' node, make it local, give it the key 'Testing3476543' and set the value to 22.
Step 2- I create a formula with a 'Check Game Variables Node' that checks the the value of 'Testing3476543'. If the value is 22, the formula sets its value to 777. Otherwise the value sets to 666.
Step 3- Inside the event, I create another 'Change Game Variables' node, make it local again, make its key 'TestingTesting3476543', and set its value to equal the formula I just created.
Step 4- Inside the event, I create a 'Variable To Variable' node that changes 'TestingTesting3476543' to an object variable of the same name, so that I can see the result on my character in a running game.
Step 5- I read that the value of my test variable always comes up 666.
This apparently holds true in the case of Selected Data as well. Here's an example of that:
Step 1- Inside of an event, I select a piece of equipment and name it 'Armor'.
Step 2- I create a formula with a single value node set to equal the float value of a variable attached to the piece of equipment that was previously selected inside my event. Specifically, The Value is set to 'Game Variable', the Variable Key is the name of the variable (Copied and pasted to perfection) as taken from the equipment piece, the Variable origin is 'Selected', the Selected Key Value Type is 'Value' and the value itself is set to 'Armor'.
Step 3- I repeat the processes listed above noticing the same result: the variable's value isn't being picked up by the formula.
Step 4- I go back to the formula and insert a Selected Data node set up just like the one in my event, giving it the same Selected Key: Armor.
Step 5- I run my game, have my combatant attack something and it shows the variable's correct value assigned to the Object Variable. In other words, the node setup to read the variable and assign its value works properly, but the selected key, Armor, isn't being passed into the formula.
Strangely, however, many variables are still passing through formulas and events without an issue. For example, one of my early events in the chain determines the type of attack that is being made as based on the user's weapon. to do this, it checks the hand that's being used as defined by another variable from a proceeding event, selects the corresponding equipment part and then assigns it the key, 'Wpn_User'. Then it does a bunch of other things before finally determining a value for certain variables like, 'Atk_AtkType_User' (Swing, Thrust, Bash, Lash, Punch, Kick, Poot:), and 'Atk_DamageType_User' (Cutting, Piercing, Spiked, Impact).
Variables like those and others are referenced many times throughout my string of events, and are successfully passed to various formulas that use them in determining which string of numbers to plug into where, and they still appear to be functioning event now; I've tested and confirmed this in several spots. Yet others, like those I mentioned in the previous examples, are just sitting there like a bunch of useless log warts, not doing anything and not passing their values to the formula's that need them. What's up with that?
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!
The value is an integer, so I don't think imprecision is the problem. That, and the value tests positive as being equal to zero. It's also not a typo issue; I've made certain all the letters and their cases align, and there's no extra space after the input. I've noticed that certain inputs, like variables, don't transfer properly after more than 1 degree of separation--an event called by an event that's called by an event doesn't seem to pass along it's changes up the ladder, and I'm thinking that might be the problem. When I create the variables and assign them a value in the initial event, it registers perfectly.
Otherwise I'll need details on how your events are called, e.g. what type of event (game event, battle event) is calling which type of event and how?
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!
Yes, it seems I blew a microchip there for a moment which caused me to read (and write) 'Event' as 'Variable'. It's fixed now. Sorry about that. Incidentally, the event in question here is actually a Battle Event called by another Battle Event. I could also just do the whole thing inside a string of formulas (which is how things were set up in my project's earlier stages), but it gets a little messy when you decide to change certain things around, or (Heaven forbid) add a new formula to the chain by copying another one that's high in the list, and then suddenly you're spending 20 minutes to move your newly copied formula up the line until it's with the rest of its group so that you don't end up with a sporadic mess of formulas connected all over the place. I prefer to do as much of my work as possible in events now, because they're modular.
It doesn't matter if it's a battle event or global event being called, make sure to enable sharing local variables or selected data if you want to use them in the called event.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!