Page 1 of 1

[Fixed]ManiaScript Players.cp not emptied onPlayerStart

Posted: 13 Feb 2014, 22:45
by oliverde8
Hi, we stumbled on another strange thing today when we played on a map with no checkpoints.

When we first start the track the Player.CurRace.Checkpoints table is empty for each player. Once we finish the map the Player.CurRace.Checkpoints of the player which has the manialink is reseted but it isn't reseted for any other players.

SO we are using this technique to catch player checkpoints : http://forum.maniaplanet.com/viewtopic. ... 10#p200391
The code we uses looks like this.

Code: Select all

foreach (Player in Players) {
    declare lastCp for Player = -1;

    if (lastCp  != Player.CurRace.Checkpoints.count) {
         lastCp =  Player.CurRace.Checkpoints.count;

	if (lastCp > 0 && lastCp  % (totalCp) == 0 && totalCp > acceptMinCp) {
		//DO stuff
	}
     }
}
In this situation as the Player.CurRace.Checkpoints isn't reseted the lastCp is always == Player.CurRace.Checkpoints for all the players expect the one who owns the window.

Here is my logs when playing

Code: Select all

LR: oliverde8: Current CP: 1 of 1 on lap 0, CP-Times: [8626] 
LR: undef.de: Current CP: 1 of 1 on lap 0, CP-Times: [9536] 
LR: reaby: Current CP: 1 of 1 on lap 0, CP-Times: [13597] 
LR: oliverde8: Current CP: 0 of 1 on lap 0, CP-Times: [] 
LR: oliverde8: Current CP: 1 of 1 on lap 0, CP-Times: [7439] 
LR: oliverde8: Current CP: 0 of 1 on lap 0, CP-Times: [] 
and the logs of undef

Code: Select all

LR: undef.de: Current CP: 0 of 1 on lap 0, CP-Times: [] 
LR: reaby: Current CP: 0 of 1 on lap 0, CP-Times: [] 
LR: oliverde8: Current CP: 0 of 1 on lap 0, CP-Times: [] 
LR: oliverde8: Current CP: 1 of 1 on lap 0, CP-Times: [8626] 
LR: undef.de: Current CP: 1 of 1 on lap 0, CP-Times: [9536] 
LR: reaby: Current CP: 1 of 1 on lap 0, CP-Times: [13597] 
LR: undef.de: Current CP: 0 of 1 on lap 0, CP-Times: [] 
LR: undef.de: Current CP: 1 of 1 on lap 0, CP-Times: [7930] 
LR: undef.de: Current CP: 0 of 1 on lap 0, CP-Times: [] 
LR: undef.de: Current CP: 1 of 1 on lap 0, CP-Times: [215797] 
LR: undef.de: Current CP: 0 of 1 on lap 0, CP-Times: [] 
LR: undef.de: Current CP: 1 of 1 on lap 0, CP-Times: [8028] 
LR: undef.de: Current CP: 0 of 1 on lap 0, CP-Times: [] 
We were on the same server playing together so we should have had aproximettely the same thing. BUt we can see that I have never the LR: undef.de: Current CP: 0 of 1 and undef never has the LR: oliverde8: Current CP: 0 of 1
So for undef my checkpoints are never reseted
and for me his checkpoints.

So the code just blocks thinking the players doesn't pass through the finish.

Thanks

Re: ManiaScript, Players.checkpoints not emptied onPlayerSta

Posted: 14 Feb 2014, 14:52
by Eole
Hi,

If I remember correctly I had a similar problem at some point while writing a script for TM and we fixed it. When I try to reproduce your bug, the checkpoints of all players are updated in all Manialinks. So it should be fixed on your side when we'll release the next update.

Just a few questions to be sure: Which game mode are you using? Do you encounter the bug only on maps with no checkpoint? Is it a multilaps map? Do you have a link where I could download the map?

Re: ManiaScript, Players.checkpoints not emptied onPlayerSta

Posted: 14 Feb 2014, 19:27
by undef.de
The test where we collect the data for the posting was at Stadium and Gamemode TimeAttack, and it was a map without any Checkpoints and not a Multilap-Map.

I currently doesn't know if Reaby or Oliver test it on a Multilap-Map or other Environments or Gamemodes.

Re: ManiaScript, Players.checkpoints not emptied onPlayerSta

Posted: 14 Feb 2014, 20:42
by oliverde8
We didn't we will try to do that tomorrow, multilap track with no CP and see what happens.

Re: ManiaScript, Players.checkpoints not emptied onPlayerSta

Posted: 16 Feb 2014, 13:57
by oliverde8
Hi,
The problem is on TimeAttack,
It looks like with maps with Cp, the data is deleted only on the first checkpoint.
I can't build a Multilap track with no CP, but the data resets it self fine on when you pass throught the multilap start line.

On Rounds the data is deleted on EndRounds so there is no problem :D