[Fixed]ManiaScript Players.cp not emptied onPlayerStart

Moderator: NADEO

Locked
oliverde8
Posts: 1286
Joined: 16 Jun 2010, 07:33
Location: in a Blue Box

[Fixed]ManiaScript Players.cp not emptied onPlayerStart

Post 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
Image
Developper for The next generation, Clean and Powerfull controller eXpansion for your SM & TM server . Working on eXpansion² with full MP4 support and many other awesome features...
User avatar
Eole
Nadeo
Nadeo
Posts: 1265
Joined: 26 Apr 2011, 21:08

Re: ManiaScript, Players.checkpoints not emptied onPlayerSta

Post 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?
Contribute to the ManiaPlanet documentation on GitHub
A question about ManiaScript? Ask it here!
User avatar
undef.de
Posts: 2095
Joined: 06 Apr 2011, 21:57
Location: Germany, North Sea Coast
Contact:

Re: ManiaScript, Players.checkpoints not emptied onPlayerSta

Post 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.
Developer of UASECO, a controller with support of the Modescript Gamemodes for TM².
Visit the official website for more: UASECO.org


Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name

You like what I do? Then award a ManiaStar.
oliverde8
Posts: 1286
Joined: 16 Jun 2010, 07:33
Location: in a Blue Box

Re: ManiaScript, Players.checkpoints not emptied onPlayerSta

Post by oliverde8 »

We didn't we will try to do that tomorrow, multilap track with no CP and see what happens.
Image
Developper for The next generation, Clean and Powerfull controller eXpansion for your SM & TM server . Working on eXpansion² with full MP4 support and many other awesome features...
oliverde8
Posts: 1286
Joined: 16 Jun 2010, 07:33
Location: in a Blue Box

Re: ManiaScript, Players.checkpoints not emptied onPlayerSta

Post 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
Image
Developper for The next generation, Clean and Powerfull controller eXpansion for your SM & TM server . Working on eXpansion² with full MP4 support and many other awesome features...
Locked

Return to “Maniaplanet Reports”

Who is online

Users browsing this forum: No registered users and 1 guest