edited August 2023 in ORK Scripting
How do I send a level up event to a combatant and potentially enable the full recovery?
Post edited by ChimpLogik on
  • Schematics have the Level Up node for that - and the Regenerate node for full recovery independent of that :)

    Or via code, you can force a level up like this:
    combatant.Status.ForceLevelUp();

    You can also cause regeneration via code:
    combatant.Status.Regenerate(true);
    Passing true will revive dead combatants.
    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!
  • Awesome, thank you so much Nicholas!
  • I used that function in conjunction with ORK.Game.Combatants.GetAll() but it seems to break several parts of my game...
    private void LevelUpAllCombatants()
    {
    List<Combatant> allCombatants = ORK.Game.Combatants.GetAll();
    for (int i = 0; i < allCombatants.Count; i++)
    {
    if(allCombatants[i]!=null)
    allCombatants[i].Status.ForceLevelUp();
    }
    }
  • What parts does it break?
    Using ORK.Game.Combatants.GetAll() will get you all spawned combatants in the scene, not just the (spawned) player group members.
    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 have several coroutines that simply won't work anymore the moment I enable this and I have no idea why, since they're in separate -and completely unrelated- classes.

    The plan was to eventually filter by faction the result of ORK.Game.Combatants.GetAll() and level up only the combatants matching the right requirements.
  • Since this involves custom code, it's hard to tell - can you give me details on what your code does?
    Level up naturally has impact on things of the combatant, e.g. changing stats impacting conditions used on various things, like a conditional prefab.

    I'd need to see the code or get a Unity test project to be able to help more :)
    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.