• All, I am currently in the process of migrating domain registrations. During this time there may be some intermittent outages or slowdowns. Please contact staff if you have any questions.

Add the partner menu of streets of rage 2 by Kratus in all OpenBOR games.

@Steven1985

I thought that you need the script to apply in a specific project, but if I'm not wrong you want a "portable" version of the latest partner menu to apply into every game you want to play, right?
Exact.

@Steven1985

The scripts I posted before were a basic example that is already portable for any game. All you need to do is to repeat the process adding more options to it.
In fact, as I wrote to you earlier, I followed your basic script instructions step by step with the two games mentioned and I had two different problems.

@Steven1985

However, I can create a portable version of the latest partner menu further, but I need to finish some things on the game first. Currently I'm not having too much time due to my job, but I will do it as soon as I can.
You are very kind thank you very much! :)
 
@Steven1985

I thought that you need the script to apply in a specific project, but if I'm not wrong you want a "portable" version of the latest partner menu to apply into every game you want to play, right?

It can be a bit complicated because every game was developed in different ways, some can be easier to apply and others can be hard, causing bugs.
The scripts I posted before were a basic example that is already portable for any game. All you need to do is to repeat the process adding more options to it.

The full version of the latest partner menu used on SORX contains a lot of other codes that affect many aspects of the game, you can find some conflicts depending on the game you try to apply because this menu was designed specifically for SORX.

However, I can create a portable version of the latest partner menu further, but I need to finish some things on the game first. Currently I'm not having too much time due to my job, but I will do it as soon as I can.
@Kratus From what I read in your Streets of Rage X topic is the "portable script" available now?
 
Hi @Kratus, in the game Final Fight X I tried to put the scripts taken by your Streets of Rage 2.3.1 and to adapt them to the game self because when it starts a new level I want that npcs don't disappear and they maintain the amount of health with which they finished the previous level since each npc spawned subtracts 1 life from the player. I tried but It doesn't work.

Another thing: in cody_npc.txt I inserted subtype follow and to anim idle range 0 481, rangea -999 999, rangez -999 999 (like in Streets of Rage 2.3.1) because I don't want that he wander randomly if no hostiles are available. I also tried this but nothing.

Could you have a look?

 
@Steven1985

Here's the portable version of the partner menu. I recorded a video to show how to apply in your game.
Please, post here in case you have any questions.

You can get the files here.


EDIT: Some explanations about buttons:
- You can configure any button to use the Partner Menu, in this video I defined to use the "screenshot" (and disabled this function it on the updated.c file)
- You can configure any button to use the "Call" command, in this video I defined to use the "attack4"
- All button configurations are in the "keyall.c" file
 
Last edited:
Hi @Kratus,
what a wonderful surprise you gave me! You made me understand that the SORX style partner's scripts would be ready who knows when.
Thank you very very much! You are excellent as always !
I would have three questions to ask you about it:
1) Is it possible to spawn more than one partner with these scripts?
2) Out of curiosity, was this wonderful "portable script" just a request from me or was there someone else as well?
3) If once the scripts are inserted, I start OpenBOR and it closes immediately because there is an error in OpenBorLog, what should I do?
 
Hi @Kratus,
what a wonderful surprise you gave me! You made me understand that the SORX style partner's scripts would be ready who knows when.
Thank you very very much! You are excellent as always !
I would have three questions to ask you about it:
1) Is it possible to spawn more than one partner with these scripts?
2) Out of curiosity, was this wonderful "portable script" just a request from me or was there someone else as well?
3) If once the scripts are inserted, I start OpenBOR and it closes immediately because there is an error in OpenBorLog, what should I do?
I'm glad you liked the script :)

About your questions:

1)Yes, I created a single rule to lock but it can be removed easily. All you need to do is to replace all the keyall.c content by this one below

C:
void main()
{//Global keyall scripts, detects player index
    int player = getlocalvar("player");
    
    if(player == 0 && openborvariant("count_players") <= 1){
        menuPartners(player);
    }
}

void menuPartners(int player)
{//Adjust CPU partner mode and aggression
    void self        = getplayerproperty(player, "entity");
    int highlight    = getglobalvar("highlight");
    int hasplayed    = getplayerproperty(player, "hasplayed");
    int dir            = getentityproperty(self, "direction");
    int max            = 6;
    int min            = 0;
    int add            = 1;
    float x            = getentityproperty(self, "x");
    float y            = getentityproperty(self, "y");
    float z            = getentityproperty(self, "z");

    //MAIN COMMAND TO OPEN AND CLOSE PARTNER MENU
    if(playerkeys(player, 1, "screenshot") && hasplayed){ //SELECT BUTTON IS PRESSED??
        if(openborvariant("in_level")){ //CHECK IF THE GAME IS IN ANY LEVEL AND ARCADE LOCK IS "0"
            if(!openborvariant("pause") && !openborvariant("in_options")){ //CHECK IF THE GAME IS NOT PAUSED OR IN OPTIONS
                if(getglobalvar("activeText") == 0){ //CHECK IF ANY MENU IS ALREADY ON
                    playsample(openborconstant("SAMPLE_BEEP2"), 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0); //PLAY SAMPLE
                    changeopenborvariant("nopause", 1); //LOCK PAUSE COMMAND
                    changeopenborvariant("textbox", 1); //CALL TEXTBOX TO FREEZE THE GAME
                    setglobalvar("highlight", 0); //SET TO THE FIRST HIGHLIGHTED OPTION
                    setglobalvar("activeText", "Partner"); //SET ACTIVE TEXT ON SCREEN TO "EXTRA MENU" TO ACTIVATE OTHER SCRIPTS
                }
                else
                if(getglobalvar("activeText") == "Partner"){ //CHECK IF EXTRA MENU IS ALREADY ON
                    playsample(openborconstant("SAMPLE_BEEP2"), 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0); //PLAY SAMPLE
                    changeopenborvariant("nopause", 0); //UNLOCK PAUSE COMMAND
                    changeopenborvariant("textbox", NULL()); //CLEAR TEXTBOX TO NOT FREEZE THE GAME
                    setglobalvar("highlight", 0); //RESET HIGHLIGHT VARIABLE TO DEFAULT
                    setglobalvar("activeText", 0); //SET ACTIVE TEXT ON SCREEN TO "0" TO DEACTIVATE OTHER SCRIPTS
                }
            }
        }
    }
    
    if(getglobalvar("activeText") == "Partner" && hasplayed){

        //HIGHLIGHT OPTIONS WHEN MOVE DOWN
        if(playerkeys(player, 1, "movedown")){
            playsample(openborconstant("SAMPLE_BEEP"), 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0); //PLAY SAMPLE
            if(highlight >= min && highlight < max){setglobalvar("highlight", highlight+add);}
            if(highlight == max){setglobalvar("highlight", min);}
        }
        
        //HIGHLIGHT OPTIONS WHEN MOVE UP
        if(playerkeys(player, 1, "moveup")){
            playsample(openborconstant("SAMPLE_BEEP"), 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0); //PLAY SAMPLE
            if(highlight > min && highlight <= max){setglobalvar("highlight", highlight-add);}
            if(highlight == min){setglobalvar("highlight", max);}
        }
        
        //CHANGE ALL OPTIONS INSIDE THIS MENU WHEN MOVE RIGHT
        if(playerkeys(player, 1, "moveright")){
            playsample(openborconstant("SAMPLE_BEEP"), 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0); //PLAY SAMPLE
            
            //IS PARTNER MODE HIGHLIGHTED??
            if(getglobalvar("highlight") == 0){
                if(getglobalvar("partnerMode") == "balanced"){setglobalvar("partnerMode", "attack");}else
                if(getglobalvar("partnerMode") == "attack"){setglobalvar("partnerMode", "defense");}else
                if(getglobalvar("partnerMode") == "defense"){setglobalvar("partnerMode", "balanced");}
            }
            
            //IS PARTNER AGGRESSION HIGHLIGHTED??
            if(getglobalvar("highlight") == 1){
                if(getglobalvar("partnerAggression") == "*"){setglobalvar("partnerAggression", "**");}else
                if(getglobalvar("partnerAggression") == "**"){setglobalvar("partnerAggression", "***");}else
                if(getglobalvar("partnerAggression") == "***"){setglobalvar("partnerAggression", "****");}else
                if(getglobalvar("partnerAggression") == "****"){setglobalvar("partnerAggression", "*****");}else
                if(getglobalvar("partnerAggression") == "*****"){setglobalvar("partnerAggression", "******");}else
                if(getglobalvar("partnerAggression") == "******"){setglobalvar("partnerAggression", "*******");}else
                if(getglobalvar("partnerAggression") == "*******"){setglobalvar("partnerAggression", "********");}else
                if(getglobalvar("partnerAggression") == "********"){setglobalvar("partnerAggression", "*********");}else
                if(getglobalvar("partnerAggression") == "*********"){setglobalvar("partnerAggression", "*");}
            }
            
            //IS PARTNER GET FOOD HIGHLIGHTED??
            if(getglobalvar("highlight") == 2){
                if(getglobalvar("partnerGetFood") == "yes"){setglobalvar("partnerGetFood", "no");}else
                if(getglobalvar("partnerGetFood") == "no"){setglobalvar("partnerGetFood", "yes");}
            }
            
            //IS PARTNER FOLLOW HIGHLIGHTED??
            if(getglobalvar("highlight") == 3){
                if(getglobalvar("partnerFollow") == "automatic"){setglobalvar("partnerFollow", "manual");}else
                if(getglobalvar("partnerFollow") == "manual"){setglobalvar("partnerFollow", "automatic");}
            }
            
            //IS PARTNER RESPAWN HIGHLIGHTED??
            if(getglobalvar("highlight") == 4){
                if(getglobalvar("partnerRespawn") == "instantly"){setglobalvar("partnerRespawn", "each_new_level");}else
                if(getglobalvar("partnerRespawn") == "each_new_level"){
                    if(getglobalvar("partnerAlive") == 0){setglobalvar("partnerIndex", NULL());}
                    setglobalvar("partnerRespawn", "instantly");
                }
            }

            //IS PARTNER LIFE BAR HIGHLIGHTED??
            if(getglobalvar("highlight") == 5){
                if(getglobalvar("partnerLifeBar") == "full_hud"){setglobalvar("partnerLifeBar", "simple");}else
                if(getglobalvar("partnerLifeBar") == "simple"){setglobalvar("partnerLifeBar", "full_hud");}
            }

            //IS PARTNER NAME HIGHLIGHTED??
            if(getglobalvar("highlight") == 6){
                if(getglobalvar("selectPartner") == "Billy"){setglobalvar("selectPartner", "Billy");}else
                if(getglobalvar("selectPartner") == "Billy"){setglobalvar("selectPartner", "Billy");}
            }
        }
        
        //CHANGE ALL OPTIONS INSIDE THIS MENU WHEN MOVE LEFT
        if(playerkeys(player, 1, "moveleft")){
            playsample(openborconstant("SAMPLE_BEEP"), 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0); //PLAY SAMPLE
            
            //IS PARTNER MODE HIGHLIGHTED??
            if(getglobalvar("highlight") == 0){
                if(getglobalvar("partnerMode") == "balanced"){setglobalvar("partnerMode", "defense");}else
                if(getglobalvar("partnerMode") == "defense"){setglobalvar("partnerMode", "attack");}else
                if(getglobalvar("partnerMode") == "attack"){setglobalvar("partnerMode", "balanced");}
            }
            
            //IS PARTNER AGGRESSION HIGHLIGHTED??
            if(getglobalvar("highlight") == 1){
                if(getglobalvar("partnerAggression") == "*"){setglobalvar("partnerAggression", "*********");}else
                if(getglobalvar("partnerAggression") == "*********"){setglobalvar("partnerAggression", "********");}else
                if(getglobalvar("partnerAggression") == "********"){setglobalvar("partnerAggression", "*******");}else
                if(getglobalvar("partnerAggression") == "*******"){setglobalvar("partnerAggression", "******");}else
                if(getglobalvar("partnerAggression") == "******"){setglobalvar("partnerAggression", "*****");}else
                if(getglobalvar("partnerAggression") == "*****"){setglobalvar("partnerAggression", "****");}else
                if(getglobalvar("partnerAggression") == "****"){setglobalvar("partnerAggression", "***");}else
                if(getglobalvar("partnerAggression") == "***"){setglobalvar("partnerAggression", "**");}else
                if(getglobalvar("partnerAggression") == "**"){setglobalvar("partnerAggression", "*");}
            }
            
            //IS PARTNER GET FOOD HIGHLIGHTED??
            if(getglobalvar("highlight") == 2){
                if(getglobalvar("partnerGetFood") == "yes"){setglobalvar("partnerGetFood", "no");}else
                if(getglobalvar("partnerGetFood") == "no"){setglobalvar("partnerGetFood", "yes");}
            }
            
            //IS PARTNER FOLLOW HIGHLIGHTED??
            if(getglobalvar("highlight") == 3){
                if(getglobalvar("partnerFollow") == "automatic"){setglobalvar("partnerFollow", "manual");}else
                if(getglobalvar("partnerFollow") == "manual"){setglobalvar("partnerFollow", "automatic");}
            }
            
            //IS PARTNER RESPAWN HIGHLIGHTED??
            if(getglobalvar("highlight") == 4){
                if(getglobalvar("partnerRespawn") == "instantly"){setglobalvar("partnerRespawn", "each_new_level");}else
                if(getglobalvar("partnerRespawn") == "each_new_level"){
                    if(getglobalvar("partnerAlive") == 0){setglobalvar("partnerIndex", NULL());}
                    setglobalvar("partnerRespawn", "instantly");
                }
            }

            //IS PARTNER LIFE BAR HIGHLIGHTED??
            if(getglobalvar("highlight") == 5){
                if(getglobalvar("partnerLifeBar") == "full_hud"){setglobalvar("partnerLifeBar", "simple");}else
                if(getglobalvar("partnerLifeBar") == "simple"){setglobalvar("partnerLifeBar", "full_hud");}
            }

            //IS PARTNER NAME HIGHLIGHTED??
            if(getglobalvar("highlight") == 6){
                if(getglobalvar("selectPartner") == "Billy"){setglobalvar("selectPartner", "Billy");}else
                if(getglobalvar("selectPartner") == "Billy"){setglobalvar("selectPartner", "Billy");}
            }
        }

        //SPAWN CPU PARTNER IN-GAME
        if(playerkeys(player, 1, "attack")){ //ATTACK BUTTON IS PRESSED??
            if(getglobalvar("highlight") == max){ //IS PARTNER SPAWN OPTION HIGHLIGHTED??
                //if(getglobalvar("partnerIndex") == NULL()){ //ONLY 1 PARTNER IS ALLOWED
                    playsample(openborconstant("SAMPLE_BEEP"), 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0); //PLAY SAMPLE
                    
                    //START THE SPAWN OPERATION
                    void vSpawn;
                    int height = 300;
                    loadmodel(getglobalvar("selectPartner"), 3);
                    clearspawnentry(); //CLEAR CURRENT SPAWN ENTRY
                    setspawnentry("name", getglobalvar("selectPartner")); //ACQUIRE SPAWN ENTITY BY NAME
                    vSpawn = spawn(); //SPAWN IN ENTITY
                    changeentityproperty(vSpawn, "position", x, z, y+height); //SET SPAWN POSITION
                    changeentityproperty(vSpawn, "direction", dir); //SET SPAWN DIRECTION
                    setglobalvar("highlight", 0); //RESET THE HIGHLIGHT OPTION
                    setglobalvar("partnerIndex", player); //SAVE THE CURRENT PARTNER "PARENT" INDEX
                    setglobalvar("currentPartner", vSpawn); //SAVE THE CURRENT PARTNER NAME

                    //CLOSE PARTNER MENU INSTANTLY
                    if(getglobalvar("activeText") == "Partner"){ //CHECK IF EXTRA MENU IS ALREADY ON
                        playsample(openborconstant("SAMPLE_BEEP2"), 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0); //PLAY SAMPLE
                        changeopenborvariant("nojoin", 1); //PREVENT OTHER PLAYERS TO ENTER IN THE GAME
                        changeopenborvariant("nopause", 0); //UNLOCK PAUSE COMMAND
                        changeopenborvariant("textbox", NULL()); //CLEAR TEXTBOX TO NOT FREEZE THE GAME
                        setglobalvar("highlight", 0); //RESET HIGHLIGHT VARIABLE TO DEFAULT
                        setglobalvar("activeText", 0); //SET ACTIVE TEXT ON SCREEN TO "0" TO DEACTIVATE OTHER SCRIPTS
                    }
                //}
            }
        }
    }
    
    //PARTNER CALL BUTTON AND CUSTOM PARROW USED IN ONDRAW.C AND THINK.C
    void player1 = getplayerproperty(0, "entity");
    void player2 = getplayerproperty(1, "entity");
    void player3 = getplayerproperty(2, "entity");
    void player4 = getplayerproperty(3, "entity");
    
    //USED TO MAKE THE SCRIPT WORKS WITH ANY PLAYER IN THE SCREEN AND WITH NO MENUS
    if(getglobalvar("activeText") == 0){
        if(playerkeys(player, 1, "attack4") && getglobalvar("partnerAlive") == 1){
            
            //USED TO CHANGE THE PARTNER INDEX IF THE CALLER IS DEAD
            if(getglobalvar("partnerIndex") == 0 && player1 == NULL()){
                if(player2 != NULL()){setglobalvar("partnerIndex", 1);}else
                if(player3 != NULL()){setglobalvar("partnerIndex", 2);}else
                if(player4 != NULL()){setglobalvar("partnerIndex", 3);}
            }
            if(getglobalvar("partnerIndex") == 1 && player2 == NULL()){
                if(player3 != NULL()){setglobalvar("partnerIndex", 2);}else
                if(player4 != NULL()){setglobalvar("partnerIndex", 3);}else
                if(player1 != NULL()){setglobalvar("partnerIndex", 0);}
            }
            if(getglobalvar("partnerIndex") == 2 && player3 == NULL()){
                if(player4 != NULL()){setglobalvar("partnerIndex", 3);}else
                if(player1 != NULL()){setglobalvar("partnerIndex", 0);}else
                if(player2 != NULL()){setglobalvar("partnerIndex", 1);}
            }
            if(getglobalvar("partnerIndex") == 3 && player4 == NULL()){
                if(player1 != NULL()){setglobalvar("partnerIndex", 0);}else
                if(player2 != NULL()){setglobalvar("partnerIndex", 1);}else
                if(player3 != NULL()){setglobalvar("partnerIndex", 2);}
            }
            
            //USED TO CALL PARTNER
            if(player == getglobalvar("partnerIndex")){
                if(getglobalvar("partnerParrow") != "call"){
                    playsample(openborconstant("SAMPLE_BEEP"), 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0); //PLAY SAMPLE
                    setglobalvar("partnerParrow", "call");
                }
                else
                {
                    playsample(openborconstant("SAMPLE_BEEP"), 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0); //PLAY SAMPLE
                    setglobalvar("partnerParrow", NULL());
                }
            }
        }
    }
}

2) I made it especially for your project, but I already received some other requests too.

3) For a game that doesn't have scripts, all can be done simply copying/pasting all the content, same as the video. If your game already has other scripts, you will need to mix them one by one.

Can you post the content of your log file?
 
Hi @Kratus ,

I saw the video and I'd like to know if the part:

#CPU PARTNER NECESSARY CONFIGS
#DON'T FORGET TO SET ITEM'S STEALTH FACTOR TO WORK WITH "GET FOOD" OPTION
stealth 1

that there is in apple.txt has to be put in every food element or it is not necessary.
 
Hi @Kratus ,

I saw the video and I'd like to know if the part:

#CPU PARTNER NECESSARY CONFIGS
#DON'T FORGET TO SET ITEM'S STEALTH FACTOR TO WORK WITH "GET FOOD" OPTION
stealth 1

that there is in apple.txt has to be put in every food element or it is not necessary.
Hi @Steven1985
Yes, this "stealth" config needs to be applied to all item entities that fill health (all foods).
 
Hi @Kratus ,
in the video when the partner dies and respawns, one life is not taken away from the player like in SORX.
For case in KEYALL.c has I put so?

C:
//SPAWN CPU PARTNER IN-GAME
        if(playerkeys(player, 1, "attack")){ //ATTACK BUTTON IS PRESSED??
            if(getglobalvar("highlight") == max){ //IS PARTNER SPAWN OPTION HIGHLIGHTED??
                if(lives >= 2){ //HAVE THE PLAYER ENOUGH LIVES TO DEDUCT??
                if(getglobalvar("partnerIndex") == NULL()){ //ONLY PLAYER 1 IS ALLOWED
                    playsample(openborconstant("SAMPLE_BEEP"), 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0); //PLAY SAMPLE
                    changeplayerproperty(player, "lives", lives-1); //DEDUCT PLAYER LIVES

                    //START THE SPAWN OPERATION
                    void vSpawn;
                    .......
 
Hi @Kratus ,
in the video when the partner dies and respawns, one life is not taken away from the player like in SORX.
For case in KEYALL.c has I put so?

C:
//SPAWN CPU PARTNER IN-GAME
        if(playerkeys(player, 1, "attack")){ //ATTACK BUTTON IS PRESSED??
            if(getglobalvar("highlight") == max){ //IS PARTNER SPAWN OPTION HIGHLIGHTED??
                if(lives >= 2){ //HAVE THE PLAYER ENOUGH LIVES TO DEDUCT??
                if(getglobalvar("partnerIndex") == NULL()){ //ONLY PLAYER 1 IS ALLOWED
                    playsample(openborconstant("SAMPLE_BEEP"), 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0); //PLAY SAMPLE
                    changeplayerproperty(player, "lives", lives-1); //DEDUCT PLAYER LIVES

                    //START THE SPAWN OPERATION
                    void vSpawn;
                    .......
Yes, I removed the code that takes one life from the player. Do you want to add this feature back?
 
Yes, considering that the npc now reappears when I start a new level.
In this case, you will need to deduct lives on the following files:

- "keyall.c", to deduct lives at the moment the user choose to spawn a partner
- "level.c", to deduct lives at the moment the partner is spawned when a new level is started but only if the previous level was completed with the partner alive (you can use the global variable "partnerAlive" for that purpose, use 1 = alive or 0 = dead)
- "ondeath.c" event, to deduct lives at the moment the partner is dead and then respawned if the player have enough lives and the respawn option is set to "instantly"
 
Hi @Kratus , I tried the partner menu with the game BOR like in the video and it is really funny!!! I completed the stage 1 with the lifebar of the partner that was not to 100 % and when I started the stage 2 the lifebar is not back full like mine (like the video SORX). It would be possible to insert this feature?
 
Hi @Kratus , I tried the partner menu with the game BOR like in the video and it is really funny!!! I completed the stage 1 with the lifebar of the partner that was not to 100 % and when I started the stage 2 the lifebar is not back full like mine (like the video SORX). It would be possible to insert this feature?
@Steven1985 Thanks for the report.
Please, can you test this updated version? I added a code to fill health after the "complete screen", same as I make on SORX.

 
Back
Top Bottom