I'm attempting to set a combatant's initial consumable status value to one that differs from its associated max status value. I've tried specifying in the combatant's game event settings an "init" and "spawn" however, while the init appears to be getting called (but not the spawn event), which changes the status value, when I inspect or enter battle with that combatant in the game, the status value is maxed.
For additional context, I have the event object specified as the combatant, and under the "status value changes" in the "change status value" node, I have "initialize" checked, although it does not appear to make a difference either way. And for the combatant in game, I have a prefab with an "Add combatant" script and "remember combatant" checked (I want it to persist across scene changes).
I really appreciate your help. Thanks
1) On game event setting of a combatant, create and set a new Event on Spawn event (
depending on whether the fighter is the player, an ally or an enemy ) :
https://pasteboard.co/Jzy1sI1.png
2) configure the event like this :
A - Event Setting : Add Actor , Type : Strating Object.
https://pasteboard.co/Jzy2dUa.jpg
B- Change Game Variable Node ( configured as in the picture ( Set a name/value , Global, type Float, operator set)
https://pasteboard.co/Jzy2PwF.jpg
C- Status value to variable node ( take the status value with which you want your combatant start )
https://pasteboard.co/Jzy3GWB.jpg
D- Change status value Node ( Select Value , Operator Set , Value type Game variable , Variable origine Gobal and variable Key the name of the variable determined in B).
https://pasteboard.co/Jzy4GvF.jpg
In my example, the fighter will always appear with his HP = Max Mp.
I tested and it also starts a fight with these values (Turn based)
With this event (which is triggered at spawn) a fighter can have a consumable status value based on any other (current or max setting, it depends on how you configure the status value to variable node and change statue value)
I am not sure that this is the best solution and that it meets your need but I hope it can help you.
The combatant's init event will be used when the combatant is initialized for the first time, the spawn event is used whenever the combatant is spawned (i.e. the game object created) in the world. The combatant is available in the event as Starting Object type actor, so you need to set that up in the event's settings (and use that actor in the nodes).
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Also as an aside, I have an ORK Game Starter in the "city" scene I'm working in with Call Main Menu checked, however when I start a new game, the init event on the combatant does not get called. When I start from my actual main menu scene, and then am transferred to the "city" scene it does get called. Since I have the "Add combatant" script added to prefab already present in the scene (eg. does not spawn a new game object) it makes sense to me the spawn event is not called.
Thanks for your help @MadMaxx and @gamingislove! I've been using ORK consistently (evenings/weekends) for a couple months now and am overall really happy with how things are coming along, just a few cases where I get stuck and not sure I would have been able to figure this one out on my own. Take care.
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!