Race placing via variables?

Status
Not open for further replies.

Burgerland

Veteran
Veteran
Joined
Sep 26, 2015
Messages
331
Reaction score
90
First Language
English
Primarily Uses
N/A
I intend to use variables for keeping track of placing (1st, 2nd, etc.) in a race. When a racer crosses the start/finish line, he will get one point. He needs three points to get a placing. But I'm having trouble with the score system. How do I make it so the racers' scores get checked during the race so that: the racer who finishes all the laps first gets first place, the racer who finishes second gets second place, etc.?

@Burgerland 'Games in Development' is not the place to ask how to do things. Please edit out your two questions and make two new threads in MV Support, one for each question.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
We would need to know how you are controlling the race. What is a 'racer' - an event? How are you moving them? How are you varying their movement?

I suspect you would just need a variable for each racer, to count how many laps they have done, and a variable to count how many racers have finished all the laps. And maybe 3 variables to contain the id of the first, second and third place getters. Whatever your process for monitoring when one finishes a lap, increment the variable for that racer, then if it's equal to the number of laps required, increment the variable that counts how many racers have finished all the laps. Then set one of the 3 variables to the racer's id, based on whether they are first, second or third.

It's probably going to be a bit complicated, so we might have to show you. But we need to know what you've already got set up first, and how it's currently working.
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,842
Reaction score
5,225
First Language
Dutch
Primarily Uses
RMXP
Kes mentions to post this in MV Support, so why did you post it in Plugin Support?

I've moved this thread to MV Support. Please be sure to post your threads in the correct forum next time. Thank you.

 

Burgerland

Veteran
Veteran
Joined
Sep 26, 2015
Messages
331
Reaction score
90
First Language
English
Primarily Uses
N/A
We would need to know how you are controlling the race. What is a 'racer' - an event? How are you moving them? How are you varying their movement?

I suspect you would just need a variable for each racer, to count how many laps they have done, and a variable to count how many racers have finished all the laps. And maybe 3 variables to contain the id of the first, second and third place getters. Whatever your process for monitoring when one finishes a lap, increment the variable for that racer, then if it's equal to the number of laps required, increment the variable that counts how many racers have finished all the laps. Then set one of the 3 variables to the racer's id, based on whether they are first, second or third.

It's probably going to be a bit complicated, so we might have to show you. But we need to know what you've already got set up first, and how it's currently working.
The race is run by an event (autorun) that controls the three racers. A racer is an event. They're moving via another event (parallel process) that ensures they run on the track properly. When they touch a region, they turn in the right direction on the track.

So if I'm understanding you right, the variables would be like this:
- racer 1 laps
- racer 2 laps
- racer 3 laps
- number of racers who finished all laps
- first place
- second place
- third place

Then, when a racer (let's say racer 1) finishes a lap:
- add 1 to "racer 1 laps"
- if "racer 1 laps" = 3 laps, than add 1 to "number of racers who finished all laps"
- racer 1 gets a place

Kes mentions to post this in MV Support, so why did you post it in Plugin Support?
[move]MV Support[/move]
I couldn't find MV Support, I'm sorry. But thank you for your patience.
 
Last edited:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Yes, exactly as you say.
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
15,354
Reaction score
8,533
First Language
English
Primarily Uses
RMMV

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,860
Messages
1,017,040
Members
137,569
Latest member
Shtelsky
Top