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::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 2 years ago by Miss(Trusted developer)