The TrackMania universal forum ^_^
It is currently 27 Apr 2017 21:35

All times are UTC + 1 hour

Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: [Xaseco 1] onCheckpoint - Order?
PostPosted: 15 Apr 2016 10:49 

Joined: 23 Feb 2015 23:28
Posts: 8
Owned TM-games: TMU
Hi there,

I'm currently working on a plugin where I need to know who has passed a checkpoint first in rounds mode. I thought I could just rely on the order of the 'onCheckpoint' events that I receive. So the first time executing the registered method will contain the informations about the player who crossed the cp first. But I had the feeling that this does not seem to be true so I logged the events in rounds mode and indeed it has revealed sth differently:

[cpId, login, time on cp in thousandths of a second]

[04/15,00:31:27] 0 stampertjeiscool 3950
[04/15,00:31:27] 0 vale07 3960
[04/15,00:31:27] 0 imjustgonnarace__p 3960
[04/15,00:31:27] 0 crookza 4000
[04/15,00:31:27] 0 cool_thing 3960

[04/15,00:32:50] 0 imjustgonnarace__p 3960
[04/15,00:32:50] 0 vale07 3960
[04/15,00:32:50] 0 crookza 3980
[04/15,00:32:51] 0 cool_thing 3950
[04/15,00:32:51] 0 stampertjeiscool 4030

This order kinda seems random. I hoped that there is a way to get the events in a chronological order (based on the actual cp time). Any way to enforce this?

As a workaround I first thought I could store the informations from the events and do some time-based sorting on it manually. But how do I then know when I finally received the event of the fastest time? You could argue you can just wait until all have passed the cp, but what if one guy will cross the cp 3 seconds after all others? That wouldn't be a very responsive solution anymore. One idea that popped into my mind was to introduce some time interval when the first event was fired and after that interval I just output the fastest time that I received until then. But this seems to be more of a hack than anything else since I do not know the correct interval to set, either and I have no idea yet how to actually implement such a custom interval with a coupled custom event fired :D
Do you have any ideas or encountered already a similar problem in the past?

Thanks for your help :)

Best regards,

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour

Who is online

Users browsing this forum: No registered users and 4 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group