Variables and priorities

I can't think straight today.

I have an event, in which 4 variables will be entered.

a = 0
b=0
c=0
d=0

They all start with 0, and then each variable is given a condition.

if a = 0, then a certain choice occurs. This is the ratio of the variables, if it is equal to 0, then it makes choices.

However, in the game it starts reading from the first to the bottom, so it only identifies the variable a.

I want to find a way to place the 4 variables, where there is a certain priority, starting with the variable a = 0.

A little confusing, but it is something like having a variable (a, b, c, d) that shows different results, but the priority value is.

D=4, C=3, B=2 and A=1

This priority would be, if D shows a certain number of options, which are greater than A.

Do you understand me?
Do you understand?
No. Events execute their commands from top to bottom, in the order you've entered them.

So if you're having a problem with the logic within an event, the rules for this forum section give you excellent advice: always provide screenshots of the full event.
I added a photo of the event where I will put the choices, which are made in the common event.

I'm thinking that perhaps there should be a type of variable called priority, to separate or give priorities in fact.
If you want only one of them to play, nest them in the ELSE cases correctly. If set up correctly, there shouldn't be an issue to clearly determine which condition will be active.

But I can't really follow your description of what you want to achieve.
Yeah, it sounds like you're talking about putting things inside those empty Else branches.

Maybe you can give some examples of the variable values and what you want to happen - how it's different depending on what values the variables have.

I just have no idea from your post what you think should happen.

Also, when you edited your post to include the screenshot, you somehow translated it out of English.
Just a wild guess, what I get out of the context of your screenshots.

I think you try to set up your Antidote to ask which hero shall be healed, and you want to show up to 4 names in a choice command. Since your party can have 1 to 4 members, you try to set up a separate cases for 1 hero, 2 heroes, 3 heroes and 4 heroes.

First of all, you want to check the condition of one variable, not 4. This variable will contain a value between 1 to 4 depending your amount of party members.

Then you nest your conditions. This is MZ terminology, but maybe you adapt how it works:

Code:
◆If:variable #100 Heroes in Party = 1
  ◆Text:None, None, Window, Bottom
  :    :Who will be healed?
  ◆Show Choices:Name1, Nobody (Window, Right, #1, #2)
  :When Name1
    ◆
  :When Nobody
    ◆
  :End
  ◆
:Else
  ◆If:variable #100 Heroes in Party = 2
    ◆Text:None, None, Window, Bottom
    :    :Who will be healed?
    ◆Show Choices:Name1, Name2, Nobody (Window, Right, #1, #3)
    :When Name1
      ◆
    :When Name2
      ◆
    :When Nobody
      ◆
    :End
    ◆
  :Else
    ◆If:variable #100 Heroes in Party = 3
      ◆Text:None, None, Window, Bottom
      :    :Who will be healed?
      ◆Show Choices:Name1, Name2, Name3, Nobody (Window, Right, #1, #4)
      :When Name1
        ◆
      :When Name2
        ◆
      :When Name3
        ◆
      :When Nobody
        ◆
      :End
      ◆
    :Else
      ◆If:variable #100 Heroes in Party = 4
        ◆Text:None, None, Window, Bottom
        :    :Who will be healed?
        ◆Show Choices:Name1, Name2, Name3, Name4, Nobody (Window, Right, #1, #5)
        :When Name1
          ◆
        :When Name2
          ◆
        :When Name3
          ◆
        :When Name4
          ◆
        :When Nobody
          ◆
        :End
        ◆
      :End
      ◆
    :End
    ◆
  :End
  ◆
:End
I think you try to set up your Antidote to ask which hero shall be healed, and you want to show up to 4 names in a choice command.
That's...wow. Does 2k3 not have items that can be used on a party member?
That's...wow. Does 2k3 not have items that can be used on a party member?
I saw them working on a custom menu and recreating features like this.
It works! Thanks!
Captura de tela 2024-12-26 204006.png
Recommendation: Use my tool RMEventFactory to work around issues where you cannot specify a hero by variable, instead of having to create tons of branches for each possible hero. With the tool you can auto-create all those conditions at once based on a template.

I need to create tons of specific branches for each hero, just to use "check". What works with the template, then changing the variables will be easier.

For example, when I'm done, I can write a list of variables to which you can assign a number, and the game will behave in a way for that selected number.

I don't want to include additional programs for the "Start Pack", any incompatibility that I can't solve will be a problem.

Bugs like this post are simple to solve, especially if the logic presented is, "How am I going to create the event again with optimization?"

But there are future problems that I won't be able to specify with a simple ctrl C and ctrl V, and I'll have to produce specific branches that escape the general context, like classes where there is a change box for actors and classes, and another thing is skills but that's for the future.
It's not a patch, nothing you need to include, just a tool helping you to put large repetitive events into your clipboard so you can paste them into RM.
A somewhat complex method, but one that greatly reduces the number of conditions, is the use of reference variables or pointers (I don't know the correct term).

For example, instead of creating several conditions, I store the ID of each party member in a separate variable. This must be done right after adding the member to the group, as it is impossible to capture this value directly.

So in this example I created a list with values that refer only to the group members:
1735415291403.png
1735415314446.png



The examples below are of the first 3 standard items in Rm2k3:
Spoiler: Potion example
Code:
@> Comment: // GET HERO'S ID FROM MEMBER 1
@> Control Variables: [0032:MenuPartyAct] = 40
@> Control Variables: [0032:MenuPartyAct] += Variable [0031]
@> Comment: // CHECKS IF THE MEMBER IS ALIVE
@> Control Variables: [0033:HP_TEMP] = Variable [0032]
@> Control Variables: [0033:HP_TEMP] += 4
@> Conditional Branch: Variable [0033:HP_TMP] > 0
  @> Change HP: Variable [0032], + 50
  @> Change Items: [Potion], - 1
  @> Call Event: [SE-Decision]
  @>
 : Else
  @> Call Event: [SE-Buzzer]
  @>
 : Branch End

Spoiler: Hi-Potion example
Code:
@> Comment: // GET HERO'S ID FROM MEMBER 1
@> Control Variables: [0032:MenuPartyAct] = 40
@> Control Variables: [0032:MenuPartyAct] += Variable [0031]
@> Comment: // CHECKS IF THE MEMBER IS ALIVE
@> Control Variables: [0033:HP_TEMP] = Variable [0032]
@> Control Variables: [0033:HP_TEMP] += 4
@> Conditional Branch: Variable [0033:HP_TMP] > 0
  @> Change HP: Variable [0032], + 250
  @> Change Items: [Hi-Potion], - 1
  @> Call Event: [SE-Decision]
  @>
 : Else
  @> Call Event: [SE-Buzzer]
  @>
 : Branch End

Spoiler: Magical Water (Recovery MP)
Code:
@> Comment: // GET HERO'S ID FROM MEMBER 1
@> Control Variables: [0032:MenuPartyAct] = 40
@> Control Variables: [0032:MenuPartyAct] += Variable [0031]
@> Comment: // CHECKS IF THE MEMBER IS ALIVE
@> Control Variables: [0033:HP_TEMP] = Variable [0032]
@> Control Variables: [0033:HP_TEMP] += 4
@> Conditional Branch: Variable [0033:HP_TEMP] > 0
  @> Change MP: Variable [0032], + 1
  @> Change Items: [Magic Water], + 80
  @> Call Event: [SE-Decision]
  @>
 : Else
  @> Call Event: [SE-Buzzer]
  @>
 : Branch End

Note that the action variable itself will do all the reading needed to affect the correct member.

But remember, this is a very crude example of how this works, but if you understand it, this can actually be used to create menus in Rm2k3 dynamically, but only in Rm2k3 because of the function of taking a single image and splitting it, and this function can be used to create a single image with all the items as long as the names are all the same length.

In this case I made a list with 6 columns and each column has 12 items:
1735416273862.png


I would make a tutorial, but I can't claim to have experience with all the parameters used or even combining them with variables, so this is what I can help with so far.
I added the effects this way.

Captura de tela 2024-12-28 202253.png


I can increase or decrease the hp or mp variable related to the hero's id, but not linking the variable to the item, because this is linked to the database id.

Captura de tela 2024-12-28 202827.png


I will post another video of the menu.

Original thread: https://forums.rpgmakerweb.com/threads/variables-and-priorities.174180/