I have a problem with ORK. When my characters die in battle, in the next battle they are "dead "(their HP is 0 and can't do anything), but they are up instead of being lying on the ground.
I had the same thing until I revamped the Start Battle Event and made it a bit more detailed than what was in the tutorial start event, which is what I based mine on. Check your combatant group's status to see if dead (or something like HP = 0, whatever makes sense for your game), and then if that's true, play the appropriate animation type on the character.
I was calling other script things in the event so I stuck mine there, but you could do it with the event system alone if you wanted.
This is not pretty code, and I'm sure there's a better way to write it, but it does what I need it to.
//Check and play death anims for any dead combatants at the start of battle public void CheckDeadAnim(){ for (int i = 0; i < ORK.Game.ActiveGroup.Size; i++){ if (ORK.Game.ActiveGroup.IsBattleMember(i)) { //Check if Health is at or below 0 (status value 1 for me) if(ORK.Game.ActiveGroup.GetMember(i).Status[1].GetValue() < 1){ //9 is the death anim type as defined in the project settings for me ORK.Game.ActiveGroup.GetMember(i).Animations.Play(9); } } } }
I achieved dead characters using this method: - Combatants ---> Player(s) - Base settings, Prefab settings - Add conditional prefab - Choose prefab with dead character (in 2D i set a copy of normal prefab with just dead sprite) - Add status requirement: Status / Death
I was calling other script things in the event so I stuck mine there, but you could do it with the event system alone if you wanted.
This is not pretty code, and I'm sure there's a better way to write it, but it does what I need it to.
//Check and play death anims for any dead combatants at the start of battle
public void CheckDeadAnim(){
for (int i = 0; i < ORK.Game.ActiveGroup.Size; i++){
if (ORK.Game.ActiveGroup.IsBattleMember(i))
{
//Check if Health is at or below 0 (status value 1 for me)
if(ORK.Game.ActiveGroup.GetMember(i).Status[1].GetValue() < 1){
//9 is the death anim type as defined in the project settings for me
ORK.Game.ActiveGroup.GetMember(i).Animations.Play(9);
}
}
}
}
- Combatants ---> Player(s)
- Base settings, Prefab settings
- Add conditional prefab
- Choose prefab with dead character (in 2D i set a copy of normal prefab with just dead sprite)
- Add status requirement: Status / Death
That should do the trick if i well remember. :)
My old entry for Indie Game Making Contest 2015