Is there a way to revive the player via code after it's been killed?
  • Sure, beside changing the health status value to something that doesn't immediately kill the combatant again, you also need to set the death state (and a status recalculation afterwards doesn't hurt):
    combatant.Status.DeathState = CombatantDeathState.Alive;
    combatant.Status.MarkResetStatus();

    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!
  • Using the functions below I was able to get in the player's Combatant Component
    IsDead = false
    Health = max value
    but once "revived", the player doesn't respond anymore to
    click-movement inputs
    can't perform any ability (the shortcut ability HUD is gone).

    These are the Kill/Revive functions I used:
    private void KillPlayer()
    {
    ORKCombatantStatusValues.AddCombatantStatusPoints(playerObject, -1000, ORKGUIDs.statusValue_health);
    GlobalFunctionsManager.GetPlayerCombatant().Status.DeathState = CombatantDeathState.Dead;
    }
    private void RevivePlayer()
    {
    ORKCombatantStatusValues.AddCombatantStatusPoints(player, 1000, ORKGUIDs.statusValue_health);
    GlobalFunctionsManager.GetPlayerCombatant().Status.DeathState = CombatantDeathState.Alive;
    ORKComponentHelper.GetCombatant(GlobalFunctionsManager.GetPlayer()).Status.MarkResetStatus();
    }
  • Might be either a control block (e.g. in the death schematic of the player), a game over (check the game over settings in Game > Game Settings, especially Auto Game Over should be disabled to not cause game over in field/real time area battles) or dead combatants being set up to leave their groups (see the death settings of the combatant/general combatant settings, found in their battle settings).
    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!
  • It was indeed the Auto Game Over, thank you Nicholas!
Sign In or Register to comment.