Protect this entity or restart level/game over

NED

Well-known member
For my VS modes I would like to create a disqualification system.
If referee is killed (by player or enemy)

-player will lose the battle
-then you restart on same level (when restarting from menu)

I precise I set this mode this way:
Code:
lives   1#99
credits 1#99

I think something can be spawned from referee's death anims.
But what will make player lose a life/ lose the battle so you go to "game over"

Any help is welcome.
Thanks



This system might be useful for Double Dragon type games, with a girl to save/protect.
 
I say at the last question.
If you have many credits (more than 1) with 0 player the game ramains in wait.
But if you set the nowait var you can spawn an entity that throw some message.
Then you can use the playgame() func to navigate between menus.
This is from my VS mode ;)
 
Lagarto made this script for me that removes a life from player.  I had script that checks current branch on death, and restarts the level.  This other script is needed to remove a life from the player (because jumptobranch kicks in and prevents death from finishing)

Code:
void restart()
{ 
void p1 = getplayerproperty(0, "entity");
int p1lives = getplayerproperty(p1, "lives");
 if(getentityproperty(p1, "exists"))
{
 changeplayerproperty(0, "lives", p1lives -1);
 }
}

EDIT:

And this will restart on the current branch (or can change to current level)

Code:
	@script
    	void iStage = openborvariant("current_branch");
     	if(frame == 1){
    	jumptobranch(iStage, 1);
    	}
	@end_script
 
Thanks guys.
I think this is what I need.

BeasTie, about this script.
I'm not sure to unerstand how to edit/apply it for my particular situation.
Any clue?

When I talk about referee spawning something.
There is no actual message.
I just need him to generate the fact player will lose 1 life and quit the level.
(player have only 1 life)

BTW, I cannot remember how to make continue from title/menu screen when you have lost you last life, last time you played.
The idea is to simulate a "one try" mode, unless you restart from gameover.
You only have just one life.
 
Do they have to loose a life and restart? 

You don't actually need to take a life from the player.  You can send him to another branch, that is created to work as the continue screen., this branch would be delcared last.  If they continue they get sent back to the original branch (you might need a weapon model for chars to make this simple, if they hit certain button it jumptobranch).  Otherwise if they don't continue you get game over screen, because the game has no more branches after it.  OR you could add to remove the life too if it's important somehow.

Either use stage timer and make it bonus stage,  it will end when time runs out.  OR have an entity for countdown timer.  OR have CONTINUE?  YES/NO

You can spawn an all black PANEL entity with really high setlayer to hide the HUD.  Just make sure timer entities etc. have a higher setlayer so they can be seen. 

To use the restart script just add,

@cmd restart

in the entity. (this is actually the script to take a life )

Your game is one player only right?  it can be added to check player 2 if you need.

You don't need to make him spawn something.  If you declare these in his death anim he won't actually die, he'll take player life and end the stage or jumptobranch before it gets removed (depending). (just make extra delay in death anim)

For the restart level, you probably just want to edit it so it goes directly to a certain branch.  otherwise if you use it atm it will just restart the match/stage.

this one simply jumps to branch you declare on frame 0
Code:
	@script
     	if(frame == 0){
    	jumptobranch("name_of_branch", 1);
    	}
	@end_script


BTW, I cannot remember how to make continue from title/menu screen when you have lost you last life, last time you played.
I don't know either, you don't mean load game?
 
Sorry, I have not checked this repply.

I prefer to avoid creating special continue screen.
1 life and 0 continue seems to be the good setting.
Thanks anyway
 
Back
Top Bottom