• All, Gmail is currently rejecting messages from my host. I have a ticket in process, but it may take some time to resolve. Until further notice, do NOT use Gmail for your accounts. You will be unable to receive confirmations and two factor messages to login.

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

Hi @Kratus, I'd like to know if there will a new portable version of the partner menu.
Hi @Steven1985, yes I'm planning to make a revision of all the tools I shared in the last few years and put it in the resources sections, but only after the SORX launch.

in every food .txt file in my game anyway with get food active the allies go and get it
Tested in my template and it works correctly. It seems that something is missing in your allies, I suggest to follow the same way I coded in the BOR example I shared.
 
THis system is very interesting!
This is one of the most innovatige and "game changer" mechanic to be added in Openbor.
With all of @msmalik681 great experiments as well getting accessible to the community.

@Kratus I have a question (I just want to be sure)
This feature require to have "npc" type versions of characters to be used as partners, right?
You cannot just use exemple : Axel's player txt and load it as a partner.
(I think the question is dumb, but I'm still asking)
 
You cannot just use exemple : Axel's player txt and load it as a partner
@NED I even tried it but it didn't work because the "player" type has different structure and behaviours from "npc/enemy".
So, for an A.I. controlled character you must spawn as npc/enemy, even if after that you change their types using the Bloodbane's faction method.
 
  • Like
Reactions: NED
@NED I even tried it but it didn't work because the "player" type has different structure and behaviours from "npc/enemy".
So, for an A.I. controlled character you must spawn as npc/enemy, even if after that you change their types using the Bloodbane's faction method.
Thank. I still asked this question just in case.
in the days I had more free time to sacrify in trying "coding experiment" (usually spoiled full days for nothing), I tried to add such helper system in World heroes supreme justice, just for fun.
I started with an existing playable character, and tweaked many stuff to match the coding of an enemy(/npc)
But the behaviour was still strange. and I had to remove many elements not needed in a NPC.

The fact you have now this standalone code is a great thing to update many interesting game with such system.

Even if for me the real dead is still SORX ;)
 
Probably the most primordial part that the ally needs, it’s the ‘range’ command for attacks, as it’s not human controlled. That makes it easier to convert enemies into allies rather than players into allies, as enemies already have those, plus ‘attack 1’ and such works the same for allies and enemies, while it works different for players.
 
Probably the most primordial part that the ally needs, it’s the ‘range’ command for attacks, as it’s not human controlled. That makes it easier to convert enemies into allies rather than players into allies, as enemies already have those, plus ‘attack 1’ and such works the same for allies and enemies, while it works different for players.
Yes, certainly one of the most important adjustments for npc/enemies is the "range".
In addition, there's some functions I suggest to use and that can help on the A.I. customization too, like these:

attackthrottle/attackthrottletime
blockodds
aggression
stealth/detect
hostile/candamage
aimove(avoid/chase/normal/wander)

You can find detailed explanation about all these functions in the manual.
 
  • Like
Reactions: NED
Hi @Kratus , I'd like to have also the bar mp exactly below that one of health for npcs to this script. Could you edit it?
C:
void main()
{//Draw life bar in the screen, entity binded like RPG games
    void self = getlocalvar("self");
   
    if(openborvariant("in_level")){ //IN ANY LEVEL??
        int maxLife    = getentityproperty(self, "maxhealth");
        int life     = getentityproperty(self, "health");
        int x         = getentityproperty(self, "x");
        int y         = getentityproperty(self, "y");
        int z         = getentityproperty(self, "z");
        float xPos     = openborvariant("xpos");
        float yPos     = openborvariant("ypos");
        float xSize    = 20; //BAR WIDTH INCREASE FACTOR, MORE VALUE IS MORE SIZE
        float ySize    = 2; //BAR HEIGHT INCREASE FACTOR, MORE VALUE IS MORE SIZE
        float xDif    = 0; //BAR POSITION IN X AXIS, USE THIS TO MOVE ALL BARS TOGETHER
        float yDif    = 0; //BAR POSITION IN Y AXIS, USE THIS TO MOVE ALL BARS TOGETHER
       
        if(life > 0){ //ENTITY IS ALIVE??
            life         = (life*xSize)/(maxLife); //CALCULATE REMAINING LIFE BAR SIZE
            maxLife        = (maxLife*xSize)/(maxLife); //CALCULATE MAX LIFE BAR SIZE
            x             = x-xPos-(maxLife/2)+xDif; //CALCULATE X POSITION TO BIND BAR IN THE ENTITY, OFFSET IS ALWAYS THE CENTER
            y             = z-yPos-y+yDif; //CALCULATE Y POSITION TO BIND BAR IN THE ENTITY
            drawbox(x, y, life, ySize, z+3, rgbcolor(0xFF,0xFF,0x00), 0); //YELLOW BAR, LIFE REMAINING
            drawbox(x, y, maxLife, ySize, z+1, rgbcolor(0xFF,0x00,0x00), 0); //RED BAR, LIFE LOST
            drawbox(x, y-1, maxLife, ySize*2, z, rgbcolor(0xFF,0xFF,0xFF), 0); //WHITE BORDER (UP/DOWN)
            drawbox(x-1, y, maxLife+2, ySize, z, rgbcolor(0xFF,0xFF,0xFF), 0); //WHITE BORDER (LEFT/RIGHT)
        }
    }
}
Another thing: playing to games with multiple npcs, not only one, with full hud (lifeposition, iconposition, nameposition, lifebarstatus) is possible also for them to have mp bar like that one player? I think it takes script.
Li chiamavano Bulldozer 2.0 - 0003.png
 
Last edited by a moderator:
@Steven1985

Sorry man, your request requires big changes in the script once my original code does not support multiple npcs and I will need to deeply go back in the cpu partner's code to plan how to do it, but I need to finish some things in the SORX first. However, you can post suggestions for the next cpu partner script version and I promise that I will analyze one by one (I can't promise that everyone will be added).

Please, confirm if I'm not wrong. Do you need life bars exactly as the image you posted and for 4 cpu partners +1 player?
 
@Steven1985

Sorry man, your request requires big changes in the script once my original code does not support multiple npcs and I will need to deeply go back in the cpu partner's code to plan how to do it, but I need to finish some things in the SORX first. However, you can post suggestions for the next cpu partner script version and I promise that I will analyze one by one (I can't promise that everyone will be added).

Please, confirm if I'm not wrong. Do you need life bars exactly as the image you posted and for 4 cpu partners +1 player?
Yes, I would like to have mp bar displayed also for npcs, both simple (like RPG games, I put your script above about lifebar) that is displayed exactly below that one of lifebar and full hud also here exactly below the lifebar like you can see to the player at the screenshot. :)
 
@Kratus about the simple bars (health and mp) I resolved. As soon as possible I put the screenshot.

Update: @Kratus I modified the script: I added the mpbar also npcs and of course declaring the script in the header file of every npc (ondrawscript data/scripts/ondraw/lifebar_and_mpbar_for_npc.c.)

C:
void main()
{//Draw life bar in the screen, entity binded like RPG games
    void self = getlocalvar("self");
   
    if(openborvariant("in_level")){ //IN ANY LEVEL??
        int maxLife    = getentityproperty(self, "maxhealth");
        int life     = getentityproperty(self, "health");
        int x         = getentityproperty(self, "x");
        int y         = getentityproperty(self, "y");
        int z         = getentityproperty(self, "z");
        float xPos     = openborvariant("xpos");
        float yPos     = openborvariant("ypos");
        float xSize    = 30; //BAR WIDTH INCREASE FACTOR, MORE VALUE IS MORE SIZE
        float ySize    = 2; //BAR HEIGHT INCREASE FACTOR, MORE VALUE IS MORE SIZE
        float xDif    = 0; //BAR POSITION IN X AXIS, USE THIS TO MOVE ALL BARS TOGETHER
        float yDif    = 0; //BAR POSITION IN Y AXIS, USE THIS TO MOVE ALL BARS TOGETHER
       
        if(life > 0){ //ENTITY IS ALIVE??
            life         = (life*xSize)/(maxLife); //CALCULATE REMAINING LIFE BAR SIZE
            maxLife        = (maxLife*xSize)/(maxLife); //CALCULATE MAX LIFE BAR SIZE
            x             = x-xPos-(maxLife/2)+xDif; //CALCULATE X POSITION TO BIND BAR IN THE ENTITY, OFFSET IS ALWAYS THE CENTER
            y             = z-yPos-y+yDif; //CALCULATE Y POSITION TO BIND BAR IN THE ENTITY
            drawbox(x, y, life, ySize, z+3, rgbcolor(0xFF,0xFF,0x00), 0); //YELLOW BAR, LIFE REMAINING
            drawbox(x, y, maxLife, ySize, z+1, rgbcolor(0xFF,0x00,0x00), 0); //RED BAR, LIFE LOST
            drawbox(x, y-1, maxLife, ySize*2, z, rgbcolor(0xFF,0xFF,0xFF), 0); //WHITE BORDER (UP/DOWN)
            drawbox(x-1, y, maxLife+2, ySize, z, rgbcolor(0xFF,0xFF,0xFF), 0); //WHITE BORDER (LEFT/RIGHT)
        }
    }
   
    if(openborvariant("in_level")){ //IN ANY LEVEL??
        int maxmp    = getentityproperty(self, "maxmp");
        int mp     = getentityproperty(self, "mp");
        int x         = getentityproperty(self, "x");
        int y         = getentityproperty(self, "y");
        int z         = getentityproperty(self, "z");
        float xPos     = openborvariant("xpos");
        float yPos     = openborvariant("ypos");
        float xSize    = 30; //BAR WIDTH INCREASE FACTOR, MORE VALUE IS MORE SIZE
        float ySize    = 2; //BAR HEIGHT INCREASE FACTOR, MORE VALUE IS MORE SIZE
        float xDif    = 0; //BAR POSITION IN X AXIS, USE THIS TO MOVE ALL BARS TOGETHER
        float yDif    = 5; //BAR POSITION IN Y AXIS, USE THIS TO MOVE ALL BARS TOGETHER
       
        if(mp > 0){ //ENTITY IS ALIVE??
            mp         = (mp*xSize)/(maxmp); //CALCULATE REMAINING mp BAR SIZE
            maxmp        = (maxmp*xSize)/(maxmp); //CALCULATE MAX mp BAR SIZE
            x             = x-xPos-(maxmp/2)+xDif; //CALCULATE X POSITION TO BIND BAR IN THE ENTITY, OFFSET IS ALWAYS THE CENTER
            y             = z-yPos-y+yDif; //CALCULATE Y POSITION TO BIND BAR IN THE ENTITY
            drawbox(x, y, mp, ySize, z+3, rgbcolor(0x00,0xFF,0xFF), 0); //CYAN BAR, MP REMAINING
            drawbox(x, y, maxmp, ySize, z+1, rgbcolor(0x00,0x00,0xFF), 0); //BLUE BAR, MP LOST
            drawbox(x, y-1, maxmp, ySize*2, z, rgbcolor(0xFF,0xFF,0xFF), 0); //WHITE BORDER (UP/DOWN)
            drawbox(x-1, y, maxmp+2, ySize, z, rgbcolor(0xFF,0xFF,0xFF), 0); //WHITE BORDER (LEFT/RIGHT)
        }
    }
}

Li chiamavano Bulldozer 2.0 - 0005.png

I tried to have two separate scripts
ondrawscript data/scripts/ondraw/lifebar_for_npc.c
ondrawscript data/scripts/ondraw/mpbar_for_npc.c
but only the health bar came up in the game.
I started studying Javascript and now I understand some of it :)
As mentioned above, I would also like to have the same thing for fullhud: mpbar of the npc equal to that of the player.
 
Last edited:
@Kratus, I did it ! It took quite some time searching through various scripts and trial and error being ignorant on the subject, and it finally worked. Now mpbar of enemies is not visible. :)
C:
...
   
if(openborvariant("in_level")){ //IN ANY LEVEL??
        int maxmp    = getentityproperty(self, "maxmp");
        int mp     = getentityproperty(self, "mp");
        int x         = getentityproperty(self, "x");
        int y         = getentityproperty(self, "y");
        int z         = getentityproperty(self, "z");
        float xPos     = openborvariant("xpos");
        float yPos     = openborvariant("ypos");
        float xSize    = 30; //BAR WIDTH INCREASE FACTOR, MORE VALUE IS MORE SIZE
        float ySize    = 2; //BAR HEIGHT INCREASE FACTOR, MORE VALUE IS MORE SIZE
        float xDif    = 0; //BAR POSITION IN X AXIS, USE THIS TO MOVE ALL BARS TOGETHER
        float yDif    = 5; //BAR POSITION IN Y AXIS, USE THIS TO MOVE ALL BARS TOGETHER
        void type        = getentityproperty(self, "type");
[/SPOILER]
       
       
       
   
       
       
        if(mp > 0){ //ENTITY IS ALIVE??
            if(type == openborconstant("TYPE_PLAYER") || type == openborconstant("TYPE_NPC")){
                mp         = (mp*xSize)/(maxmp); //CALCULATE REMAINING mp BAR SIZE
                maxmp        = (maxmp*xSize)/(maxmp); //CALCULATE MAX mp BAR SIZE
                x             = x-xPos-(maxmp/2)+xDif; //CALCULATE X POSITION TO BIND BAR IN THE ENTITY, OFFSET IS ALWAYS THE CENTER
                y             = z-yPos-y+yDif; //CALCULATE Y POSITION TO BIND BAR IN THE ENTITY
                drawbox(x, y, mp, ySize, z+3, rgbcolor(0x00,0xFF,0xFF), 0); //CYAN BAR, MP REMAINING
                drawbox(x, y, maxmp, ySize, z+1, rgbcolor(0x00,0x00,0xFF), 0); //BLUE BAR, MP LOST
                drawbox(x, y-1, maxmp, ySize*2, z, rgbcolor(0xFF,0xFF,0xFF), 0); //WHITE BORDER (UP/DOWN)
                drawbox(x-1, y, maxmp+2, ySize, z, rgbcolor(0xFF,0xFF,0xFF), 0); //WHITE BORDER (LEFT/RIGHT)
            }
        }
    }  
}
 
@Steven1985

Sorry man, your request requires big changes in the script once my original code does not support multiple npcs and I will need to deeply go back in the cpu partner's code to plan how to do it, but I need to finish some things in the SORX first. However, you can post suggestions for the next cpu partner script version and I promise that I will analyze one by one (I can't promise that everyone will be added).

Please, confirm if I'm not wrong. Do you need life bars exactly as the image you posted and for 4 cpu partners +1 player?
Hi Kratus. I came across your code the other day. Very impressive. I was wondering why the code only allows the selection of only one Npc. Is there an edit that will allow the selection list to expand to than Billy?
 
Hi Kratus. I came across your code the other day. Very impressive. I was wondering why the code only allows the selection of only one Npc. Is there an edit that will allow the selection list to expand to than Billy?
Hi @maxduv , I'm glad you liked it. This script is not a complete solution really, it's just an example to give an idea of how to add this kind of feature in any game, but the modder can use it as a base and make changes, adding or removing anything to fit your own purposes.

I have plans to update this script and you can post suggestions for the next version.
 
Hi @maxduv , I'm glad you liked it. This script is not a complete solution really, it's just an example to give an idea of how to add this kind of feature in any game, but the modder can use it as a base and make changes, adding or removing anything to fit your own purposes.

I have plans to update this script and you can post suggestions for the next version.
Thank you for responding to my message. I was able to apply it to my game. It works perfectly. The only issue I had was not being able to use a credit after my 3 lives were over. I will have to see what is causing the issue. I hope it is something small.
 
Hi @maxduv , I'm glad you liked it. This script is not a complete solution really, it's just an example to give an idea of how to add this kind of feature in any game, but the modder can use it as a base and make changes, adding or removing anything to fit your own purposes.

I have plans to update this script and you can post suggestions for the next version.
Hi Kratus, I have been reviewing the code and was wondering if you could point me to the section that prevent the player from initiating a continue? Once all my lives are up I am not allowed to hit start or enter and utilize my extra credit. Are you able to help me? Thank you,
 
Hi Kratus, I have been reviewing the code and was wondering if you could point me to the section that prevent the player from initiating a continue? Once all my lives are up I am not allowed to hit start or enter and utilize my extra credit. Are you able to help me? Thank you,
If I'm not wrong this problem happens in some games that need to remove the nojoin function.
I already posted some info here.
 
Back
Top Bottom