Structures/VehicleParamsEngine

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
m (Added a warning in maxRPM + an explanation for horsepower)
 
Line 6: Line 6:
 
}}{{StructureField|number|boostDelay|Amount of seconds between being able to use the boost ( by pressing Shift key by default )}}{{StructureField|number|boostDuration|Duration of the boost in seconds}}{{StructureField|number|boostForce}}{{StructureField|number|boostMaxSpeed|Maximum speed while boosting
 
}}{{StructureField|number|boostDelay|Amount of seconds between being able to use the boost ( by pressing Shift key by default )}}{{StructureField|number|boostDuration|Duration of the boost in seconds}}{{StructureField|number|boostForce}}{{StructureField|number|boostMaxSpeed|Maximum speed while boosting
  
'''WARNING!''' The SetVehicleParams function takes this in MILES PER HOUR, but GetVehicleParams returns this IN HAMMER UNITS!<br/>
+
{{Warning|The {{ClassFunction|Vehicle|SetVehicleParams}} function takes this in '''miles per hour''', but {{ClassFunction|Vehicle|GetVehicleParams}} returns this in '''hammer units per second'''!
1MPH is roughly 17.6 HU.
+
 
 +
1 MPH is roughly 17.6 HU/s.}}
 
}}{{StructureField|number|gearCount|Amount of gears this vehicle has}}{{StructureField|table|gearRatio|A table of numbers, of gear rations.<br/>Table length is equal to "gearCount" member of this table.}}{{StructureField|number|horsepower|The HP amount of the vehicle
 
}}{{StructureField|number|gearCount|Amount of gears this vehicle has}}{{StructureField|table|gearRatio|A table of numbers, of gear rations.<br/>Table length is equal to "gearCount" member of this table.}}{{StructureField|number|horsepower|The HP amount of the vehicle
  
Line 13: Line 14:
 
}}{{StructureField|boolean|isAutoTransmission|If ''true'', the gearbox shifts gears, if ''false'' the gearbox stays stuck to the 1st gear (gear number 0).}}{{StructureField|number|maxRPM|Maximum RPM of the vehicle.<br/>Despite this being a maximum value, the vehicle can exceed it.
 
}}{{StructureField|boolean|isAutoTransmission|If ''true'', the gearbox shifts gears, if ''false'' the gearbox stays stuck to the 1st gear (gear number 0).}}{{StructureField|number|maxRPM|Maximum RPM of the vehicle.<br/>Despite this being a maximum value, the vehicle can exceed it.
  
'''WARNING!''' Attempts to exceed the max RPM will force the active gear ratio to be that of the 1st gear, which will provide even more torque. This is the opposite of a rev limiter. This value is only used for the calculation of the effectively applied torque.
+
{{Warning|Attempts to exceed the max RPM will force the active gear ratio to be that of the 1st gear, which will provide even more torque. This is the opposite of a rev limiter. This value is only used for the calculation of the effectively applied torque.}}
 
}}{{StructureField|number|maxRevSpeed|Maximum reverse speed of the vehicle
 
}}{{StructureField|number|maxRevSpeed|Maximum reverse speed of the vehicle
  
'''WARNING!''' The SetVehicleParams function takes this in MILES PER HOUR, but GetVehicleParams returns this IN HAMMER UNITS!<br/>
+
{{Warning|The {{ClassFunction|Vehicle|SetVehicleParams}} function takes this in '''miles per hour''', but {{ClassFunction|Vehicle|GetVehicleParams}} returns this in '''hammer units per second'''!
1MPH is roughly 17.6 HU.
+
 
 +
1 MPH is roughly 17.6 HU/s.}}
 
}}{{StructureField|number|maxSpeed|Maximum forward going speed of the vehicle without boosting
 
}}{{StructureField|number|maxSpeed|Maximum forward going speed of the vehicle without boosting
  
'''WARNING!''' The SetVehicleParams function takes this in MILES PER HOUR, but GetVehicleParams returns this IN HAMMER UNITS!<br/>
+
{{Warning|The {{ClassFunction|Vehicle|SetVehicleParams}} function takes this in '''miles per hour''', but {{ClassFunction|Vehicle|GetVehicleParams}} returns this in '''hammer units per second'''!
1MPH is roughly 17.6 HU.
+
 
 +
1 MPH is roughly 17.6 HU/s.}}
 
}}{{StructureField|number|shiftDownRPM|Amount of RPM to automatically shift one gear down}}{{StructureField|number|shiftUpRPM|Amount of RPM to automatically shift one gear up}}{{StructureField|number|throttleTime}}{{StructureField|boolean|torqueBoost}}
 
}}{{StructureField|number|shiftDownRPM|Amount of RPM to automatically shift one gear down}}{{StructureField|number|shiftUpRPM|Amount of RPM to automatically shift one gear up}}{{StructureField|number|throttleTime}}{{StructureField|boolean|torqueBoost}}
 
}}
 
}}

Latest revision as of 08:31, 19 December 2018

The structure used by VehicleParams structure.



Type Name Description
number autobrakeSpeedFactor
number autobrakeSpeedGain
number axleRatio

This acts as the final ratio of the gearbox.

It's like a master coefficient of the gearbox.

number boostDelay

Amount of seconds between being able to use the boost ( by pressing Shift key by default )

number boostDuration

Duration of the boost in seconds

number boostForce
number boostMaxSpeed

Maximum speed while boosting

WARNING

The Vehicle:SetVehicleParams function takes this in miles per hour, but Vehicle:GetVehicleParams returns this in hammer units per second!

1 MPH is roughly 17.6 HU/s.

number gearCount

Amount of gears this vehicle has

table gearRatio

A table of numbers, of gear rations.
Table length is equal to "gearCount" member of this table.

number horsepower

The HP amount of the vehicle

This value is used to calculate the effectively applied torque, along with ratios and maxRPM.

boolean isAutoTransmission

If true, the gearbox shifts gears, if false the gearbox stays stuck to the 1st gear (gear number 0).

number maxRPM

Maximum RPM of the vehicle.
Despite this being a maximum value, the vehicle can exceed it.

WARNING

Attempts to exceed the max RPM will force the active gear ratio to be that of the 1st gear, which will provide even more torque. This is the opposite of a rev limiter. This value is only used for the calculation of the effectively applied torque.

number maxRevSpeed

Maximum reverse speed of the vehicle

WARNING

The Vehicle:SetVehicleParams function takes this in miles per hour, but Vehicle:GetVehicleParams returns this in hammer units per second!

1 MPH is roughly 17.6 HU/s.

number maxSpeed

Maximum forward going speed of the vehicle without boosting

WARNING

The Vehicle:SetVehicleParams function takes this in miles per hour, but Vehicle:GetVehicleParams returns this in hammer units per second!

1 MPH is roughly 17.6 HU/s.

number shiftDownRPM

Amount of RPM to automatically shift one gear down

number shiftUpRPM

Amount of RPM to automatically shift one gear up

number throttleTime
boolean torqueBoost
Personal tools
Navigation