Race System

I want to make the system below but I don't understand how to check the final classification.

To define the end of a race in RPG Maker and rank competitors by their positions at the finish line, you can follow these basic steps:

Race Events: Use common events to create the race. Each competitor can be represented by an event that moves along a predetermined course.

Position Variables: Assign a variable to each competitor that will be used to record their position throughout the race. For example, use Variable[1] for Competitor 1, Variable[2] for Competitor 2, and so on.

Movement Controls: Set up movement events for each competitor. You can use move event commands to make competitors move along the course.

Finish Line: Create a contact event at the finish line. When a competitor touches this event, record that competitor's final position by incrementing a counter.

Ranking Script: Use an event condition to check when all competitors have crossed the finish line. Then, use a script or common event to sort and display the competitors by their final positions.

Displaying the Final Ranking: Create an event page or use the game interface to display the final ranking based on the competitors' position variables.

These steps provide a basic outline of how you can set up the race and rank the competitors in RPG Maker.

Spoiler: For one use
Where did you get this? Did ChatGPT give you these instructions?
Where did you get this? Did ChatGPT give you these instructions?
Yes, I asked about it there, but the copilot gave me a code, I think it was in Python.
Is the logic wrong?
I want to know specifically how to add members to the group in order of arrival, so I can solve the bug, in the store and in the save, with different characters.
Well, the instructions are ... vague, to put it politely.

If your only problem is to find out in which order they crossed the finish line, here's what I would do.

Set up a Parallel Event on your Map where the racing track is.
In there you get all the location info of your runners and save their X and Y coordinates into variables (each runner needs their own pair to store these variables).
If your track is just one direction, (like from left to right), it's enough to take the X coordinate for example. But if you go in a circle, you need both.
Now you have a set of variables, that hold the positions of all your runners.
Check for everyone, if their coordinates match the coordinates of the finish line.
If yes, you track their result (see below).
After that, put a wait of 15 or 30 frames or something, so it won't to the check every frame.

To track their results, you would do something like that:
If a runner reaches the correct X and Y coordinates, you check:
If variable "place1" = 0
set variable "place1" = EventID
ELSE
If variable "place2" = 0
set variable "place2" = EventID
ELSE
etc.

So you put their "identity" into the first variable that isn't occupied yet.
Also, make sure they won't trigger this event twice, so as soon as they got a place assigned, they can't get another one.
My X coordinate = game actors
My Y variable = finish line position

Place1 = character X + quantity of variable Y

Variable Y is the total sum of the 14 characters, so Y will be a number from 1 to 14.

So place 1 will give me the value if actor X is in Y?

I need the placement by finish to determine a control over the position, when removing a character from the group it will automatically be replaced by the next one, but it is not yet linked to my event in which I choose this position in the group.

This will give me a control like the formation of the standard menu.
Each character has an X and Y coordinate. That's the tile they are standing on right now.
You update these coordinates every 15-30 frames and check, if they match the X and Y coordinates of your finish line.


In the store, the characters are shown, this part that I want to control, matching the order in which the character enters the group to the position created within the menu.

With two variables can I make a branch? Because exact coordinates cannot be matched to the actor ID variable.

Captura de tela 2024-12-29 143325.png

During the game, every time I find a character it gives me this data, but it does not define the order of arrival, that is, the order in which they were found by the player. In the video there is an example with 4 characters, things get stranger when there are more than 4 characters.
Wait what?

Your request said, you are doing a race and you need to check the order of the runners to cross the finish line.

But you actually just want to sort your party in a menu?
I think that's the concept, right?
I don't want to complicate things, I believe it's the same as a race, however I'm not able to give this classification, which seems very simple.

I think that with two variables it would be possible to do it, a number for the actor and a number for the classification, however.

When the actor is 1, the class can be 1.

When the actor is 5, the class can be 2.

This numbering of actors is what's messing me up.
I don't know what to say. You wasted a lot of my time.

Maybe someone else is willing to help.
I don't know what to say. You wasted a lot of my time.

Maybe someone else is willing to help.
No, you seem to be a very intelligent person. I am not able to identify the X and Y coordinates for an event, which technically would be a type of collision with the arrival event.

As a solution to determine the order of a variable. Of course I can use the system for a real racing system, I have already tried it for mv, but now I am messing with the 2k3 event menu, so I would like to get another method or one that I can understand.
I did the same system for events just randomizing the speed of each runner, the finishing position is also done by contact with the Y position since in my case the race is vertical, I tested it on all engines and it worked perfectly:


A method that can solve recording a variable for each arrival position, if we have 3 runners then 3 Conditional Branch will be necessary, in the example below I recorded the ID of the event itself that calls the Common Event, you can record the information you prefer:
Code:
@> Conditional Branch: Variable [0021:POS-First] < 1
  @> Control Variables: [0021:POS-First] = This Event's Map ID
  @>
 : Else
  @> Conditional Branch: Variable [0022:POS-Second] < 1
    @> Control Variables: [0021:POS-First] = This Event's Map ID
    @>
   : Else
    @> Conditional Branch: Variable [0023:POS-Third] < 1
      @> Control Variables: [0021:POS-First] = This Event's Map ID
      @> Text: First: \v[21]
       :         : Second: \v[22]
       :         : Third: \v[23]
      @>
     : Branch End
    @>
   : Branch End
  @>
 : Branch End

Original thread: https://forums.rpgmakerweb.com/threads/race-system.174271/