lap counter
I'm in the middle of making a simple lap-based racing game but something I think I managed to do once in LBP doesn't work the same here. Basically I want a set of checkpoints around my racing level, so that the cars have to pass through all the checkpoints in order to trigger a successful lap count. I've tried all sorts of things to do this, and haven't come up with anything. I guess the closest I can think of would be to do something with enabling / disabling trigger zones via some sort of elaborate counter system (ie you have to get all four counters before all the trigger zones come back on) but try as I might I can't seem to come up with something that stops the players just reversing back over checkpoints to notch up laps.
Any help?
-
I would use separate tags set to be triggered by each of the separate zones. Each tag is wired into a counter, and each [counter full] is wired into an AND gate that sets off the lap completion, and resets the counters.
By using separate tags, you ensure they can't just reverse and back up in the same check point repeatedly. You'll have to tweak the zones to only set off the one specific tag.
I would also include nodes between tags 2-4 and their counters. Wire the previous counter into the next node so that tag 2 can only fill it's counter after tag 1 has been activated. This way they can't run the course in reverse. -
Hmmm sounds plausible...! Four separate tags (because there are four checkpoints) on the vehicles, deactivate / activate each in turn (so once you've passed the first checkpoint, a selector activates the second tag, and so on and so on until you've completed a lap). Cheers, that sounds like a good direction to pursue, will give it a try and report back!
-
Cool! You put me on the right track (pun intended). So I built 5 tags into each car (the first one is only used once, on the first lap to get the race under way. These were wired into a selector that cycled through each tag in turn activating it (thus preventing the player from just reversing over the line to trigger a checkpoint, and ensuring that all checkpoints are visited in turn). The selector was also wired into a counter so that each time the selector moved on to the next output, it also counted up until four checkpoints had been counted in, equalling a lap.
Had to do this for all the vehicles but it was simple enough to set up 3 lapcounters (one for each car) and then have the game won by whichever car hit 4 laps first.
The game is called "Re-Volted" (as the old Dreamcast game Re-Volt was the inspiration). At least the lapcounter works, need to tweak my car driving mechanics a bit though but it's good fun for up to 3 players at least. -
Nice job! Glad to hear you got it working! :)
Please sign in to leave a comment.