Keep up with longest streak

Is there a way to keep up with the longest STREAK? (highest number recorded)?

I have a lap running game where the players try to run laps without getting zapped by Sentries.
When they do get zapped, their lap count gets reset to zero. (and they start again)

I have a counter counting their most recent attempt.
I even have a counter counting their total laps.

Next, I would like to have a counter (or some kind of text) showing their LONGEST streak of laps without getting zapped.

So, if they ran 5 laps, then 7, then 2, then 4.
Their scoreboard would look like this:
RECENT: 4 laps
TOTAL: 18 laps
RECORD: 7 laps

The winner of the game is the one with the record streak, so this would have to transfer over to the end of game score.

Any ideas?

1 Like

The sentries should respawn them. Use a lifecycle to broadcast to a counter. That’s the streak.

Make a counter for the record that doesn’t reset when the player is killed. You can use a trigger so that it only updates if RECENT is greater than RECORD.

You could also use properties, but that’s basically what I was going to say.

Is that done with BLOCKS? or some kind of device?

Yes, blocks in a trigger.

tell me more about this.

Use two properties, one tracks the recent laps and one tracks the record laps. They are both number properties. When the record counter see that the property for the recent one is greater than itself, it will update to that property.

Sorry to need so much help here, but I just cannot figure out how to create a property that will show me the RECORD streak. How do I get a property to constantly look at the CURRENT number of laps and only change when its own number is passed.

How do I configure the blocks so that I get the RECORD number?
I just cannot wrap my head around the process of having a trigger or counter or property that will ‘hold’ the RECORD number.
thanks to everyone who has chimed in on this so far.

The counters update the number properties. The counter for the record only updates the record property if the recent property is higher than the record.

I am super sorry I am doing a terrible job of explaining myself.

What exactly do I do to create a property that will show the RECORD?

I have the counter for the current and it resets when my gim is zapped.

But I have NO IDEA how to make a property recognize and hold the HIGHEST number so far.

Maybe I am missing somthing, maybe I am doing a bad job of explaining.

I know WHAT to do. I do not know HOW to do it.

What should the properties settings be? What blocks should I use?

What does it look like? Maybe some screenshots?

Again, you all have been so helpful so far, but this 60 year old teacher needs a bit more help!

thanks

I’ll add images in a moment.

Alright, I have done some work, and this will work.

You will need:
2x Properties
1x Counter
2x Game Overlays
1x Lifecycle
1x Trigger
1x Zone (marks 1 lap)

Step 1: Properties

Here are the settings for the RECORD property:


And here are the settings for the RECENT property:

Step 2: Game Overlays

This is so you can always see your laps and record laps.

For the current laps:

And for record laps:

make sure that the overlays are on different corners of the screen

Step 3: Adding Laps and Reseting Current Laps on Death

To add a lap, wire the Zone to the Counter as such:

Have a Lifecycle listen for the event “Player Knocked Out”
Then, wire the Lifecycle to the Counter as such:

Step 4: Record Laps

This is the hardest part. Firstly, wire the Zone to the Trigger:


Then, these are the blocks for the Trigger:

Basically, if the property RECENT > the property RECORD, RECORD updates to be the same value as RECORD

And thats it.


This is to start the trigger’s loop.

This is to create the property. Make sure that the property type is set to “Number” and transmits on whatever channel the counter uses when updated.

Finally, this is to update the Record property. You’ll need to have another property for your current amount of laps if you haven’t already.

Wow! That was great! Thanks for the time and energy you put into that.

1 Like

Thanks, I had free time. If that solved your problem, then remember to mark a solution!

So, the zone counts the laps and updates the CURRENT property, and the trigger compares and updates the RECORD property.

I have learned something new. I always thought that the counters updated properties. I did not know you could get triggers to update properties.

(If I understand it correctly)

So basically, the trigger watches over RECORD and RECENT, comparing them to each other. When it sees the RECENT is higher than RECORD, it sets RECORD to RECENT’s value. This way, RECORD will never decrease, since it only updates RECORD when RECENT’s value is greater. This is why RECORD doesn’t go back to 0 when RECENT does.

1 Like

This topic was automatically closed 3 hours after the last reply. New replies are no longer allowed.