Hi

I have a script that uses ORK.Combatants.Create() and combatant.Init() and combatant.Object.Spawn() to create instance of characters.

This will instantiate GameObject with Combatant component attach to it, and initiate the combatant as per the settings in ORK Framework. Let's say a combatant is configured with an Auto Status Effect settings that adds a Status Bonus. And this Status Bonus give the combatant a Status Value of two points.

Based on findings, the Status Effect is not applied at this point yet. Or at least the Status Bonus is not granted to the combatant yet and the callback to combatant.Status[id].ValueChanged is not triggered yet (which another of my script is listening). It takes a frame or two before the combatant gets its Status Bonus points, right ?

Is there a property of the combatant I can check to validate that all auto status effect has been applied ? Or that the combatant is fully initiated ?
  • The combatant instance's has access to all the status information, e.g. combatant.Status.Effects has all status effect related functionality with functions to check if an effect is applied, etc.

    Status changes are recalculated in the next frame, combining everything that occured - so, effect is applied immediately, but the status bonus from it will be added in the next frame.
    This is done for performance reasons, otherwise you might have hundreds of status updates each frame from individual status changes that might happen from a single change :)
    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!
  • So based on your answer, I should wait 2-3 frames to make sure all bonus has been applied ? Does the framerate will have any influence on this ?
  • You can immediately check if a status effect is applied, but the status bonuses (e.g. for status values, attack/defence modifiers, etc.) will only be added in the next frame when the status is recalculated due to the state being changed. So, yeah ... 2-3 frames later is definitely a safe bet :)

    This is independent of the frame rate, it simply recalcualtes in the next frame.
    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.