O Ilusionista said:Looking from the top of my head, yes.
There is a openborvariant called "in_showcomplete", which is triggered when this screen appears.
You would need to interrupt the button presses while you are on this screen. I never did it myself, but maybe Kratus can help you since he made a custom menu and those button presses can work on the same way he did.
void main()
{//Global keyall scripts, detects player index
void player = getlocalvar("player");
if(openborvariant("in_showcomplete")){
if(playerkeys(player, 1, "moveleft")){
changeopenborvariant("slowmotion", 2); //SLOW SPEED
}
if(playerkeys(player, 1, "moveright")){
changeopenborvariant("slowmotion", 0); //NORMAL SPEED
}
}
}
void main()
{//GLOBAL OPERATIONS
if(openborvariant("in_showcomplete")){
changeplayerproperty(0, "disablekeys", openborconstant("FLAG_ATTACK")); //DISABLE KEY FOR PLAYER 1
changeplayerproperty(1, "disablekeys", openborconstant("FLAG_ATTACK")); //DISABLE KEY FOR PLAYER 2
changeplayerproperty(2, "disablekeys", openborconstant("FLAG_ATTACK")); //DISABLE KEY FOR PLAYER 3
changeplayerproperty(3, "disablekeys", openborconstant("FLAG_ATTACK")); //DISABLE KEY FOR PLAYER 4
}
}
changeplayerproperty(0, "disablekeys", openborconstant("FLAG_ATTACK")+openborconstant("FLAG_ATTACK2")+openborconstant("FLAG_ATTACK3")+openborconstant("FLAG_ATTACK4")+openborconstant("FLAG_JUMP")+openborconstant("FLAG_SPECIAL")+openborconstant("FLAG_START"));
changeplayerproperty(0, "disablekeys", 0);
changeplayerproperty(1, "disablekeys", 0);
changeplayerproperty(2, "disablekeys", 0);
changeplayerproperty(3, "disablekeys", 0);
Toranks, I made more tests and I found a way to increase score speed. Is a bizarre way but works lolToranks said:Thanks!
Can this method be used to speed up animation? In my case what I would like is to increase the speed in which the points are added
if(openborvariant("in_showcomplete")){ //IS IN COMPLETE SCREEN??
//INCREASE SPEED
if(playerkeys(0, 0, "movedown")){ //P1 HOLD BUTTON
changeopenborvariant("elapsed_time", openborvariant("elapsed_time")+1000);
}
else
if(playerkeys(1, 0, "movedown")){ //P2 HOLD BUTTON
changeopenborvariant("elapsed_time", openborvariant("elapsed_time")+1000);
}
//GO TO TOTAL SCORE WITHOUT CLOSE THE COMPLETE SCREEN
if(playerkeys(0, 1, "moveup")){ //P1 PRESS BUTTON
changeopenborvariant("elapsed_time", openborvariant("elapsed_time")+10000000);
}
else
if(playerkeys(1, 1, "moveup")){ //P2 PRESS BUTTON
changeopenborvariant("elapsed_time", openborvariant("elapsed_time")+10000000);
}
}
void main(){
void lv1 = getplayerproperty(0, "lives");
void lv2 = getplayerproperty(1, "lives");
void lv3 = getplayerproperty(2, "lives");
resetMaxRush();
score();
etc etc etc....
void score()
{//GLOBAL OPERATIONS
if(openborvariant("in_showcomplete")){
changeplayerproperty(0, "disablekeys", openborconstant("FLAG_ATTACK")+openborconstant("FLAG_ATTACK2")+openborconstant("FLAG_ATTACK3")+openborconstant("FLAG_ATTACK4")+openborconstant("FLAG_JUMP")+openborconstant("FLAG_SPECIAL")); //DISABLE KEY FOR PLAYER 1
changeplayerproperty(1, "disablekeys", openborconstant("FLAG_ATTACK")+openborconstant("FLAG_ATTACK2")+openborconstant("FLAG_ATTACK3")+openborconstant("FLAG_ATTACK4")+openborconstant("FLAG_JUMP")+openborconstant("FLAG_SPECIAL")); //DISABLE KEY FOR PLAYER 2
changeplayerproperty(2, "disablekeys", openborconstant("FLAG_ATTACK")+openborconstant("FLAG_ATTACK2")+openborconstant("FLAG_ATTACK3")+openborconstant("FLAG_ATTACK4")+openborconstant("FLAG_JUMP")+openborconstant("FLAG_SPECIAL")); //DISABLE KEY FOR PLAYER 3
//INCREASE SPEED
if(playerkeys(0, 0, "moveup")){ //P1 HOLD BUTTON
changeopenborvariant("elapsed_time", openborvariant("elapsed_time")+100);
}
else
if(playerkeys(1, 0, "moveup")){ //P2 HOLD BUTTON
changeopenborvariant("elapsed_time", openborvariant("elapsed_time")+100);
}
else
if(playerkeys(2, 0, "moveup")){ //P3 HOLD BUTTON
changeopenborvariant("elapsed_time", openborvariant("elapsed_time")+100);
}
//GO TO TOTAL SCORE WITHOUT CLOSE THE COMPLETE SCREEN
if(playerkeys(0, 1, "movedown")){ //P1 PRESS BUTTON
changeopenborvariant("elapsed_time", openborvariant("elapsed_time")+1000);
}
else
if(playerkeys(1, 1, "movedown")){ //P2 PRESS BUTTON
changeopenborvariant("elapsed_time", openborvariant("elapsed_time")+1000);
}
else
if(playerkeys(2, 1, "movedown")){ //P3 PRESS BUTTON
changeopenborvariant("elapsed_time", openborvariant("elapsed_time")+1000);
}
}
}
Toranks said:Thanks! This works for me, it is exactly what I was looking for
I only have one problem left to solve. Can't I disable the attack button and use it to accelerate, instead of directions? It would be more intuitive. Without a manual, people may not know how to advance.
I'm using this code and it works fine. This lets skip the screen by pressing start, but not another button. This is for a 3 players game.
O Ilusionista said:Kratus hahahahah changing elapsedtime was very smart
But doesn't this affects other things? AFAIK, elapsedtime is a number which constantly increases since you run the engine until you shut it down.
Damon Caskey said:Elapsed time resets when a level starts. There's no global timer, so if you need one you'll need to script it.
DC
ToranksToranks said:This solution has an unexpected bug. With @Kratos script, the score added does not increases lives counter correctly, it simply ignores the score number and starts again on the next screen. What can be the cause?
Kratus said:Yeah, I tested and really this problem happens, but for some strange reason I discovered that the lives not changed even if no key is held or pressed, maybe some bug with Lifescore in models.txt.
I'm making more tests to find a solution
After many tests, I can say that this is a random issue but is not related to any script. I tested in many builds from 4432 to 6330, tested other mods, deactivated most of the scripts but no success.Toranks said:Kratus said:Yeah, I tested and really this problem happens, but for some strange reason I discovered that the lives not changed even if no key is held or pressed, maybe some bug with Lifescore in models.txt.
I'm making more tests to find a solution
Thanks! I will be pending
Hi ToranksToranks said:Perhaps it can be solved by simulating attack button pressing at the end of the scoring screen via script?
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 = 100000; //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
}
}
}
Kratus said:Hi Toranks
As I promissed, I found a way to avoid this issue by simulating the same "lifescore" native engine function with script.
This was possible thanks to the source code that gave me some lights. Basically you need to create a global event file called "score1.c", that is used by player 1 when your score make any change (score2.c for player 2 and so on...). Simply put this file in the folder "data/scripts" and copy the following code:
setglobalvar("next1up0",7250000);
Great! I'm glad it workedToranks said:Kratus said:Hi Toranks
As I promissed, I found a way to avoid this issue by simulating the same "lifescore" native engine function with script.
This was possible thanks to the source code that gave me some lights. Basically you need to create a global event file called "score1.c", that is used by player 1 when your score make any change (score2.c for player 2 and so on...). Simply put this file in the folder "data/scripts" and copy the following code:
It works!
On the last minute of this video you can see the complete code in action. A controlled score screen, 2 lives added (1 every 250.000), and a new globalvar on save file:
So, this is save-compatible. I delete all globalvars on main screen with another script, just in case.Code:setglobalvar("next1up0",7250000);
I will add it to the game update, a lot of thanks!!