going gameover after failed event

jonsilva

New member
hello
Its there a way to send the game to the openbor gameover screen like it happens when the plr presses start in level and exits the game and keeps the saved file

I have an event in the final level if it fails it goes to sadendcredits a globalvar is set to 1 branches to that level again then 1 makes gameover and keeps the saved file.... so plr can load game come back and try again
 
Look at this func:
Code:
int force_game_over() {
        int p = 0;

        for (p = 0; p < openborvariant("maxplayers"); p++) {
            if ( getplayerproperty(p,"credits") > 0 ) changeplayerproperty(p,"credits",0);
            if ( getplayerproperty(p,"lives") > 0 ) changeplayerproperty(p,"lives",0);
        }
        jumptobranch("inexistent ",1); // inexistent branch to simulate gameover
}
 
thanks you  :D
its working... I was already aware of this function yesterday has I was searching throw your mod... what got me intrigued was jumptobranch("inexistent ",1); I thought it was jumping to the next level...

heres the stuff I was already doing
script @script
void main()
{
    void self = getlocalvar("self");
    int  over = getglobalvar("gmov");
if(over==1)
{
    changeentityproperty(self, "setlayer", 999999999);
    clearglobalvar();
    performattack(self, openborconstant("ANI_FOLLOW10"));
    }
}
@end_script

#int pindex = getlocalvar("player");
#void pl = getplayerproperty(pindex , "entity");
#changeentityproperty(pl, "health", 0);
#damageentity(pl, self, 10000, 0, openborconstant("ATK_NORMAL"));


#@script
# void self = getlocalvar("self");
# int p1 = getplayerproperty(0, "entity");
# int p2 = getplayerproperty(1, "entity");
# int p3 = getplayerproperty(2, "entity");
# //in_gameoverscreen();
#    // shutdown();
#
# if(frame==1)
# {
#      changeplayerproperty(p1, "credits", 0);
#        changeplayerproperty(p1, "lives", 0);
#        changeplayerproperty(p2, "credits", 0);
#        changeplayerproperty(p2, "lives", 0);
#        changeplayerproperty(p3, "credits", 0);
#        changeplayerproperty(p3, "lives", 0);
#
#  killentity(p1);
#  killentity(p2);
#    killentity(p3);
# }

anim follow10
script @script
void main()
{
        int p = 0;

        for (p = 0; p < openborvariant("maxplayers"); p++)
{
            if ( getplayerproperty(p,"credits") > 0 ) changeplayerproperty(p,"credits",0);
            if ( getplayerproperty(p,"lives") > 0 ) changeplayerproperty(p,"lives",0);
        }
    jumptobranch("inexistent ",1); // inexistent branch to simulate gameover
}
@end_script
loop 1
delay 5
offset 240 270
#drawmethod 600 600
drawmethod 1 1
frame data/chars/beyond/stuff/thunder/t30.gif

this is one o those levels were I force the player to play only with a certain character and kills the others 2 players ... so I was getting a lot of weird stuff player 1 was working but player2 and 3 were not getting their credits/lives removed instead it was removing it from player1 only and when player 2/3 died it was going to the next level instead of gameover I don't know why...

also tried shutdown(); but it exits the engine...

now its working thanks  ;D


 
Back
Top Bottom