Ondeathscript error/Restart Level on death

Skull Kingz

Active member
Ok, so I've been following this thread here... Everything is working and my level is restarting after I die. But for some reason, my fall and death animation will not play. It just instantly cuts as soon as I die. I included a video below.


Here's my ondeathscript animation
Code:
void main(){
//Restart current branch
    int branch = openborvariant("current_branch");
    
    jumptobranch(branch, 1);
}

Also, I have falldie 2 & nodieblink 3 in my characters header. Any suggestions on how to get this to play before the level restarts?
 
Ok, so I've been following this thread here... Everything is working and my level is restarting after I die. But for some reason, my fall and death animation will not play. It just instantly cuts as soon as I die. I included a video below.


Here's my ondeathscript animation
Code:
void main(){
//Restart current branch
    int branch = openborvariant("current_branch");
  
    jumptobranch(branch, 1);
}

Also, I have falldie 2 & nodieblink 3 in my characters header. Any suggestions on how to get this to play before the level restarts?

The whole point of event driven scripts is they operate seperately from other events. Ondealth fires when the character dies, which as far as OpenBOR is concerned, is the second their HP is depleted.

You could try putting it in the killscript instead. Killing in game terms means removing from play. So when the engine removes the player, (i.e. the death animation is over), your script fires.

HTH,
DC
 
That helped a little bit, but now I'm trying a different method that does not use onkillscript or ondeathscript. I'm tinkering with Jumptobranch. I put it in my anim death, but I don't know if Im using it correctly. Are there any games that have a good example for me to study?

I'm new to branches too btw. Here's my anim death
Code:
anim    death
    Delay    18
    offset  116 203
        bbox  77  132  71  57
    @script
        void iStage = openborvariant("current_branch");
       if(frame == 7){
        jumptobranch(iStage, 1);
        }
    @end_script
    Frame    data/chars/Solid/rise1.gif

    Frame    data/chars/Solid/rise2.gif
    Frame    data/chars/Solid/rise3.gif
    Frame    data/chars/Solid/fall1.gif
    delay    100
        bbox  83  174  68  30
    Frame    data/chars/Solid/fall2.gif
    delay    5
        bbox  0  0  0  0
    Frame    data/chars/Solid/fall3.gif
    Frame    data/chars/Solid/fall3.gif
    Frame    data/chars/Solid/fall3.gif

Basically all I'm trying to do is repeat the current level that I'm playing.
 
Back
Top Bottom