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
  • edited November 9
    I'm not sure I understood what you want to do but you can try the following solution:

    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.
    Post edited by MadMaxx on
  • Consumable type status values determine that via their Start Value and Set In settings. E.g. setting it in 100 percent will set them to their max value, or setting them to 1 (value) will set them to 1.

    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).
    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!
  • edited November 10
    I understand how to set the consumables to a default value globally, but was trying to do it for a specific combatant. It turns out I was using the Event Object instead of the Starting Object.

    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.
    Post edited by megaphemeral on
  • If you have a game starter in a scene that's not your main menu scene, use the Start Game option instead of calling the main menu. This is the mode used for quick game testing in a scene - it'll start a new game right there, using the start event, etc.
    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!
  • edited November 13
    Thanks for the suggestion, but I don't see a Start Game option:
    image
    Post edited by megaphemeral on
  • I just realized it becomes available when you uncheck Call Main Menu so I'll try that. Thanks again for your help.
  • I'd also recommend using the Auto Call settings in Menus > Main Menu instead of the game starter to call the main menu in the main menu scene - otherwise the main menu will not be called when returning to the main menu scene (e.g. when quitting the game back to the main menu).
    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.