Documentation

VehicleState plugin dependency

The VehicleState plugin provides information about the current vehicle state. The functionality was moved away from Dashboard into Openplanet 1.22.4 as its own dependency plugin shipped with Openplanet, so that every plugin can benefit from its functionality.

Debug window

In the VehicleState plugin settings, you can turn on the debugging window. This lets you see the current vehicle states in a UI.

API

The API consists out of the following functions:

VehicleState::GetViewingPlayer

Gets the currently viewed player. This can be the local player or the player being spectated.

Returns: CSmPlayer@ on Trackmania, CGamePlayer@ on Maniaplanet, or CGameMobil@ on Trackmania Turbo.

VehicleState::ViewingPlayerState

Gets the CSceneVehicleVisState handle for the currently viewed player. Note that this can be a valid state even if GetViewingPlayer() returns null!

Returns: CSceneVehicleVisState@ on Trackmania. On Maniaplanet and TrackMania Turbo, it will return a wrapper containing a subset of the API for Trackmania.

VehicleState::GetRPM

Get RPM for vehicle vis.

Parameters:

  • CSceneVehicleVisState@ vis The vehicle state.

Returns: float

VehicleState::GetSideSpeed

Get relative side speed for vehicle.

Parameters:

  • CSceneVehicleVisState@ vis The vehicle state.

Returns: float

VehicleState::GetWheelDirt

Get wheel dirt amount for vehicle vis. This function only exists for Trackmania!

Parameters:

  • CSceneVehicleVisState@ vis The vehicle state.
  • int w The wheel. Use one of the following: 0 = Front Left, 1 = Front Right, 2 = Rear Left, 3 = Rear Right

Returns: float

VehicleState::GetWheelFalling

Get wheel falling state, and if in water. This function only exists for Trackmania!

Parameters:

  • CSceneVehicleVisState@ vis The vehicle state.
  • int w The wheel. Use one of the following: 0 = Front Left, 1 = Front Right, 2 = Rear Left, 3 = Rear Right

Returns: FallingState (FallingAir, FallingWater, RestingGround, RestingWater, GlidingGround)

VehicleState::GetLastTurboLevel

Get the last turbo level that the vehicle touched. This will return the last level even if the vehicle is not currently in contact with a turbo gate/surface. This function only exists for Trackmania!

Parameters:

  • CSceneVehicleVisState@ vis The vehicle state.

Returns: TurboLevel (None, Normal, Super, RouletteNormal, RouletteSuper, RouletteUltra)

VehicleState::GetReactorFinalTimer

Get a timer which counts from 0.0 to 1.0 in the final second of reactor boost. Doesn't seem to work when watching a replay. This function only exists for Trackmania!

Parameters:

  • CSceneVehicleVisState@ vis The vehicle state.

Returns: float

VehicleState::GetCruiseDisplaySpeed

Get the current speed displayed on the back of the car if under the influence of Cruise Control. If not in Cruise Control, returns 0. This function only exists for Trackmania!

Parameters:

  • CSceneVehicleVisState@ vis The vehicle state.

Returns: int

VehicleState::GetVehicleType

Get the current vehicle type. This function only exists for Trackmania!

Parameters:

  • CSceneVehicleVisState@ vis The vehicle state.

Returns: VehicleType (CharacterPilot, CarSport, CarSnow, CarRally, CarDesert)

VehicleState::GetVis

Get vehicle vis from a given player.

Parameters:

  • ISceneVis@ sceneVis The scene visibility object. You can get this from GetApp().GameScene.
  • CSmPlayer@ player The player.

Returns: CSceneVehicleVis@

VehicleState::GetSingularVis

Get the only existing vehicle vis state, if there is only one. Otherwise, this returns null.

Parameters:

  • ISceneVis@ sceneVis The scene visibility object. You can get this from GetApp().GameScene.

Returns: CSceneVehicleVis@

VehicleState::GetAllVis

Get all vehicle vis states. Mostly used for debugging.

Parameters:

  • ISceneVis@ sceneVis The scene visibility object. You can get this from GetApp().GameScene.

Returns: CSceneVehicleVis@[]


Page updated 5 months ago by Miss(Trusted developer)