Continue Screen

maxman

Well-known member
I wonder if there's some way to make a continue screen just like Ninja Gaiden (Arcade), Alien VS Predator, and Final Fight. The continue script I use is based on BonusJZ's Night Slashers X mod. I want to make everything freeze after player dies during continuation until pressing start to continue. I can possibly cover everything with black screen since I prepared a sprite. Dunno where to start.

update.c:
Code:
void main(){
	void vSelf = getplayerproperty(0, "entity");
	void vSelf2 = getplayerproperty(1, "entity");
	int time = openborvariant("elapsed_time");//Calling time
	//void goselect = openborvariant("in_selectscreen");// Move to select screen
	//void golvl = openborvariant("in_level"); //Move to level, not select screen
	//void cstage = openborvariant("current_stage"); //In current stage
	//void clvl = openborvariant("current_level"); //In current level
	int One = loadsample("data/sounds/one.wav");
	int Two = loadsample("data/sounds/two.wav");
	int Three = loadsample("data/sounds/three.wav");
	int Four = loadsample("data/sounds/four.wav");
	int Five = loadsample("data/sounds/five.wav");
	int Six = loadsample("data/sounds/six.wav");
	int Seven = loadsample("data/sounds/seven.wav");
	int Eight = loadsample("data/sounds/eight.wav");
	int Nine = loadsample("data/sounds/nine.wav");
//	void blackbg = loadsprite("data/chars/misc/black.gif");
	if (vSelf == NULL() && vSelf2 == NULL()){
		if (getglobalvar("crd") >= 1 || getglobalvar("crd2") >= 1 || getglobalvar("pause") >= 1){
			drawstring(125, 100, 4, "continue");
//			drawsprite(blackbg, 0, 0, 5000, 0);
		if (time >= getglobalvar("elapsed_time") + 600 && time <= getglobalvar("elapsed_time") + 999){
			drawstring(155, 120, 3, "9");
			playsample(Nine, 0, openborvariant("effectvol"), openborvariant("effectvol"), 0, 0); //playsample(sample, priority, lvolume, rvolume, speed, loop)
		}if (time >= getglobalvar("elapsed_time") + 1000 && time <= getglobalvar("elapsed_time") + 1399){
			drawstring(155, 120, 3, "8");
			playsample(Eight, 0, openborvariant("effectvol"), openborvariant("effectvol"), 0, 0);
		}if (time >= getglobalvar("elapsed_time") + 1400 && time <= getglobalvar("elapsed_time") + 1799){
			drawstring(155, 120, 3, "7");
			playsample(Seven, 0, openborvariant("effectvol"), openborvariant("effectvol"), 0, 0);
		}if (time >= getglobalvar("elapsed_time") + 1800 && time <= getglobalvar("elapsed_time") + 2099){
			drawstring(155, 120, 3, "6");
			playsample(Six, 0, openborvariant("effectvol"), openborvariant("effectvol"), 0, 0);
		}if (time >= getglobalvar("elapsed_time") + 2100 && time <= getglobalvar("elapsed_time") + 2399){
			drawstring(155, 120, 3, "5");
			playsample(Five, 0, openborvariant("effectvol"), openborvariant("effectvol"), 0, 0);
		}if (time >= getglobalvar("elapsed_time") + 2400 && time <= getglobalvar("elapsed_time") + 2699){
			drawstring(155, 120, 3, "4");
			playsample(Four, 0, openborvariant("effectvol"), openborvariant("effectvol"), 0, 0);
		}if (time >= getglobalvar("elapsed_time") + 2700 && time <= getglobalvar("elapsed_time") + 2999){
			drawstring(155, 120, 4, "3");
			playsample(Three, 0, openborvariant("effectvol"), openborvariant("effectvol"), 0, 0);
		}if (time >= getglobalvar("elapsed_time") + 3000 && time <= getglobalvar("elapsed_time") + 3299){
			drawstring(155, 120, 4, "2");
			playsample(Two, 0, openborvariant("effectvol"), openborvariant("effectvol"), 0, 0);
		}if (time >= getglobalvar("elapsed_time") + 3300 && time <= getglobalvar("elapsed_time") + 3599){
			drawstring(155, 120, 4, "1");
			playsample(One, 0, openborvariant("effectvol"), openborvariant("effectvol"), 0, 0);
		}if (time >= getglobalvar("elapsed_time") + 3600){
			drawstring(155, 120, 4, "0");
		}if (time >= getglobalvar("elapsed_time") + 4200){
			jumptobranch("end", 1);
		}
	}
	}
}

I forgot about ondeathscript.

death.c:
Code:
void main(){
	setglobalvar("elapsed_time", openborvariant("elapsed_time"));
	setglobalvar("crd", getplayerproperty(0, "credits"));
	setglobalvar("crd2", getplayerproperty(1, "credits"));
//	setglobalvar("pause", openborvariant("pause"));
//	setglobalvar("black", loadsprite("data/chars/misc/black.gif"));
}
 
don't over think it.  all it has to be is a stage in a branch, with a countdown.  like a bonus stage.  player can be invisible entity, pressing start/continue simply pauses/stops countdown and loads the next branch, otherwise if counts down send it to gameover branch.  you can create an entity for the visual timer that also controls the branching.

edit; whoops, half asleep, i just realized you want this IN STAGE.  spawning a black panel would work, you could use the pause script so only the countdown entity is active.  use script in the entity to get you back in game or send you to game over.  Game over could also be a custom branch.

what i explained earlier was a custom continue screen, like you get in street fighter II

EDIT 2: the timer entity can actually be the player, a weapon copy.  you could also keep him from loosing the final life, then adding back lives and resetting score, hp etc with script.
 
spawning a black panel would work, you could use the pause script so only the countdown entity is active.  use script in the entity to get you back in game or send you to game over.  Game over could also be a custom branch.

This could work, but you would need to spawn it on a ondeathscript, or the game would exit before the spawn.
plus I think a text type entity would do the job, since it freezes everything on the screen.
 
I think if you get the timing right you can jump branch before anything else kicks in.

I did this for a vs mode game so I'm not sure I even took lives away, just send the player to this branch if you are defeated.  I was just adding script directly to chars and levels, I never finished this, the whole idea was to see it working then try to put everything in spawn scripts etc.  I'm not really that skilled with script and this was an exercise to try and improve. 

You can actually make it a bonus stage and have a countdown using the built in timer, input from the player can be coded to switch branch on continue.  The 'current branch' etc. is stored in vars so it knows what branch to continue on.  ( I also store wins/losses etc. so these get cleared on continue)
 
I did this for a vs mode game so I'm not sure I even took lives away, just send the player to this branch if you are defeated.
But this depends of HOW he wants the code to work:

- If you die and the stage ends then the continue kicks in, and you restart the level, your solution would be fine.
- but if you die on a stage and the continue screen popup on the screen and you can resume the level where you died, then you need a ondeathscript
 
BeasTie said:
edit; whoops, half asleep, i just realized you want this IN STAGE.  spawning a black panel would work, you could use the pause script so only the countdown entity is active.  use script in the entity to get you back in game or send you to game over.  Game over could also be a custom branch.

Yep. I want it in stage. tried it with black screen but not yet pause script. Didn't do it until I did it recently but I added my modified pause script (based on DC's) on the enemy in his HP bar script. LOL Funny it's possible, but it's somewhat okay because sometimes enemy can move when he's supposed to be paused.

BeasTie said:
what i explained earlier was a custom continue screen, like you get in street fighter II

Something like that. Also I'd like to learn how to create other continue systems like Cadillacs & Dinosaurs (where Vice points a gun atcha till 0 and he shoots you, or he gets sucker-punched if continue), Captain Commando (a star that come out when continue appears), Castlevania (planning on using loop script for taking time which one to choose either continue or quit).

BeasTie said:
EDIT 2: the timer entity can actually be the player, a weapon copy.  you could also keep him from loosing the final life, then adding back lives and resetting score, hp etc with script.

I've not yet done that, but I did create some scripted lifebars.

I used a full black screen but I used loadsprite and drawsprite for it to appear after player's defeated with no lives left till you need to continue. I dunno how to add animation when it comes to update.c especially for ondeathscript like you see in Captain Commando.

- If you die and the stage ends then the continue kicks in, and you restart the level, your solution would be fine.
- but if you die on a stage and the continue screen popup on the screen and you can resume the level where you died, then you need a ondeathscript

1st one: A reference from BonusJZ's Ghost n Goblins. He made it for restarting level after you continue. I'd like to try that.
2nd one: Yep. I use ondeathscript. I'd like to do the one in the first.

I copied and modified DC's pause script for mine as all entities will freeze. This is from an enemy HP script. I'm not sure if I'm doing it right on the pause script.

Code:
void main() //Enemy HP
{
	if(getplayerproperty(0, "entity") == NULL() && getplayerproperty(1, "entity") == NULL()){
	    void vSelf      = getlocalvar("self");                  //Caller    
    int  iETime     = openborvariant("elapsed_time");       //Current time.
    int  iMax       = openborvariant("ent_max");            //Entity count.
    int  iEntity;                                           //Loop counter.
    void vEntity;                                           //Target entity.

    for(iEntity=0; iEntity<iMax; iEntity++)
    {    
        vEntity = getentity(iEntity);                                       //Get target entity from current loop.        
        
        if (vEntity && vSelf)                                               //Both Self and Target?
        {
            changeentityproperty(vEntity, "frozen", 1);               //Toggle frozen.
            changeentityproperty(vEntity, "freezetime", 15000);    //Toggle frozen time.
        }
    }    
	}
	else
	{
		void self = getlocalvar("self");
//		float z = getentityproperty(self, "z");
		int HP = getentityproperty(self, "health");
		int MaxHP = getentityproperty(self, "maxhealth");
		int health = 114*HP/MaxHP;
		int P1 = getplayerproperty(0, "entity");
		int P2 = getplayerproperty(1, "entity");
		void name = getentityproperty(self, "name");
		void icon = loadsprite("data/profiles/"+ name +".png");
		int map = getentityproperty(self, "map");
		int iconmap = getentityproperty(icon, "map");
		int palette = openborvariant("current_palette");
		
		    int  iETime     = openborvariant("elapsed_time");       //Current time.
    int  iMax       = openborvariant("ent_max");            //Entity count.
    int  iEntity;                                           //Loop counter.
    void vEntity;                                           //Target entity.

    for(iEntity=0; iEntity<iMax; iEntity++)
    {    
        vEntity = getentity(iEntity);                                       //Get target entity from current loop.        
        
        if (vEntity && self)                                               //Both Self and Target?
        {
            changeentityproperty(vEntity, "frozen", 0);               //Toggle frozen.
  //          changeentityproperty(vEntity, "freezetime", 15000);    //Toggle frozen time.
        }
    } 
		
		
		if(getentityvar(self,0)==NULL()){
		setentityvar(self,0, health);
		}
		
		if(findtarget(P1)){
			drawbox(176,6,health,2,1800,rgbcolor(255,234,41),0); 
			drawbox(176,8,health,1,1800,rgbcolor(255,226,0),0);
			drawbox(176,9,health,1,1800,rgbcolor(255,206,24),0);
			drawbox(176,10,health,1,1800,rgbcolor(246,194,0),0);
			drawbox(176,11,health,1,1800,rgbcolor(230,141,0),0);
			drawbox(176,12,health,1,1800,rgbcolor(222,92,0),0);
			drawsprite(icon,262,21,1800);
		}else if(findtarget(P2)){
			drawbox(100+(50-health),6,health,2,1800,rgbcolor(255,234,41),0); 
			drawbox(100+(50-health),8,health,1,1800,rgbcolor(255,226,0),0);
			drawbox(100+(50-health),9,health,1,1800,rgbcolor(255,206,24),0);
			drawbox(100+(50-health),10,health,1,1800,rgbcolor(246,194,0),0);
			drawbox(100+(50-health),11,health,1,1800,rgbcolor(230,141,0),0);
			drawbox(100+(50-health),12,health,1,1800,rgbcolor(222,92,0),0);
			drawsprite(icon,-56,21,1800);
		}
		
		if(health<getentityvar(self,0)){
			if(getentityvar(self,1)==NULL()){
				setentityvar(self,1,0);
			}
			setentityvar(self,1,getentityvar(self,1)+1);
			if(getentityvar(self,1) > 50){
				setentityvar(self,0,getentityvar(self,0)-1);
				setentityvar(self,1,0);
			}
		}
	}
}

 
About your iMax, check White Dragon's explanation here: http://www.chronocrash.com/forum/index.php?topic=3151.msg42990#msg42990
Instead of freezing everyone with script, why just use a text object? It will pause everything minus itself.

About the ondeathscript, if I am not wrong, it fires right after the engine detects the entity will die (or dies) - as you can see in my avengers demo, and not just only when the entity is removed from the screen.
So I think you could use an even easier solution:

- Include a death animation on your character and spawn a text entity
- set the text entity to be skipped
- set a CANCEL on this entity and make a follow animation which will just kill itself and continue the game
- if the the entity isn't skipped, end the game. If I am not wrong, there is a way to do it by script.
 
I partially agree with O Ilusionista's technique I would say play a full screen gif animation that counts down with the continue timer without freezing the game then have a keyscript to close the gif with the start button and in the background it will also continue.

I have not worked with gif animations so I have no idea if this will work.
 
This is something I'd like to do with my game as well.  I've been reading through the correspondence try to and piece this together, but I've got a few hang ups.  First, I went ahead and created on ondeathscript:

Code:
void main(){
	setglobalvar("crd", getplayerproperty(0, "credits"));
}

and update.c:

Code:
void main(){
	void vSelf = getplayerproperty(0, "entity");
	if (vSelf == NULL()){
	if (getglobalvar("crd") >= 1){
			??spawn entity command??
		}
	}
}

Now,  I'd like to take the route of spawning a text entity that'll cover the screen until either the countdown finishes or the player presses start.  I guess the information I'm looking for would be how to spawn an entity through script ( I don't understand the "global spawn entry") and how/where to script a key press.

hSV4l1Y.gif
 
So I tried my best to take a crack at scripting.  Now, this is my first actual attempt at scripting something myself.  It's probably a mess to the more seasoned coder and, most likely, the not the best way to implement it, but it works at what I wanted it to accomplish.

I ended up making an invisible entity that checks if all active players are dead, but at least have one or more credits.  If so, it'll go to a follow animation that spawns my continue screen as a text entity.  The text entity deactivates pause and kills itself if any of the active players press start or else it'll force a game over (with White dragons script) once the countdown reaches zero.

Code:
name   continue
health  1000
type  none

load conti

anim idle
   	loop   1
   	offset   38 128
   	delay   20
frame data/chars/misc/empty.gif
@script
void self = getlocalvar("self");
int crd = getplayerproperty(0, "credits");
int lvs = getplayerproperty(0, "lives");
int crd2 = getplayerproperty(1, "credits");
int lvs2 = getplayerproperty(1, "lives");
int crd3 = getplayerproperty(2, "credits");
int lvs3 = getplayerproperty(2, "lives");
void p1 = getplayerproperty(0, "entity");
void p2 = getplayerproperty(1, "entity");
void p3 = getplayerproperty(2, "entity");
int count = getglobalvar("count");


if(p1 == NULL() && p2 == NULL() && p3 == NULL()){
	if(crd >= 1 && crd2 >= 1 && crd3 >= 1 && lvs == 0 && lvs2 == 0 && lvs3 == 0 && count == NULL() || crd >= 1 && crd2 >= 1 && crd3 == 0 && lvs == 0 && lvs2 == 0 && lvs3 == 0 && count == NULL() || crd >= 1 && crd2 == 0 && crd3 == 0 && lvs == 0 && lvs2 == 0 && lvs3 == 0 && count == NULL() || crd >= 1 && crd2 == 0 && crd3 >= 1 && lvs == 0 && lvs2 == 0 && lvs3 == 0 && count == NULL() || crd == 0 && crd2 >= 1 && crd3 >= 1 && lvs == 0 && lvs2 == 0 && lvs3 == 0 && count == NULL() || crd == 0 && crd2 >= 1 && crd3 == 0 && lvs == 0 && lvs2 == 0 && lvs3 == 0 && count == NULL() || crd == 0 && crd2 == 0 && crd3 >= 1 && lvs == 0 && lvs2 == 0 && lvs3 == 0 && count == NULL()){
		setglobalvar("count", 1);
		performattack(self, openborconstant("ANI_FOLLOW1"));
		}
}
if(lvs >= 1 && count == 1 || lvs2 >= 1 && count == 1 || lvs3 >= 1 && count == 1){
		setglobalvar("count", NULL());	
}
@end_script
frame data/chars/misc/empty.gif 

anim follow1
	spawnframe 0 0 0 0 1
	subentity conti
	loop   0
   	offset   38 128
   	delay   1
	frame	data/chars/misc/empty.gif
 
Here is the conti entity:

Code:
name conti
type text
setlayer 1000 #1001001000

animationscript data/scripts/gameover.c

palette none

anim idle
@script
	void self = getlocalvar("self");

	
	changeopenborvariant("nopause", 1);
	if(playerkeys(0, 0, "start") || playerkeys(1, 0, "start") || playerkeys(2, 0, "start")){
		performattack(self, openborconstant("ANI_FOLLOW1"));
		
}
@end_script
	flipframe 0
	loop	0
	offset	0 0
	drawmethod	alpha 6
	drawmethod	channel 0.20
	delay 5
	frame	data/scenes/conti/13.png
	drawmethod	channel 0.40
	frame	data/scenes/conti/13.png
	drawmethod	channel 0.60
	frame	data/scenes/conti/13.png
	drawmethod	channel 0.80
	frame	data/scenes/conti/13.png
	drawmethod	alpha 0
	frame	data/scenes/conti/13.png
	delay 80
	frame	data/scenes/conti/ten1.png
	delay 10
	frame	data/scenes/conti/ten2.png
	frame	data/scenes/conti/ten3.png
	frame	data/scenes/conti/ten4.png
	delay 80
	frame	data/scenes/conti/ten1.png
	delay 10
	frame	data/scenes/conti/nine1.png
	frame	data/scenes/conti/nine2.png
	frame	data/scenes/conti/nine3.png
	frame	data/scenes/conti/nine4.png
	delay 80
	frame	data/scenes/conti/nine1.png
	delay 10
	frame	data/scenes/conti/eight1.png
	frame	data/scenes/conti/eight2.png
	frame	data/scenes/conti/eight3.png
	frame	data/scenes/conti/eight4.png
	delay 80
	frame	data/scenes/conti/eight1.png
	delay 10
	frame	data/scenes/conti/seven1.png
	frame	data/scenes/conti/seven2.png
	frame	data/scenes/conti/seven3.png
	frame	data/scenes/conti/seven4.png
	delay 80
	frame	data/scenes/conti/seven1.png
	delay 10
	frame	data/scenes/conti/six1.png
	frame	data/scenes/conti/six2.png
	frame	data/scenes/conti/six3.png
	frame	data/scenes/conti/six4.png
	delay 80
	frame	data/scenes/conti/six1.png
	delay 10
	frame	data/scenes/conti/five1.png
	frame	data/scenes/conti/five2.png
	frame	data/scenes/conti/five3.png
	frame	data/scenes/conti/five4.png
	delay 80
	frame	data/scenes/conti/five1.png
	delay 10
	frame	data/scenes/conti/four1.png
	frame	data/scenes/conti/four2.png
	frame	data/scenes/conti/four3.png
	frame	data/scenes/conti/four4.png
	delay 80
	frame	data/scenes/conti/four1.png
	delay 10
	frame	data/scenes/conti/three1.png
	frame	data/scenes/conti/three2.png
	frame	data/scenes/conti/three3.png
	frame	data/scenes/conti/three4.png
	delay 80
	frame	data/scenes/conti/three1.png
	delay 10
	frame	data/scenes/conti/two1.png
	frame	data/scenes/conti/two2.png
	frame	data/scenes/conti/two3.png
	frame	data/scenes/conti/two4.png
	delay 80
	frame	data/scenes/conti/two1.png
	delay 10
	frame	data/scenes/conti/one1.png
	frame	data/scenes/conti/one2.png
	frame	data/scenes/conti/one3.png
	frame	data/scenes/conti/one4.png
	delay 80
	frame	data/scenes/conti/one1.png
	delay 10
	frame	data/scenes/conti/zero1.png
	frame	data/scenes/conti/zero2.png
	frame	data/scenes/conti/zero3.png
	frame	data/scenes/conti/zero4.png
	delay 80
	frame	data/scenes/conti/zero1.png
	delay 10
	frame	data/scenes/conti/1.png
	frame	data/scenes/conti/2.png
	frame	data/scenes/conti/3.png
	frame	data/scenes/conti/4.png
	frame	data/scenes/conti/5.png
	delay 200
	sound 	data/sounds/shing.wav
	frame	data/scenes/conti/6.png
	delay 100
	sound 	data/sounds/cut.wav
	frame	data/scenes/conti/7.png
	delay 20
	frame	data/scenes/conti/8.png
	frame	data/scenes/conti/9.png
	frame	data/scenes/conti/10.png
	frame	data/scenes/conti/11.png
	frame	data/scenes/conti/12.png
	@cmd force_game_over
	frame	data/scenes/conti/13.png

anim follow1
	flipframe 0
	loop	0
	offset	0 0
	delay 10
@script
	changeopenborvariant("nopause", 0);
@end_script
	frame	data/scenes/conti/zero1.png
	delay 1
	@cmd killentity getlocalvar("self")
	frame	data/scenes/conti/zero1.png
 
Thanks. The force_game_over is a native script like finishlevel, right?

Its this function:
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
}
 
O_Ilusionista
Thanks. The force_game_over is a native script like finishlevel, right?

Its this function:
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
}

O_Ilusionista , NS still has a continue bug, but now that i see this thread i think i can fix it

i am guessing that i have to  use this modified death to feature 4 players like this?

void main(){
setglobalvar("elapsed_time", openborvariant("elapsed_time"));
setglobalvar("crd", getplayerproperty(0, "credits"));
setglobalvar("crd2", getplayerproperty(1, "credits"));
        setglobalvar("crd3", getplayerproperty(2, "credits"));      //-lines for player 3
        setglobalvar("crd4", getplayerproperty(3, "credits"));      //-lines for player 4
// setglobalvar("pause", openborvariant("pause"));
// setglobalvar("black", loadsprite("data/chars/misc/black.gif"));
}

But i cant seem to understand where this "force game over" script goes or how to use it

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
}
 
I'm having trouble with CountDown entity, now that I changed its type from none to text. Using type none works when you can continue by pressing start to return to the select screen, but you cannot press any button to rush its countdown. Using type text works when you press any button to rush its countdown, but you cannot press start to return to the select screen. Since I have that fake invisible player for spawning its return with certain follow animation to the select screen, the script doesn't execute to jump to the select screen (Arcade_Select) branch at all. Despite removing the countdown entity off, it still cannot go back to select screen like the fake player 1 can. Let me show you the following elements of player and the issue of the continue screen.

Here're the following elements for player:

Levels.txt:
Code:
set    Testing_Fight_Level
lives 1
credits 30
noshare 1
cansave 0
continuescore 1
disablehof 1
disablegameover 1
skipselect player1 player2
branch Arcade_Select # <=== SELECT SCREEN
z    173 230 173
file    data/levels/charatest.txt # level 1
branch    Stage_Ryu
z    227 227 227
file    data/levels/ryu_stage.txt # level 2
branch    Stage_Ken
z    227 227 227
file    data/levels/ken.txt # level 4
branch    Ended
z    230 230 230
file    data/levels/emptyspace.txt # level 5
end
branch Returning
skipselect player1 player2
z    173 230 173
file    data/levels/charatest.txt # level 1
file    data/levels/return.txt

This is the fake player 1 entity which is always helpful for respawning after death.

Code:
name player1
type player
health 1 #100
speed 10
turndelay 9999999999999999999999
subject_to_gravity 0
subject_to_obstacle 0
subject_to_wall    1
subject_to_platform 0
subject_to_hole 1
no_adjust_base  0
shadow        0
atchain        1
load        Challenger
load        black-fade-out

ondrawscript data/scripts/dumdraw.c
onspawnscript data/scripts/arcSpawn.c

script @script
void main(){
    changeentityproperty(getlocalvar("self"), "name", "_");
}
@end_script

anim waiting
    delay 4
    offset 1 1
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif

anim select
    delay 4
    offset 1 1
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif

anim spawn
    delay 9
    offset 1 1
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif

anim respawn
    delay 9
    offset 1 1
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif

anim idle
   
    loop 1
    delay 6
    offset 1 1
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif

anim walk

    loop 1
    delay 6
    offset 1 1
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif

anim backwalk

    loop 1
    delay 6
    offset 1 1
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif

anim pain
    delay 4
    offset 1 1
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif

anim attack
    delay 4
    offset 1 1
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif

anim fall
    delay 4
    offset 1 1
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif

anim rise
    delay 4
    offset 1 1
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif

anim follow1 # Return to Character Select Screen after Continue

    delay 120
    offset 1 1
    subentity black-fade-out
    spawnframe 0 0 240 0 0
    frame data/chars/misc/empty.gif
    delay 6
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif
    @cmd jumptobranch "Returning" 1
    frame data/chars/misc/empty.gif

anim follow2 # Here comes a new challenger
    delay 9
    offset 1 1
    custentity Challenger
    spawnframe 0 0 0 0 0
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif

anim follow3 # First player returns to select screen or second player joins after first player loses completely

    delay 1
    offset 1 1
    @cmd clearglobalvar
    frame data/chars/misc/empty.gif
    delay 6
    @cmd jumptobranch "Arcade_Select" 1
    #@cmd jumptobranch "Returning" 1
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif

arcSpawn.c:
C:
#define RESPAWN openborconstant("ANI_RESPAWN") //#define {any_name_for_the_value} {value}
#define SPAWN openborconstant("ANI_SPAWN")

void actual_main(){ // This function is #imported from its main file in the main scripts folder
    arcade_spawn();
}


void arcade_spawn(){
    void self = getlocalvar("self"); // Get entity
    void aniID = getentityproperty(self, "animationid"); // Get entity's animation ID
    int set = openborvariant("current_set"); // Calling on the current set or mode of the game
    int level = openborvariant("current_level"); // Calling on the current level
    //void in_level = openborvariant("in_level");
    void branch = openborvariant("current_branch"); // Calling on current branch
    changeentityproperty(self, "name", "_"); // Change entity's name
    int PLAY = openborvariant("count_players");

// This goes back to the select screen from the continue screen
    if(set == 0 && branch == "Continue"){ // During Continue screen in the first set?
        if(aniID == RESPAWN || aniID == SPAWN){ // Take a look at #define above and see why the value is like this
            performattack(self, openborconstant("ANI_FOLLOW1")); // Confirming to return to the select screen
        }
    }

// This calls upon a new challenger
    if((level == 2 || level == 3 || level == 4 || level == 5) && PLAY == 2 && set == 0){ // Second player joins the fray in certain levels under one mode!
        if(aniID == RESPAWN || aniID == SPAWN){
            performattack(self, openborconstant("ANI_FOLLOW2")); // Confirms a new challenger and returns to select screen
        }
    }
   
    // Continue to battle
    if((level == 2 || level == 3 || level == 4) && PLAY == 1 && set == 0){ // First (either 1P or 2P) player returns to battle!
        if(aniID == RESPAWN){
            performattack(self, openborconstant("ANI_FOLLOW3")); //Jump to select screen
        }if(aniID == SPAWN){
            performattack(self, openborconstant("ANI_FOLLOW3"));
        }
    }

}

The issue with the following elements of the continue screen.

Code:
name    EnemyWin
health  2
type text
shadow 0
nolife  1
palette none
speed 10
nomove 1 1
nodrop 1
nopain  1
load CountD
load continue
load black
setlayer    100
animationscript data/scripts/script.c

anim idle # Ryu
    offset 40 1
    delay 650
    subentity continue
    spawnframe 1 200 60 0 1
    @cmd    changeopenborvariant "nojoin" 1
    @cmd    changeopenborvariant "nopause" 1
    @cmd    playmusic "data/music/fightend.ogg"
    #@cmd spawn06 "Black" 0 0 660
    frame data/sprites/portraits/ryu.png
    delay 2
    #@cmd    changeopenborvariant "nojoin" 0
    #@cmd    changeopenborvariant "nopause" 0
    @cmd killentity getlocalvar("self")
    @cmd    playmusic "data/music/continue.bor" 1 528400.25
    frame data/sprites/portraits/ryu.png

I tried to emulate how @handsnfeetface did with his continue screen, though the code looks decent, but I like it. :) However, I face an issue the main countdown one after this one.

Continue.txt:
Code:
name continue
health 1000
type none

load CountD

anim idle
@script
void self = getlocalvar("self");
int crd = getplayerproperty(0, "credits");
int lvs = getplayerproperty(0, "lives");
int crd2 = getplayerproperty(1, "credits");
int lvs2 = getplayerproperty(1, "lives");
void p1 = getplayerproperty(0, "entity");
void p2 = getplayerproperty(1, "entity");
int count = getglobalvar("count");


if(p1 == NULL() && p2 == NULL()){
    if(crd >= 1 && crd2 >= 1 && lvs == 0 && lvs2 == 0 && count == NULL() || crd >= 1 && crd2 == 0 && lvs == 0 && lvs2 == 0 && count == NULL() || crd == 0 && crd2 >= 1 && lvs == 0 && lvs2 == 0 && count == NULL() || crd == 0 && crd2 == 0 && lvs == 0 && lvs2 == 0 && count == NULL()){
        setglobalvar("count", 1);
        performattack(self, openborconstant("ANI_FOLLOW1"));
        }
}
if(lvs >= 1 && count == 1 || lvs2 >= 1 && count == 1){
        setglobalvar("count", NULL());   
}
@end_script
    loop 1
    offset 40 40
    delay 2
    frame data/chars/misc/empty.gif
    frame data/chars/misc/empty.gif

anim follow1

    spawnframe 0 0 0 0 0
    subentity CountD
    offset 40 40
    delay 1
    frame data/chars/misc/empty.gif

My main issue about the CountD (countdown) entity. Everytime I try holding start to continue, it either goes back to the title screen or it just doesn't allow the player to respawn back to the select screen. Pressing start is stiff to go back.

Code:
name CountD
#type none
type text
speed 10
subject_to_minz 0
subject_to_maxz 0
setlayer 410000000
facing 1
load black-fade-in
load black-fade-out
load black
animationscript data/chars/misc/continueanim/contAnim.c
#keyscript data/chars/misc/continueanim/contkey.c

anim idle
@script
    void self = getlocalvar("self");
    int P1 = getplayerproperty(0, "entity");
    int P2 = getplayerproperty(1, "entity");
    int P1Start = playerkeys(P1, 0, "start");
    int P2Start = playerkeys(P2, 0, "start");
   
    changeopenborvariant("nopause", 0);
    if(P1Start || P2Start){
        changeentityproperty(self, "position", 1, 1, 0);
        performattack(self, openborconstant("ANI_FOLLOW1"));
        //changeopenborvariant("nopause", 0);
}
@end_script
    offset 1 1
    delay 9
    custentity black-fade-out
    @cmd changeopenborvariant "nopause" 1
    @cmd paus0001 1 1000000000 #paus0001 {toggle} {time}
    @cmd changelevelproperty "bgspeed" 0 # changelevelproperty {bgspeed} {value} # Stop background from speeding
    spawnframe 49 0 240 0 0 # spawnframe {frame} {x} {z} {y} {relative}
    @cmd spawn06 "Black" 0 0 660
    frame data/chars/misc/continueanim/counbase.png # 0
    @cmd paus0001 1 1000000000
    frame data/chars/misc/continueanim/count091.png # 2
    delay 160
    sound data/sounds/nine.wav
    @cmd paus0001 1 1000000000
    frame data/chars/misc/continueanim/count09.png # 3
    delay 9
    @cmd paus0001 1 1000000000
    frame data/chars/misc/continueanim/count091.png # 7
    delay 18
    @cmd paus0001 1 1000000000
    frame data/chars/misc/continueanim/counbase.png # 9
    @cmd paus0001 1 1000000000
    delay 9
    frame data/chars/misc/continueanim/count081.png # 10
    delay 160
    sound data/sounds/eight.wav
    @cmd paus0001 1 1000000000
    frame data/chars/misc/continueanim/count08.png # 11
    delay 9
    @cmd paus0001 1 1000000000
    frame data/chars/misc/continueanim/count081.png # 12
    delay 18
    @cmd paus0001 1 1000000000
    frame data/chars/misc/continueanim/counbase.png # 14
    delay 9
    @cmd paus0001 1 1000000000
    frame data/chars/misc/continueanim/count071.png # 15
    delay 160
    @cmd paus0001 1 1000000000
    sound data/sounds/seven.wav
    frame data/chars/misc/continueanim/count07.png # 16
    delay 9
    @cmd paus0001 1 1000000000
    frame data/chars/misc/continueanim/count071.png # 17
    delay 18
    @cmd paus0001 1 1000000000
    frame data/chars/misc/continueanim/counbase.png # 19
    delay 9
    @cmd paus0001 1 1000000000
    frame data/chars/misc/continueanim/count061.png # 20
    delay 260
    sound data/sounds/six.wav
    @cmd paus0001 1 1000000000
    frame data/chars/misc/continueanim/count06.png # 21
    delay 9
    @cmd paus0001 1 1000000000
    frame data/chars/misc/continueanim/count061.png # 22
    frame data/chars/misc/continueanim/counbase.png # 23
    frame data/chars/misc/continueanim/counbase.png # 24
    frame data/chars/misc/continueanim/count051.png # 25
    delay 260
    @cmd paus0001 1 1000000000
    sound data/sounds/five.wav
    frame data/chars/misc/continueanim/count05.png # 26
    delay 9
    @cmd paus0001 1 1000000000
    frame data/chars/misc/continueanim/count051.png # 27
    frame data/chars/misc/continueanim/counbase.png # 28
    frame data/chars/misc/continueanim/counbase.png # 29
    frame data/chars/misc/continueanim/count041.png # 30
    delay 260
    @cmd paus0001 1 1000000000
    sound data/sounds/four.wav
    frame data/chars/misc/continueanim/count04.png # 31
    delay 9
    @cmd paus0001 1 1000000000
    frame data/chars/misc/continueanim/count041.png # 32
    frame data/chars/misc/continueanim/counbase.png # 33
    frame data/chars/misc/continueanim/counbase.png # 34
    frame data/chars/misc/continueanim/count031.png # 35
    delay 260
    @cmd paus0001 1 1000000000
    sound data/sounds/three.wav
    frame data/chars/misc/continueanim/count03.png # 36
    delay 9
    @cmd paus0001 1 1000000000
    frame data/chars/misc/continueanim/count031.png # 37
    frame data/chars/misc/continueanim/counbase.png # 38
    frame data/chars/misc/continueanim/counbase.png # 39
    frame data/chars/misc/continueanim/count021.png # 40
    delay 260
    @cmd paus0001 1 1000000000
    sound data/sounds/two.wav
    frame data/chars/misc/continueanim/count02.png # 41
    delay 9
    @cmd paus0001 1 1000000000
    frame data/chars/misc/continueanim/count021.png # 42
    frame data/chars/misc/continueanim/counbase.png # 43
    frame data/chars/misc/continueanim/counbase.png # 44
    frame data/chars/misc/continueanim/count011.png # 45
    delay 260
    @cmd paus0001 1 1000000000
    sound data/sounds/one.wav
    frame data/chars/misc/continueanim/count01.png # 46
    delay 9
    @cmd paus0001 1 1000000000
    frame data/chars/misc/continueanim/count011.png # 47
    frame data/chars/misc/continueanim/counbase.png # 48
    frame data/chars/misc/continueanim/counbase.png # 49
    frame data/chars/misc/continueanim/count001.png # 50
    delay 260
    @cmd paus0001 1 1000000000
    #sound data/sounds/timeover.wav
    @cmd PlayerDies
    frame data/chars/misc/continueanim/count00.png # 51
    delay 9
    @cmd paus0001 1 1000000000
    frame data/chars/misc/continueanim/count001.png # 52
    frame data/chars/misc/continueanim/counbase.png # 53
    #delay 180
    frame data/chars/misc/continueanim/counbase.png # 54
    delay 210
    @cmd playmusic "data/music/gameover.bor"
    #@cmd settextobj 0 138 60 3 145000000 "Game_Over" # settextobj {index} {x} {y} {font} {text}
    @cmd settextobj 1 138 60 3 145000000 "Game_Over"
    frame data/chars/misc/continueanim/counbase.png # 55
    delay 112
    frame data/chars/misc/continueanim/counbase.png # 56
    @cmd jumptobranch "end" 1
    frame data/chars/misc/continueanim/counbase.png # 57

anim follow1
    flipframe 0
    offset    1 1
    delay 10
@script
    changeopenborvariant("nopause", 0);
@end_script
    @cmd clearglobalvar
    frame data/chars/misc/continueanim/counbase.png
    delay 1
    @cmd jumptobranch "Arcade_Select" 1
    #frame data/chars/misc/continueanim/counbase.png
    @cmd killentity getlocalvar("self")
    frame data/chars/misc/continueanim/counbase.png

Sorry for making my posts too long.
 
Last edited:
cannot press any button to rush its countdown
As a suggestion, you can rush the countdown by pressing the directional buttons instead of start or attack buttons.
Another suggestion is to use the combo "timetick+updated" events instead of creating a "countdown" entity. This way the countdown will not be stopped by type text entities.
 
Back
Top Bottom