SOLVED Score screen can be controlled?

Toranks

Active member
Is there a way to pause at each subtotal and total pushing any button, instead of closing the screen entirely?
If I don't press any button, punctuation is added at a constant speed. Can I change that speed?
Thanks!
 
EDIT: This is because a clearglobalvar at the stage start. Fixed with this:

Code:
spawn   ghosttime
@script
void main()
{
	setlocalvar("maxRush1", getglobalvar("maxRush1"));
	setlocalvar("maxRush2", getglobalvar("maxRush2"));
	setlocalvar("maxRush3", getglobalvar("maxRush3"));
	setlocalvar("next1up0", getglobalvar("next1up0"));
	setlocalvar("next1up1", getglobalvar("next1up1"));
	setlocalvar("next1up2", getglobalvar("next1up2"));
	clearglobalvar();
	setglobalvar("maxRush1", getlocalvar("maxRush1"));
	setglobalvar("maxRush2", getlocalvar("maxRush2"));
	setglobalvar("maxRush3", getlocalvar("maxRush3"));
	setglobalvar("next1up0", getlocalvar("next1up0"));
	setglobalvar("next1up1", getlocalvar("next1up1"));
	setglobalvar("next1up2", getlocalvar("next1up2"));
}
@end_script
health	5
coords  30 240
at      0

FIXED
What happens here?
Every time I make the first hit here, a lot of extra lives are added (the maximum in this game is 15).
Disabling the script does not happen.
This is the globalvar value cached:
Code:
setglobalvar("next1up0",12250000);

This is the code:
score1.c
Code:
void main()
{
	lifeScore(0);
}

void lifeScore(int player)
{//Custom LifeScore script for add lives, used to avoid native engine LifeScore issue
	void self	  = getplayerproperty(player, "entity");
	int score	  = getplayerproperty(player, "score");
	int lifeScore     = 250000; //DEFINED LIFESCORE TARGET TO ADD EACH LIVE
	int add		  = 1; //HOW MUCH LIVES WILL BE ADDED WHEN SCORE REACHED THE TARGET
	
	//USED TO CHECK IF THE PLAYER IS IN A NEW GAME
	if(getglobalvar("next1up"+player) == NULL()){
		setglobalvar("next1up"+player, lifeScore);
	}
	
	//USED TO ADD LIVES TO PLAYER
	if(self != NULL()){ //CURRENT PLAYER REMAINS IN GAME??
		while(score >= getglobalvar("next1up"+player)){ //CURRENT SCORE REACHED THE LAST DEFINED TARGET??
			int lives = getplayerproperty(player, "lives"); //CHECK CURRENT LIVES EVERYTIME THIS TASK RUNS
			playsample(openborconstant("SAMPLE_1UP"), 0, 120, 120, 100, 0); //PLAY SAMPLE
			changeplayerproperty(player, "lives", lives+add); //ADD +1 LIVE
			setglobalvar("next1up"+player, getglobalvar("next1up"+player)+lifeScore); //DEFINE AND SAVE THE NEXT TARGET
		}
	}
}
 
If one of the players exits the game and then re-enters the game, starting again with a score of 0, the variable is not reset. So I suggest adding this to all scripts on scorex.c files

//USED TO CHECK IF THE PLAYER IS IN A NEW GAME
if(getglobalvar("next1up"+player) == NULL() || self == NULL()){
setglobalvar("next1up"+player, lifeScore);
}

It is possible that if in a game where the score is reset to 0 after losing one credit, the code may not work well. However, my game does not reset the score, so I will not make any further modifications. But I warn other people who can use the code, they should add another extra condition to detect this.
 
Toranks said:
If one of the players exits the game and then re-enters the game, starting again with a score of 0, the variable is not reset. So I suggest adding this to all scripts on scorex.c files

//USED TO CHECK IF THE PLAYER IS IN A NEW GAME
if(getglobalvar("next1up"+player) == NULL() || self == NULL()){
setglobalvar("next1up"+player, lifeScore);
}

Is possible that if in a game where the score is reset to 0 after losing one credit, the code may not work well. However, my game does not reset the score, so I will not make any further modifications. But I warn other people who can use the code, they should add another extra condition to detect this.

Toranks
It is good to know that, thanks. I didn't see that because my game never reset the score, same as your game.
Another suggestion that I will test yet, you can get the moment that the player is joining the game again using getplayerproperty(player, "joining") and reset the variable, because this event happens only when the player loses one "credit" and need to select the character again.
 
Back
Top Bottom