Sinespace Client  2023.2.17543
Client-side scripting for Sinespace
SineSpace.Scripting.Components.SModularVehicle Class Reference
Inheritance diagram for SineSpace.Scripting.Components.SModularVehicle:
ScriptClassComponent< ModularVehicleBaseInternal >

Public Member Functions

void ForceSetOwner (int newOwner, int vehicleId)
 Force player of the id owned this vehicle, but only between this spawned vehicle. But it seems the new owner can’t drive on this vehicle. More...
 
void ForceActivate ()
 Force player drive on this vehicle More...
 
void ForceDeactivate ()
 Force player out of the vehicle, More...
 
void SuppressTimeout ()
 Disable the vehicle automatic respawn More...
 
void OverrideOnClick (Closure onClick)
 Add onClick method to this vehicle,onClick have to be a closure. More...
 

Properties

float VerticalInput [get, set]
 Force vertical offset value, it would be added to vertical control and never set to zero. More...
 
float HorizontalInput [get, set]
 Force horizontal offset value, it would be added to horizontal control and never set to zero. More...
 
float StrafeInput [get, set]
 Force strafe offset value,it would be added to strafe control and never set to zero. More...
 
float DepthInput [get, set]
 Force depth offset value, it would be added to depth control and never set to zero. More...
 
bool IgnoreUserInput [get, set]
 If this option is enabled, user input would be ignored until disable this. More...
 
SAvatar Driver [get]
 Get the player avatar component. More...
 
- Properties inherited from ScriptClassComponent< ModularVehicleBaseInternal >
SGameObject GameObject [get]
 Return the GameObject which component added. More...
 

Member Function Documentation

◆ ForceActivate()

void SineSpace.Scripting.Components.SModularVehicle.ForceActivate ( )

Force player drive on this vehicle

&ndash;get modular vehicle component.
vehicle = Space.Scene.Find("Vehicle name").Vehicle
&ndash;force player drive this vehicle
vehicle.ForceActivate()

◆ ForceDeactivate()

void SineSpace.Scripting.Components.SModularVehicle.ForceDeactivate ( )

Force player out of the vehicle,

&ndash;get modular vehicle component.
vehicle = Space.Scene.Find("Vehicle name").Vehicle
&ndash;force player out of this vehicle
vehicle.ForceDeactivate()

◆ ForceSetOwner()

void SineSpace.Scripting.Components.SModularVehicle.ForceSetOwner ( int  newOwner,
int  vehicleId 
)

Force player of the id owned this vehicle, but only between this spawned vehicle. But it seems the new owner can’t drive on this vehicle.

&ndash;get modular vehicle component.
vehicle = Space.Scene.Find("Vehicle name").Vehicle
&ndash;set ignore user input to true
vehicle.ForceSetOwner(Space.Scene.GetAvatar("Username").ID)

◆ OverrideOnClick()

void SineSpace.Scripting.Components.SModularVehicle.OverrideOnClick ( Closure  onClick)

Add onClick method to this vehicle,onClick have to be a closure.

&ndash;get modular vehicle component.
vehicle = Space.Scene.Find("Vehicle name").Vehicle
&ndash;get closure you want to define, the closure here to switch horizontal offset.
function GetOnClickClosure()
local horizontal = 1
return function ()
vehicle.Horizontal = horizontal
horizontal = horizontal * -1
end
end
&ndash;register closure to onclick
vehicle.OverrideOnClick(GetOnClickClosure())

◆ SuppressTimeout()

void SineSpace.Scripting.Components.SModularVehicle.SuppressTimeout ( )

Disable the vehicle automatic respawn

&ndash;get modular vehicle component.
vehicle = Space.Scene.Find("Vehicle name").Vehicle
&ndash;disable the vehicle automatic respawn, you should delete this vehicle manually,
vehicle.SuppressTimeout()

Property Documentation

◆ DepthInput

float SineSpace.Scripting.Components.SModularVehicle.DepthInput
getset

Force depth offset value, it would be added to depth control and never set to zero.

&ndash;get modular vehicle component.
vehicle = Space.Scene.Find("Vehicle name").Vehicle
&ndash;set depth input to 0.5
vehicle.DepthInput = 0.5

◆ Driver

SAvatar SineSpace.Scripting.Components.SModularVehicle.Driver
get

Get the player avatar component.

&ndash;get modular vehicle component.
vehicle = Space.Scene.Find("Vehicle name").Vehicle
&ndash;disable the vehicle automatic respawn, you should delete this vehicle manually,
Space.Log(vehicle.Driver.Name)

◆ HorizontalInput

float SineSpace.Scripting.Components.SModularVehicle.HorizontalInput
getset

Force horizontal offset value, it would be added to horizontal control and never set to zero.

&ndash;get modular vehicle component.
vehicle = Space.Scene.Find("Vehicle name").Vehicle
&ndash;set horizontal input to 0.5
vehicle.HorizontalInput = 0.5

◆ IgnoreUserInput

bool SineSpace.Scripting.Components.SModularVehicle.IgnoreUserInput
getset

If this option is enabled, user input would be ignored until disable this.

&ndash;get modular vehicle component.
vehicle = Space.Scene.Find("Vehicle name").Vehicle
&ndash;set ignore user input to true
vehicle.IgnoreUserInput = true

◆ StrafeInput

float SineSpace.Scripting.Components.SModularVehicle.StrafeInput
getset

Force strafe offset value,it would be added to strafe control and never set to zero.

&ndash;get modular vehicle component.
vehicle = Space.Scene.Find("Vehicle name").Vehicle
&ndash;set strafe input to 0.5
vehicle.StrafeInput = 0.5

◆ VerticalInput

float SineSpace.Scripting.Components.SModularVehicle.VerticalInput
getset

Force vertical offset value, it would be added to vertical control and never set to zero.

&ndash;get modular vehicle component.
vehicle = Space.Scene.Find("Vehicle name").Vehicle
&ndash;set vertical input to 0.5
vehicle.VertivalInput = 0.5
SineSpace.Scripting.Components.SModularVehicle.OverrideOnClick
void OverrideOnClick(Closure onClick)
Add onClick method to this vehicle,onClick have to be a closure.
Definition: SModularVehicle.cs:213