Trackmania

pyplanet.apps.core.trackmania.callbacks.finish = <pyplanet.core.events.dispatcher.Signal object>
Signal:

Player finishes a lap or the race.

Code:

trackmania:finish

Description:

Player finishes a lap or the complete race. Custom signal!.

Original Callback:

None

Parameters:
  • player (pyplanet.apps.core.maniaplanet.models.player.Player) – Player instance.

  • race_time (int) – Time in milliseconds of the complete race.

  • lap_time (int) – Time in milliseconds of the current lap.

  • cps – Deprecated!

  • lap_cps (list) – Current lap checkpoint times.

  • race_cps (list) – Complete race checkpoint times.

  • flow (pyplanet.apps.core.maniaplanet.models.player.PlayerFlow) – Flow instance.

  • is_end_race (bool) – Is this the finish and end of race.

  • is_end_lap (bool) – Is this the finish and end of current lap.

  • raw – Prevent to use this!

pyplanet.apps.core.trackmania.callbacks.finish_royal_section = <pyplanet.core.events.dispatcher.Signal object>
Signal:

Player finishes a section of a royal map. (it will also fire waypoint!)

Code:

trackmania:finish_royal_section

Description:

Player finishes a section of a royal map. Custom signal!.

Original Callback:

None

Parameters:
  • player (pyplanet.apps.core.maniaplanet.models.player.Player) – Player instance.

  • section_time (int) – Time in milliseconds of the complete race.

  • section_nr (int) – The section number.

  • block_id (any) – Block ID.

  • flow (pyplanet.apps.core.maniaplanet.models.player.PlayerFlow) – Flow instance.

pyplanet.apps.core.trackmania.callbacks.give_up = <pyplanet.core.events.callback.Callback object>
Signal:

Player gives up.

Code:

trackmania:give_up

Description:

Callback sent when a player gives up his current run/round.

Original Callback:

Script Trackmania.Event.GiveUp

Parameters:
  • time – Server time when callback has been sent.

  • player (pyplanet.apps.core.maniaplanet.models.player.Player) – Player instance

  • flow (pyplanet.apps.core.maniaplanet.models.player.PlayerFlow) – Flow class instance.

pyplanet.apps.core.trackmania.callbacks.request_respawn = <pyplanet.core.events.callback.Callback object>
Signal:

Request respawn by player.

Code:

trackmania:request_respawn

Description:

Callback sent when a player requests a respawns.

Original Callback:

Script Trackmania.Event.OnPlayerRequestRespawn

Parameters:
  • login (str) – Player login

  • player (pyplanet.apps.core.maniaplanet.models.player.Player) – Player instance

  • time (int) – Time of event

pyplanet.apps.core.trackmania.callbacks.respawn = <pyplanet.core.events.callback.Callback object>
Signal:

Player respawn at cp.

Code:

trackmania:respawn

Description:

Callback sent when a player respawns at the last checkpoint/start.

Original Callback:

Script Trackmania.Event.Respawn

Parameters:
  • player (pyplanet.apps.core.maniaplanet.models.player.Player) – Player instance

  • flow (pyplanet.apps.core.maniaplanet.models.player.PlayerFlow) – Flow class instance.

  • race_cp – Checkpoint times in current race.

  • lap_cp – Checkpoint times in current lap.

  • race_time – Total race time in milliseconds.

  • lap_time – Current lap time in milliseconds.

pyplanet.apps.core.trackmania.callbacks.scores = <pyplanet.core.events.callback.Callback object>
Signal:

Score callback, called after the map. (Around the podium time).

Code:

trackmania:scores

Description:

Teams and players scores.

Original Callback:

Script Trackmania.Scores

Parameters:
  • players (list) – Player score payload. Including player instance etc.

  • teams (list) – Team score payload.

  • winner_team – The winning team.

  • use_teams – Use teams.

  • winner_player – The winning player.

  • section – Section, current progress of match. Important to check before you save results!!

pyplanet.apps.core.trackmania.callbacks.start_countdown = <pyplanet.core.events.callback.Callback object>
Signal:

Player starts his round, the countdown starts right now.

Code:

trackmania:start_countdown

Description:

Callback sent when a player see the 3,2,1,Go! countdown.

Original Callback:

Script Trackmania.Event.StartCountdown

Parameters:
  • time – Server time when callback has been sent.

  • player (pyplanet.apps.core.maniaplanet.models.player.Player) – Player instance

  • flow (pyplanet.apps.core.maniaplanet.models.player.PlayerFlow) – Flow class instance.

pyplanet.apps.core.trackmania.callbacks.start_line = <pyplanet.core.events.callback.Callback object>
Signal:

Player drives off from the start line.

Code:

trackmania:start_line

Description:

Callback sent when a player starts to race (at the end of the 3,2,1,GO! sequence).

Original Callback:

Script Trackmania.Event.StartLine

Parameters:
  • time – Server time when callback has been sent.

  • player (pyplanet.apps.core.maniaplanet.models.player.Player) – Player instance

  • flow (pyplanet.apps.core.maniaplanet.models.player.PlayerFlow) – Flow class instance.

pyplanet.apps.core.trackmania.callbacks.stunt = <pyplanet.core.events.callback.Callback object>
Signal:

Player did a stunt.

Code:

trackmania:stunt

Description:

Callback sent when a player did a stunt.

Original Callback:

Script Trackmania.Event.Stunt

Parameters:
  • player (pyplanet.apps.core.maniaplanet.models.player.Player) – Player instance

  • race_time – Total race time in milliseconds.

  • lap_time – Current lap time in milliseconds.

  • stunt_score – Current stunt score.

  • figure – Figure of stunt.

  • angle – Angle of stunt.

  • points – Points got by figure.

  • combo – Combo counter

  • is_straight – Is the jump/stunt straight.

  • is_reverse – Is jump/stunt reversed.

  • is_master_jump – Is master jump.

  • factor – Factor multiplier of points (figure).

pyplanet.apps.core.trackmania.callbacks.tmnext_ko_elimination = <pyplanet.core.events.callback.Callback object>
Signal:

Knockout Elimination Callback.

Code:

trackmania:knockout_Elimination

Description:

Returns a webserviceId on Player Knockout.

Original Callback:

Script Trackmania.Knockout.Elimination

Parameters:
  • responseid – Internally used. Ignore

  • account-id – example: ab6fa572-48d7-4b16-a2d7-5c760a05f97b.

pyplanet.apps.core.trackmania.callbacks.tmnext_properties = <pyplanet.core.events.callback.Callback object>
Signal:

Common.UIModules.Properties for TM2020

Code:

trackmania:common_uimodules_properties

Description:

Returns UIModules Properties like for instance: Race_Chrono see: [{'id': 'Race_Chrono', 'position': [0, -80], 'scale': 1, 'visible': True},

Original Callback:

Script Common.UIModules.Properties

Parameters:
  • responseid – Internally used. Ignore

  • uimodules – Collection of all UIModules in TM2020.

:type id Name of the UIModule :type position Position to place/get Position [0,-80] as example :type scale Scale measurement :type visible Boolean True or False

pyplanet.apps.core.trackmania.callbacks.warmup_end = <pyplanet.core.events.callback.Callback object>
Signal:

Warmup Ends

Code:

trackmania:warmup_end

Description:

Callback sent when the warmup ends.

Original Callback:

Script Trackmania.WarmUp.End

pyplanet.apps.core.trackmania.callbacks.warmup_end_round = <pyplanet.core.events.callback.Callback object>
Signal:

Warmup Round Ends.

Code:

trackmania:warmup_end_round

Description:

Callback sent when a warm up round ends.

Original Callback:

Script Trackmania.WarmUp.EndRound

Parameters:
  • current – Current round number.

  • total – Total warm up rounds.

pyplanet.apps.core.trackmania.callbacks.warmup_start = <pyplanet.core.events.callback.Callback object>
Signal:

Warmup Starts

Code:

trackmania:warmup_start

Description:

Callback sent when the warmup starts.

Original Callback:

Script Trackmania.WarmUp.Start

pyplanet.apps.core.trackmania.callbacks.warmup_start_round = <pyplanet.core.events.callback.Callback object>
Signal:

Warmup Round Starts.

Code:

trackmania:warmup_start_round

Description:

Callback sent when a warm up round start.

Original Callback:

Script Trackmania.WarmUp.StartRound

Parameters:
  • current – Current round number.

  • total – Total warm up rounds.

pyplanet.apps.core.trackmania.callbacks.warmup_status = <pyplanet.core.events.callback.Callback object>
Signal:

Status of Trackmania warmup. (mostly as response).

Code:

trackmania:warmup_status

Description:

The status of Trackmania’s the warmup.

Original Callback:

Script Trackmania.WarmUp.Status

Parameters:
  • responseid – Internally used. Ignore

  • available (bool) – Is warmup available in the game mode. (Boolean).

  • active (bool) – Is warmup active and ongoing right now.

pyplanet.apps.core.trackmania.callbacks.waypoint = <pyplanet.core.events.callback.Callback object>
Signal:

Player crosses a checkpoint.

Code:

trackmania:waypoint

Description:

Callback sent when a player crosses a checkpoint.

Original Callback:

Script Trackmania.Event.WayPoint

player=player, race_time=source[‘racetime’], flow=flow, raw=source

Parameters:
  • race_time – Total race time in milliseconds.

  • player (pyplanet.apps.core.maniaplanet.models.player.Player) – Player instance

  • flow (pyplanet.apps.core.maniaplanet.models.player.PlayerFlow) – Flow class instance.

  • raw – Raw data, prevent to use this!

Note

This signal is not called when the player finishes or passes finish line during laps map.