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

Hi @Kratus , my friend ! :)
I'd like to know why cpu partner, beyond a certain distance, does not detect food.
Hi @Steven1985

I did some tests and can confirm that by default in the engine an item will be only detected by an A.I. character if the range is below half of the screen resolution.

So, using the partner menu template as an example, Billy will only detect the apple item beyond the middle of the screen. If you want to confirm, just change the resolution in the video.txt to type 6 (960x540) without changing the apple position, then you will see that Billy will detect it instantly after losing some health.

1744937996396.png
 
Hi @Steven1985

I did some tests and can confirm that by default in the engine an item will be only detected by an A.I. character if the range is below half of the screen resolution.

So, using the partner menu template as an example, Billy will only detect the apple item beyond the middle of the screen. If you want to confirm, just change the resolution in the video.txt to type 6 (960x540) without changing the apple position, then you will see that Billy will detect it instantly after losing some health.

View attachment 10534
Thank you :)
 
Hey @Kratus ! 😅

I'd like to take this opportunity to ask you about another change I've been meaning to make, so maybe you can help me sort both things out. 🙏


In addition to this I wanted to know how to create an exception, so that a special partner does not appear available in the selection, if a specific player is present in the game. 🤔

My idea is to include 6 special partners. 👇
Special partners (NPCs) have exactly the same name as the heroes, with a "_" at the end.
"TUSK_"
"RAIDEN_"
"LIU_KANG_"
"CAROLINA_"
"KITANA_"
"MIDAS_"
"JAGO_"

So for example, if you are playing with "TUSK", the special partner "TUSK_" should not appear to select. 👈

I hope you can help me with this, and I'm sure it can be useful to other members who want to implement this great system you've created. 💪

Thanks my friend! 🤜🤛
Hello @Kratus !

Have you been able to take a look at my post? 🤔
 
Hello @Kratus !

Have you been able to take a look at my post? 🤔
@dantedevil Hi friend! Sorry, I forgot to post an answer.

Indeed the partner menu script was not made thinking in such features, it would require several changes. I can give some tips:

- you can check player names by using getplayerproperty(index, "name").
- you can apply the new rules in the keyall.c, simply check the name if the player name exists and skip the cpu partner selection.

Below is an example about how you can code it. I didn't test, it's just a draft, I suggest making several tests to adapt to your game.

Code:
//IS PARTNER NAME HIGHLIGHTED??
if(getglobalvar("highlight") == 6){
    void playerName = getplayerproperty(player, "name");

    if(playerName == "Billy"){
        if(getglobalvar("selectPartner") == "Terry_"){setglobalvar("selectPartner", "Kyo_");}else
        if(getglobalvar("selectPartner") == "Kyo_"){setglobalvar("selectPartner", "Maxima_");}else
        if(getglobalvar("selectPartner") == "Maxima_"){setglobalvar("selectPartner", "Terry_");}
    }
    if(playerName == "Terry"){
        if(getglobalvar("selectPartner") == "Billy_"){setglobalvar("selectPartner", "Kyo_");}else
        if(getglobalvar("selectPartner") == "Kyo_"){setglobalvar("selectPartner", "Maxima_");}else
        if(getglobalvar("selectPartner") == "Maxima_"){setglobalvar("selectPartner", "Billy_");}
    }
    if(playerName == "Kyo"){
        if(getglobalvar("selectPartner") == "Billy_"){setglobalvar("selectPartner", "Terry_");}else
        if(getglobalvar("selectPartner") == "Terry_"){setglobalvar("selectPartner", "Maxima_");}else
        if(getglobalvar("selectPartner") == "Maxima_"){setglobalvar("selectPartner", "Billy_");}
    }
    if(playerName == "Maxima"){
        if(getglobalvar("selectPartner") == "Billy_"){setglobalvar("selectPartner", "Terry_");}else
        if(getglobalvar("selectPartner") == "Terry_"){setglobalvar("selectPartner", "Kyo_");}else
        if(getglobalvar("selectPartner") == "Kyo_"){setglobalvar("selectPartner", "Billy_");}
    }
}
 
Wow that's great! 😃
Thanks for the explanation my friend! 😁

Sorry but the only thing left for me to find a solution is the following: 👇

In my game, there are some very complex puzzle levels where it would be better if the NPC weren't present. :rolleyes:

I wanted to know how I can add an exception so that the partner doesn't appear in those specific levels, but reappears in subsequent levels. :unsure:

Thanks for all your help my friend! 🙏

It means a lot to me! ;)
 
Sorry but the only thing left for me to find a solution is the following: 👇
You can try to skip some levels by adding an condition before loading the cpu partner in the level.c file.

Code:
void main()
{
    void branch = openborvariant("current_branch");
    
    //IF NOT IN THE LEVELS BELOW, LOAD PARTNER NORMALLY
    if(branch != "level1" && branch != "level2" && branch != "level3" && branch != "level4")
    {
        loadPartner();
    }
}
 
Well @Kratus , I finally implemented the 2 updates without getting errors in the log and performed several tests with the 2 scripts.

I will detail the results. 😅

About this script: 👇
C++:
//IS PARTNER NAME HIGHLIGHTED??
if(getglobalvar("highlight") == 6){
    void playerName = getplayerproperty(player, "name");

    if(playerName == "Billy"){
        if(getglobalvar("selectPartner") == "Terry_"){setglobalvar("selectPartner", "Kyo_");}else
        if(getglobalvar("selectPartner") == "Kyo_"){setglobalvar("selectPartner", "Maxima_");}else
        if(getglobalvar("selectPartner") == "Maxima_"){setglobalvar("selectPartner", "Terry_");}
    }
    if(playerName == "Terry"){
        if(getglobalvar("selectPartner") == "Billy_"){setglobalvar("selectPartner", "Kyo_");}else
        if(getglobalvar("selectPartner") == "Kyo_"){setglobalvar("selectPartner", "Maxima_");}else
        if(getglobalvar("selectPartner") == "Maxima_"){setglobalvar("selectPartner", "Billy_");}
    }
    if(playerName == "Kyo"){
        if(getglobalvar("selectPartner") == "Billy_"){setglobalvar("selectPartner", "Terry_");}else
        if(getglobalvar("selectPartner") == "Terry_"){setglobalvar("selectPartner", "Maxima_");}else
        if(getglobalvar("selectPartner") == "Maxima_"){setglobalvar("selectPartner", "Billy_");}
    }
    if(playerName == "Maxima"){
        if(getglobalvar("selectPartner") == "Billy_"){setglobalvar("selectPartner", "Terry_");}else
        if(getglobalvar("selectPartner") == "Terry_"){setglobalvar("selectPartner", "Kyo_");}else
        if(getglobalvar("selectPartner") == "Kyo_"){setglobalvar("selectPartner", "Billy_");}
    }
}

I made this modification with the NPCS I have created, since I still don't have all the heroes finished in NPC version.

C++:
            //IS PARTNER NAME HIGHLIGHTED??
            if(getglobalvar("highlight") == 6){
    void playerName = getplayerproperty(player, "name");

    if(playerName == "TUSK"){
        if(getglobalvar("selectPartner") == "BALROG_"){setglobalvar("selectPartner", "VEGA_");}else
        if(getglobalvar("selectPartner") == "VEGA_"){setglobalvar("selectPartner", "ZANGIEF_");}else
        if(getglobalvar("selectPartner") == "ZANGIEF_"){setglobalvar("selectPartner", "BALROG_");}
    }
    if(playerName == "LIU_KANG"){
        if(getglobalvar("selectPartner") == "TUSK_"){setglobalvar("selectPartner", "BALROG_");}else
        if(getglobalvar("selectPartner") == "BALROG_"){setglobalvar("selectPartner", "VEGA_");}else   
        if(getglobalvar("selectPartner") == "VEGA_"){setglobalvar("selectPartner", "ZANGIEF_");}else
        if(getglobalvar("selectPartner") == "ZANGIEF_"){setglobalvar("selectPartner", "TUSK_");}
    }
    if(playerName == "RAIDEN"){
        if(getglobalvar("selectPartner") == "TUSK_"){setglobalvar("selectPartner", "BALROG_");}else
        if(getglobalvar("selectPartner") == "BALROG_"){setglobalvar("selectPartner", "VEGA_");}else   
        if(getglobalvar("selectPartner") == "VEGA_"){setglobalvar("selectPartner", "ZANGIEF_");}else
        if(getglobalvar("selectPartner") == "ZANGIEF_"){setglobalvar("selectPartner", "TUSK_");}
    }
    if(playerName == "CAROLINA"){
        if(getglobalvar("selectPartner") == "TUSK_"){setglobalvar("selectPartner", "BALROG_");}else
        if(getglobalvar("selectPartner") == "BALROG_"){setglobalvar("selectPartner", "VEGA_");}else   
        if(getglobalvar("selectPartner") == "VEGA_"){setglobalvar("selectPartner", "ZANGIEF_");}else
        if(getglobalvar("selectPartner") == "ZANGIEF_"){setglobalvar("selectPartner", "TUSK_");}
    }
    if(playerName == "KITANA"){
        if(getglobalvar("selectPartner") == "TUSK_"){setglobalvar("selectPartner", "BALROG_");}else
        if(getglobalvar("selectPartner") == "BALROG_"){setglobalvar("selectPartner", "VEGA_");}else   
        if(getglobalvar("selectPartner") == "VEGA_"){setglobalvar("selectPartner", "ZANGIEF_");}else
        if(getglobalvar("selectPartner") == "ZANGIEF_"){setglobalvar("selectPartner", "TUSK_");}
    }
    if(playerName == "MIDAS"){
        if(getglobalvar("selectPartner") == "TUSK_"){setglobalvar("selectPartner", "BALROG_");}else
        if(getglobalvar("selectPartner") == "BALROG_"){setglobalvar("selectPartner", "VEGA_");}else   
        if(getglobalvar("selectPartner") == "VEGA_"){setglobalvar("selectPartner", "ZANGIEF_");}else
        if(getglobalvar("selectPartner") == "ZANGIEF_"){setglobalvar("selectPartner", "TUSK_");}
    }
    if(playerName == "JAGO"){
        if(getglobalvar("selectPartner") == "TUSK_"){setglobalvar("selectPartner", "BALROG_");}else
        if(getglobalvar("selectPartner") == "BALROG_"){setglobalvar("selectPartner", "VEGA_");}else   
        if(getglobalvar("selectPartner") == "VEGA_"){setglobalvar("selectPartner", "ZANGIEF_");}else
        if(getglobalvar("selectPartner") == "ZANGIEF_"){setglobalvar("selectPartner", "TUSK_");}
    }
    if(playerName == "CHOSEN_ONE" || "BATMAN" || "DREDD" || "FULGORE" || "ORCHID" || "ROBOCOP" || "SCORPION" || "SUB-ZERO"){
        if(getglobalvar("selectPartner") == "TUSK_"){setglobalvar("selectPartner", "BALROG_");}else
        if(getglobalvar("selectPartner") == "BALROG_"){setglobalvar("selectPartner", "VEGA_");}else   
        if(getglobalvar("selectPartner") == "VEGA_"){setglobalvar("selectPartner", "ZANGIEF_");}else
        if(getglobalvar("selectPartner") == "ZANGIEF_"){setglobalvar("selectPartner", "TUSK_");}
}
        }
The problem I'm having is that when I open the menu, I can scroll through the names, but it won't let me choose any, no matter who I'm playing with.
When I press the ATTACK button to choose a partner, nothing happens.

C++:
    if(playerName == "CHOSEN_ONE" || "BATMAN" || "DREDD" || "FULGORE" || "ORCHID" || "ROBOCOP" || "SCORPION" || "SUB-ZERO"){
        if(getglobalvar("selectPartner") == "TUSK_"){setglobalvar("selectPartner", "BALROG_");}else
        if(getglobalvar("selectPartner") == "BALROG_"){setglobalvar("selectPartner", "VEGA_");}else   
        if(getglobalvar("selectPartner") == "VEGA_"){setglobalvar("selectPartner", "ZANGIEF_");}else
        if(getglobalvar("selectPartner") == "ZANGIEF_"){setglobalvar("selectPartner", "TUSK_");}
I'm sure this part is wrong, because if I choose any of these heroes, "TUSK_" doesn't appear as the first partner in the menu, even though it's first.
I tried to open this part, but the same problem persists: I can't choose a partner when I press ATTACK.

I attach my KEYALL.C



About this script:👇
C++:
void main()
{
    void branch = openborvariant("current_branch");
    
    //IF NOT IN THE LEVELS BELOW, LOAD PARTNER NORMALLY
    if(branch != "level1" && branch != "level2" && branch != "level3" && branch != "level4")
    {
        loadPartner();
    }
}

To start, use this script without the modified key to avoid any errors.
I performed the following test:
I started the game with the NPC in the first stage and added a parameter to the script so that it wouldn't appear in the "parking" branch.
But when I finish the "parking" level and start the "basketfield" level, the NPC is not present and when I open the menu to bring the NPC again, when I press the ATTACK button, nothing happens, as happened to me with the other script.
branch test
z 200 272 200 #
file data/levels/testB.txt

branch parking
z 220 270 220 #1-1-1
file data/levels/story/easy/parking.txt

branch basketfield
z 175 270 175 #1-2
file data/levels/story/easy/basketfield.txt


And finally, I wanted to share a question that came to me when I checked all the files involved in the NPC partner system.
I noticed that in the UPDATED.C file there's a section where the name of the first partner appears.
I don't know if this is something that could be causing the problem, but I thought it was important to share it.

I tried changing the name, putting "TUSK_ " or "BALROG_", but the bug persists..

C++:
void loadAll()
{//Load all necessary variables

    //SCRIPT USED TO CLEAR ALL VARIABLES AND ASSETS
    if(getglobalvar("clearAll") != NULL()){clearAssets();clearlocalvar();clearglobalvar();}

    //PARTNER MENU FUNCTIONS
    if(getglobalvar("activeText") == NULL()){
        setglobalvar("highlight", 0);
        setglobalvar("selectPartner", "BALROG_");
        setglobalvar("partnerAlive", 0);
        setglobalvar("partnerMode", "balanced");
        setglobalvar("partnerAggression", "*****");
        setglobalvar("partnerGetFood", "yes");
        setglobalvar("partnerFollow", "automatic");
        setglobalvar("partnerRespawn", "instantly");
        setglobalvar("partnerLifeBar", "full_hud");
        setglobalvar("activeText", 0);
    }
    
    //LOAD ALL NECESSARY ASSETS (SPRITES, SOUNDS, ETC)
    saveAssets();
}

I hope I've been as clear as possible, my friend. 😅
If you have any questions, don't hesitate to ask.

Thanks my friend! 😉
 

Attachments

Well @Kratus , I finally implemented the 2 updates without getting errors in the log and performed several tests with the 2 scripts.

I will detail the results. 😅

About this script: 👇
C++:
//IS PARTNER NAME HIGHLIGHTED??
if(getglobalvar("highlight") == 6){
    void playerName = getplayerproperty(player, "name");

    if(playerName == "Billy"){
        if(getglobalvar("selectPartner") == "Terry_"){setglobalvar("selectPartner", "Kyo_");}else
        if(getglobalvar("selectPartner") == "Kyo_"){setglobalvar("selectPartner", "Maxima_");}else
        if(getglobalvar("selectPartner") == "Maxima_"){setglobalvar("selectPartner", "Terry_");}
    }
    if(playerName == "Terry"){
        if(getglobalvar("selectPartner") == "Billy_"){setglobalvar("selectPartner", "Kyo_");}else
        if(getglobalvar("selectPartner") == "Kyo_"){setglobalvar("selectPartner", "Maxima_");}else
        if(getglobalvar("selectPartner") == "Maxima_"){setglobalvar("selectPartner", "Billy_");}
    }
    if(playerName == "Kyo"){
        if(getglobalvar("selectPartner") == "Billy_"){setglobalvar("selectPartner", "Terry_");}else
        if(getglobalvar("selectPartner") == "Terry_"){setglobalvar("selectPartner", "Maxima_");}else
        if(getglobalvar("selectPartner") == "Maxima_"){setglobalvar("selectPartner", "Billy_");}
    }
    if(playerName == "Maxima"){
        if(getglobalvar("selectPartner") == "Billy_"){setglobalvar("selectPartner", "Terry_");}else
        if(getglobalvar("selectPartner") == "Terry_"){setglobalvar("selectPartner", "Kyo_");}else
        if(getglobalvar("selectPartner") == "Kyo_"){setglobalvar("selectPartner", "Billy_");}
    }
}

I made this modification with the NPCS I have created, since I still don't have all the heroes finished in NPC version.

C++:
            //IS PARTNER NAME HIGHLIGHTED??
            if(getglobalvar("highlight") == 6){
    void playerName = getplayerproperty(player, "name");

    if(playerName == "TUSK"){
        if(getglobalvar("selectPartner") == "BALROG_"){setglobalvar("selectPartner", "VEGA_");}else
        if(getglobalvar("selectPartner") == "VEGA_"){setglobalvar("selectPartner", "ZANGIEF_");}else
        if(getglobalvar("selectPartner") == "ZANGIEF_"){setglobalvar("selectPartner", "BALROG_");}
    }
    if(playerName == "LIU_KANG"){
        if(getglobalvar("selectPartner") == "TUSK_"){setglobalvar("selectPartner", "BALROG_");}else
        if(getglobalvar("selectPartner") == "BALROG_"){setglobalvar("selectPartner", "VEGA_");}else  
        if(getglobalvar("selectPartner") == "VEGA_"){setglobalvar("selectPartner", "ZANGIEF_");}else
        if(getglobalvar("selectPartner") == "ZANGIEF_"){setglobalvar("selectPartner", "TUSK_");}
    }
    if(playerName == "RAIDEN"){
        if(getglobalvar("selectPartner") == "TUSK_"){setglobalvar("selectPartner", "BALROG_");}else
        if(getglobalvar("selectPartner") == "BALROG_"){setglobalvar("selectPartner", "VEGA_");}else  
        if(getglobalvar("selectPartner") == "VEGA_"){setglobalvar("selectPartner", "ZANGIEF_");}else
        if(getglobalvar("selectPartner") == "ZANGIEF_"){setglobalvar("selectPartner", "TUSK_");}
    }
    if(playerName == "CAROLINA"){
        if(getglobalvar("selectPartner") == "TUSK_"){setglobalvar("selectPartner", "BALROG_");}else
        if(getglobalvar("selectPartner") == "BALROG_"){setglobalvar("selectPartner", "VEGA_");}else  
        if(getglobalvar("selectPartner") == "VEGA_"){setglobalvar("selectPartner", "ZANGIEF_");}else
        if(getglobalvar("selectPartner") == "ZANGIEF_"){setglobalvar("selectPartner", "TUSK_");}
    }
    if(playerName == "KITANA"){
        if(getglobalvar("selectPartner") == "TUSK_"){setglobalvar("selectPartner", "BALROG_");}else
        if(getglobalvar("selectPartner") == "BALROG_"){setglobalvar("selectPartner", "VEGA_");}else  
        if(getglobalvar("selectPartner") == "VEGA_"){setglobalvar("selectPartner", "ZANGIEF_");}else
        if(getglobalvar("selectPartner") == "ZANGIEF_"){setglobalvar("selectPartner", "TUSK_");}
    }
    if(playerName == "MIDAS"){
        if(getglobalvar("selectPartner") == "TUSK_"){setglobalvar("selectPartner", "BALROG_");}else
        if(getglobalvar("selectPartner") == "BALROG_"){setglobalvar("selectPartner", "VEGA_");}else  
        if(getglobalvar("selectPartner") == "VEGA_"){setglobalvar("selectPartner", "ZANGIEF_");}else
        if(getglobalvar("selectPartner") == "ZANGIEF_"){setglobalvar("selectPartner", "TUSK_");}
    }
    if(playerName == "JAGO"){
        if(getglobalvar("selectPartner") == "TUSK_"){setglobalvar("selectPartner", "BALROG_");}else
        if(getglobalvar("selectPartner") == "BALROG_"){setglobalvar("selectPartner", "VEGA_");}else  
        if(getglobalvar("selectPartner") == "VEGA_"){setglobalvar("selectPartner", "ZANGIEF_");}else
        if(getglobalvar("selectPartner") == "ZANGIEF_"){setglobalvar("selectPartner", "TUSK_");}
    }
    if(playerName == "CHOSEN_ONE" || "BATMAN" || "DREDD" || "FULGORE" || "ORCHID" || "ROBOCOP" || "SCORPION" || "SUB-ZERO"){
        if(getglobalvar("selectPartner") == "TUSK_"){setglobalvar("selectPartner", "BALROG_");}else
        if(getglobalvar("selectPartner") == "BALROG_"){setglobalvar("selectPartner", "VEGA_");}else  
        if(getglobalvar("selectPartner") == "VEGA_"){setglobalvar("selectPartner", "ZANGIEF_");}else
        if(getglobalvar("selectPartner") == "ZANGIEF_"){setglobalvar("selectPartner", "TUSK_");}
}
        }
The problem I'm having is that when I open the menu, I can scroll through the names, but it won't let me choose any, no matter who I'm playing with.
When I press the ATTACK button to choose a partner, nothing happens.

C++:
    if(playerName == "CHOSEN_ONE" || "BATMAN" || "DREDD" || "FULGORE" || "ORCHID" || "ROBOCOP" || "SCORPION" || "SUB-ZERO"){
        if(getglobalvar("selectPartner") == "TUSK_"){setglobalvar("selectPartner", "BALROG_");}else
        if(getglobalvar("selectPartner") == "BALROG_"){setglobalvar("selectPartner", "VEGA_");}else  
        if(getglobalvar("selectPartner") == "VEGA_"){setglobalvar("selectPartner", "ZANGIEF_");}else
        if(getglobalvar("selectPartner") == "ZANGIEF_"){setglobalvar("selectPartner", "TUSK_");}
I'm sure this part is wrong, because if I choose any of these heroes, "TUSK_" doesn't appear as the first partner in the menu, even though it's first.
I tried to open this part, but the same problem persists: I can't choose a partner when I press ATTACK.

I attach my KEYALL.C



About this script:👇
C++:
void main()
{
    void branch = openborvariant("current_branch");
   
    //IF NOT IN THE LEVELS BELOW, LOAD PARTNER NORMALLY
    if(branch != "level1" && branch != "level2" && branch != "level3" && branch != "level4")
    {
        loadPartner();
    }
}

To start, use this script without the modified key to avoid any errors.
I performed the following test:
I started the game with the NPC in the first stage and added a parameter to the script so that it wouldn't appear in the "parking" branch.
But when I finish the "parking" level and start the "basketfield" level, the NPC is not present and when I open the menu to bring the NPC again, when I press the ATTACK button, nothing happens, as happened to me with the other script.



And finally, I wanted to share a question that came to me when I checked all the files involved in the NPC partner system.
I noticed that in the UPDATED.C file there's a section where the name of the first partner appears.
I don't know if this is something that could be causing the problem, but I thought it was important to share it.

I tried changing the name, putting "TUSK_ " or "BALROG_", but the bug persists..

C++:
void loadAll()
{//Load all necessary variables

    //SCRIPT USED TO CLEAR ALL VARIABLES AND ASSETS
    if(getglobalvar("clearAll") != NULL()){clearAssets();clearlocalvar();clearglobalvar();}

    //PARTNER MENU FUNCTIONS
    if(getglobalvar("activeText") == NULL()){
        setglobalvar("highlight", 0);
        setglobalvar("selectPartner", "BALROG_");
        setglobalvar("partnerAlive", 0);
        setglobalvar("partnerMode", "balanced");
        setglobalvar("partnerAggression", "*****");
        setglobalvar("partnerGetFood", "yes");
        setglobalvar("partnerFollow", "automatic");
        setglobalvar("partnerRespawn", "instantly");
        setglobalvar("partnerLifeBar", "full_hud");
        setglobalvar("activeText", 0);
    }
   
    //LOAD ALL NECESSARY ASSETS (SPRITES, SOUNDS, ETC)
    saveAssets();
}

I hope I've been as clear as possible, my friend. 😅
If you have any questions, don't hesitate to ask.

Thanks my friend! 😉
@dantedevil Buddy, please when posting a question, try to focus in one problem at a time, if it's possible. Posting multiple questions mainly with big codes at once will make the post a bit confuse to understand.
In case you have more than one question and they are very connected, try to visually separate them by items, like question 1). 2). 3). etc.

if(playerName == "CHOSEN_ONE" || "BATMAN" || "DREDD" || "FULGORE" || "ORCHID" || "ROBOCOP" || "SCORPION" || "SUB-ZERO"){
The first problem I see is in this line, the correct way is the one below:

if(playerName == "CHOSEN_ONE" || playerName == "BATMAN" || playerName == "DREDD" || playerName == "FULGORE" || playerName == "ORCHID" || playerName == "ROBOCOP" || playerName == "SCORPION" || playerName == "SUB-ZERO"){

About the other questions I didn't understand if they are the same or separate problems. First, try the solution I posted above and see if it solves one of the problems. Then we can proceed to the others.
But my main recommendation is, during the implementation of the partner menu in your game, if anything goes wrong I suggest back some steps, check the logic in the template I made and then only after getting the flow, try to implement in your game again.
 
Upps, sorry my friend, I will take this into account and try to be as brief and clear as possible.

But my main recommendation is, during the implementation of the partner menu in your game, if anything goes wrong I suggest back some steps, check the logic in the template I made and then only after getting the flow, try to implement in your game again.
To perform this major update, I start everything from the beginning, step by step.
Now just made the fix you mentioned, and the main problem persists.
There are two errors, and I'll explain them separately:

1) Before performing the big update in keyall.c, I decided to start the update to skip some levels by adding an condition before loading the cpu partner in the level.c file.
I started the game and call one NPC partner in the first stage and added a parameter to the script so the partner it wouldn't appear in the next level ("parking" branch).
But then when I finish the "parking" level and go to the next level (level without branch condition) , the NPC is not present and when I open the menu to bring the NPC again, when I press the ATTACK button, nothing happens.

2) After performing the big update in keyall.c, the same bug as the end of point 1 occurs when I open the menu, I can scroll through the names, but it won't let me choose any, no matter who I'm playing with.
When I press the ATTACK button to choose a partner, nothing happens.


After having performed the entire process from the beginning several times, I can't find the problem, but it's definitely in keyall.c, because when updating this file, the bug from point 2 was generated.
Although in point 1, the same bug occurs later when skipping next levels by adding a condition in level.c, but at this point the error occurs without having performed the update of keyall.c.

I attach all my files.

I hope I have been clearer in my explanation, my friend, and I hope you understand me.
Thanks!
 

Attachments

Upps, sorry my friend, I will take this into account and try to be as brief and clear as possible.


To perform this major update, I start everything from the beginning, step by step.
Now just made the fix you mentioned, and the main problem persists.
There are two errors, and I'll explain them separately:

1) Before performing the big update in keyall.c, I decided to start the update to skip some levels by adding an condition before loading the cpu partner in the level.c file.
I started the game and call one NPC partner in the first stage and added a parameter to the script so the partner it wouldn't appear in the next level ("parking" branch).
But then when I finish the "parking" level and go to the next level (level without branch condition) , the NPC is not present and when I open the menu to bring the NPC again, when I press the ATTACK button, nothing happens.

2) After performing the big update in keyall.c, the same bug as the end of point 1 occurs when I open the menu, I can scroll through the names, but it won't let me choose any, no matter who I'm playing with.
When I press the ATTACK button to choose a partner, nothing happens.


After having performed the entire process from the beginning several times, I can't find the problem, but it's definitely in keyall.c, because when updating this file, the bug from point 2 was generated.
Although in point 1, the same bug occurs later when skipping next levels by adding a condition in level.c, but at this point the error occurs without having performed the update of keyall.c.

I attach all my files.

I hope I have been clearer in my explanation, my friend, and I hope you understand me.
Thanks!
Sorry friend, I don't have a deep knowledge about your game to fix the issues for you. I suggest to rollback everything and restart with simple tasks, like adding 1 cpu partner, spawning him in the game, making every desired event to work as planned, then add more partners, more events, etc.

If simple tasks do not work as intended, do not proceed to advanced tasks. You need to get how the main logic works, otherwise as your game becomes bigger, more problems you may have.

But then when I finish the "parking" level and go to the next level (level without branch condition) , the NPC is not present and when I open the menu to bring the NPC again, when I press the ATTACK button, nothing happens.
I have some questions here:

1). Did you name all levels with branch names in the levels.txt file?

2). Did you check every required step in the //SPAWN CPU PARTNER IN-GAME part? Is the partnerIndex variable empty?
1745391254762.png

3). Did you check the level.c requirements (partnerAlive/partnerrespawn)?
1745391476382.png

2) After performing the big update in keyall.c, the same bug as the end of point 1 occurs when I open the menu, I can scroll through the names, but it won't let me choose any, no matter who I'm playing with.
When I press the ATTACK button to choose a partner, nothing happens.
If the required steps in the previous question are not met, the cpu partner will not spawn.
To check all the variables, I suggest to use drawstring in the updated.c.
Example:
Code:
drawstring(100, 100, 0, getglobalvar("partnerAlive")); //WRITE THE VARIABLE VALUE ON THE SCREEN
 
Ok my friend, I have many questions about this, so I'm going to answer them one by one.

1). Did you name all levels with branch names in the levels.txt file?
Yes. (y)

2). Did you check every required step in the //SPAWN CPU PARTNER IN-GAME part? Is the partnerIndex variable empty?
I didn't make any changes to that part of the script, if I had to, I wouldn't know where to start. :(
From the information I had up to this point, I had no idea I had to change that.

3). Did you check the level.c requirements (partnerAlive/partnerrespawn)?
As in the previous point, I didn't make any changes to that part of the script, if I had to, I wouldn't know where to start. 😞


If the required steps in the previous question are not met, the cpu partner will not spawn.
To check all the variables, I suggest to use drawstring in the updated.c.
Example:
drawstring(100, 100, 0, getglobalvar("partnerAlive")); //WRITE THE VARIABLE VALUE ON THE SCREEN
And regarding this, it is not clear to me in which part of the updated.c I have to add that check. :unsure:


Sorry friend, I don't have a deep knowledge about your game to fix the issues for you.
And finally, if you think it would be more helpful to have my game so you can fully test it yourself, let me know and I'll provide you with a link right away.

Thank you for all your help, and I'm sorry for any inconvenience. 💪
 
Back
Top Bottom