• 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.

he is idle like in BOR 1.0.
How is the idle in the BOR 1.0?

when enemies and obstacles are not visible
This problem is more related to how the level is built instead of the cpu partner behaviour (but again, you can change the "hostile" property directly in the "think" script if want).
In SORX for example I always call the enemies and obstacles gradually, but you can use the "stealth" function in case any obstacle needs to be invisible to cpu partners, I use this feature sometimes too.
 
Hi @Kratus , I think to have understood when you wrote:
1- this problem is more related to how the level is built instead of the cpu partner behaviour;
2- in SORX for example I always call the enemies and obstacles gradually

I entered in 64th.1.txt and I changed the positions of the objects with "at 0". I put them all within 320 pixels in length since the video resolution of the game is 320 x 240. Infact the cpu partner goes to destruct them and then, with follow caller automatic, he came near me and stopped. If he didn't stop is because at least one of the objects at 0 had coordinates over 320 pixels in length.

Is it like I wrote?


And one question: if a game has already in the folder scripts for example two files updated and updated_ , the content of the file updated of partner cpu where has to go?
 
Last edited:
Hi @Steven1985

Is it like I wrote?
Yes, it's exactly that :)

And one question: if a game has already in the folder scripts for example two files updated and updated_ , the content of the file updated of partner cpu where has to go?
In this case you need to mix all the content in the same file. But this "updated" file is a native engine event and will not work if you rename it to "updated_"
Maybe you are referring to "update.c" and "updated.c".
 
Hi @Kratus , all ok?
I thought one thing after watching the gameplay of the game Final Fight PC 2018. In this game, before to start every stage, you have the possibility to select the character and his attire. Could you insert in the partner menu the option "automatic respawn of the partner in every stage : yes or no" and to "spawn partner" also the possibility to choose his attire if he has more of one?
 
Hi @Kratus , all ok?
I thought one thing after watching the gameplay of the game Final Fight PC 2018. In this game, before to start every stage, you have the possibility to select the character and his attire. Could you insert in the partner menu the option "automatic respawn of the partner in every stage : yes or no" and to "spawn partner" also the possibility to choose his attire if he has more of one?
Hello friend!
Did you mean the possibility to change the palette or the model?
And do you want the possibility to totally turn off the automatic respawn, right?
 
Hello friend!
Did you mean the possibility to change the palette or the model?
And do you want the possibility to totally turn off the automatic respawn, right?
I would like there to be an option in the partner menu that allows you to choose whether once you have completed the stage you want the partner to be automatically spawned or not. If you choose "not", it's up to you to spawn him manually always if you want . This should not apply if you move from one level to another of the same stage.

If you spawn a partner from the menu, I would also like there to be the possibility to choose which palette he uses.
 
No it's not using ammo at all. That's the thing. I have it set up to where it just does the gravity stuff without ammo use. But it does need to have ammo in order to use the gravity feature. I think that's where changes need to be made in the def file like it was suggested. But when I press fire and get out of zoom mode the weapon switches back to the last weapon. And if I switch back to the soulcube it still has ammo. Crazy.


 
No it's not using ammo at all. That's the thing. I have it set up to where it just does the gravity stuff without ammo use. But it does need to have ammo in order to use the gravity feature. I think that's where changes need to be made in the def file like it was suggested. But when I press fire and get out of zoom mode the weapon switches back to the last weapon. And if I switch back to the soulcube it still has ammo. Crazy.


I am afraid that you have the wrong section.
 
Hi @Kratus , in BOR 1.0 (by which I am developing the game) there are three elements: knife, shot and star.
They are found in the misc folder and in obenBOR Stats are found in enemies. I would like to know if I also have to add hostile player npc and candamage player npc obstacle in their header files. Thanks in advance.
 
Hi @Kratus , in BOR 1.0 (by which I am developing the game) there are three elements: knife, shot and star.
They are found in the misc folder and in obenBOR Stats are found in enemies. I would like to know if I also have to add hostile player npc and candamage player npc obstacle in their header files. Thanks in advance.
Hi @Steven1985
I don't know what spawn method you are using, but usually for projectiles I suggest to add the candamage properties only, no need to add the hostile.
 
Hi @Kratus , one thing came to my mind: in partner menu as you put follow caller automatic and manual with comand "call", in the next version could you add get food automatic and manual with comand "eat" or other word? :) Thanks in advance for the answer.
 
Hi @Kratus , one thing came to my mind: in partner menu as you put follow caller automatic and manual with comand "call", in the next version could you add get food automatic and manual with comand "eat" or other word? :) Thanks in advance for the answer.
Yeah, it's a good idea. I added it to my "todo" list :)
 
Hi @Kratus, in keyall I changed the button to display the menu partner, instead of screenshot I put attack3 to have the ability with F12 to take a screenshot and still the F12 key doesn't take a screenshot for me anymore.
 
Hi @Kratus, in keyall I changed the button to display the menu partner, instead of screenshot I put attack3 to have the ability with F12 to take a screenshot and still the F12 key doesn't take a screenshot for me anymore.
Hi @Steven1985, you need to remove the "noscreenshot" code inside the updated.c file.
 
Hi @Kratus, under respawn in the partner menu I replaced "each new level" with "manual". I tried it and it works. Did I do it right?

Keyall:

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", "manual");}else
                if(getglobalvar("partnerRespawn") == "manual"){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") == "Max_"){setglobalvar("selectPartner", "Mandy_");}else
                if(getglobalvar("selectPartner") == "Mandy_"){setglobalvar("selectPartner", "Max_");}
            }
        }
        
        //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", "manual");}else
                if(getglobalvar("partnerRespawn") == "manual"){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") == "Max_"){setglobalvar("selectPartner", "Mandy_");}else
                if(getglobalvar("selectPartner") == "Mandy_"){setglobalvar("selectPartner", "Max_");}
            }
        }

        //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());
                }
            }
        }
    }
}

Ondeath

C:
void main()
{
    partnerAlive(0);
    partnerRespawn();
}

void partnerAlive(int flag)
{//Set global variable "partnerAlive" flag to 0

    setglobalvar("partnerAlive", flag);
    setglobalvar("partnerParrow", NULL());
}

void partnerRespawn()
{//Automatic CPU partner respawn if this option is activated in Partner Menu
    
    if(getglobalvar("partnerRespawn") == "instantly"){
        void self        = getlocalvar("self");
        void player1    = getplayerproperty(0, "entity");
        void player2    = getplayerproperty(1, "entity");
        void player3    = getplayerproperty(2, "entity");
        void player4    = getplayerproperty(3, "entity");
        float x;
        float y;
        float z;
        int dir;
        
        if(player1 != NULL()){
            x    = getentityproperty(player1, "x");
            y    = getentityproperty(player1, "y");
            z    = getentityproperty(player1, "z");
            dir    = getentityproperty(player1, "direction");
        }
        else
        if(player2 != NULL()){
            x    = getentityproperty(player2, "x");
            y    = getentityproperty(player2, "y");
            z    = getentityproperty(player2, "z");
            dir    = getentityproperty(player2, "direction");
        }
        else
        if(player3 != NULL()){
            x    = getentityproperty(player3, "x");
            y    = getentityproperty(player3, "y");
            z    = getentityproperty(player3, "z");
            dir    = getentityproperty(player3, "direction");
        }
        else
        if(player4 != NULL()){
            x    = getentityproperty(player4, "x");
            y    = getentityproperty(player4, "y");
            z    = getentityproperty(player4, "z");
            dir    = getentityproperty(player4, "direction");
        }

        if(getglobalvar("partnerAlive") == 0){
            void vSpawn;
            void partner    = getglobalvar("currentPartner");
            void pName        = getentityproperty(partner, "defaultname");
            int iPIndex        = getglobalvar("partnerIndex");
            int pMp            = getentityproperty(self, "mp");
            int yDif        = 1000;

            loadmodel(getglobalvar("selectPartner"), 3);
            clearspawnentry(); //CLEAR CURRENT SPAWN ENTRY
            setspawnentry("name", pName); //ACQUIRE SPAWN ENTITY BY NAME
            vSpawn = spawn(); //SPAWN IN ENTITY
            changeentityproperty(vSpawn, "position", x, z, y+yDif); //SET SPAWN POSITION
            changeentityproperty(vSpawn, "direction", dir); //SET SPAWN DIRECTION
            setglobalvar("partnerMp", pMp);
            
            setglobalvar("selectPartner", pName); //SET AS CURRENT SPAWNED PARTNER
            setglobalvar("currentPartner", vSpawn); //SET AS CURRENT SPAWNED PARTNER
            
            return vSpawn; //RETURN SPAWN
        }
    }
    
    if(getglobalvar("partnerRespawn") == "manual"){
        void self = getlocalvar("self");
        int pMp      = getentityproperty(self, "mp");
        
        setglobalvar("partnerMp", pMp);
    }
}
 
The code that load partners is in the level.c in case you want to make some experiments. In the current version,the script is not prepared to support more than 2 partners.
Hi @Kratus, today I made again some experiments to spawn more partners when a new level starts for my game in development but nothing.
 
Hi @Kratus, I'd like to know if there will a new portable version of the partner menu.
With the occasion I want to tell you that, forgetting to put
#CPU PARTNER NECESSARY CONFIGS
#DON'T FORGET TO SET ITEM'S STEALTH FACTOR TO WORK WITH "GET FOOD" OPTION
stealth 1
in every food .txt file in my game anyway with get food active the allies go and get it
Thanks in advance.
 
Last edited:
Back
Top Bottom