I made a small racing minigame where you go around a track 3 times to achieve victory. I have 2 CPU events that you race against on the track but I don't know how to get the CPU lap counter to increase each time they pass the finish line. I've tried using script calls to get each CPU event's x and y data with no luck. I've also tried using a variable for cpu1 x and cpu1 y also to no luck.
can anyone tell me what I'm doing wrong? and how to make it right.
So are your enemy cars following a fixed route with a move route on repeat? Then I think you can put in the move route that when a lap is finished you increase a variable by 1, script (only needed for one, or the faster enemy car):
$gameVariables.setValue(10, $gameVariables.value(10) + 1);
Then have an autorun map event that ends the race (and also stops the enemy cars if you want) with a variable condition variable 10 >= 3, or something.
I wonder why you wont do each racer variable +1 (if its 3 racers) use
3 variables or 1 variable with an array of 3 digits.
than check eventId and increase the variable once hit over the region.
note sure why you use common events for it though, as loop seem
unnecessary.
I ended up getting the rival racers to increase the variable of laps completed by 1 once a specific
x and y coordination was reached.
edit: for some reason, the laps completed variable goes up by 8 with each lap an npc racer completes instead of 1 but the end result is the same as long as I set the lap counter threshold to be 24 so it still takes 3 laps to win.