Facepunch / garrysmod-issues

Garry's Mod issue tracker
147 stars 56 forks source link

SetVehicleParams with engine.gearCount does not change gear count. #5435

Open vaqxai opened 1 year ago

vaqxai commented 1 year ago

Details

When setting a gear count with engine.gearCount, on params retrieved with GetVehicleParams, and applying them with SetVehicleParams, the gear count does not change.

Steps to reproduce

local veh = Player(1):GetVehicle() -- This is a prop_vehicle_jeep
local params = veh:GetVehicleParams()
print(params.engine.gearCount)
params.engine.gearCount = params.engine.gearCount + 1
veh:SetVehicleParams(params)
params = veh:GetVehicleParams()
print(params.engine.gearCount) -- See that it is not different, the vehicle behavior confirms this.
robotboy655 commented 1 year ago

It was disabled, if I remember correctly due to crashing issues, or it just not doing anything.

vaqxai commented 1 year ago

Is this a fix that can be made, or beyond the scope of this project / not of high enough priority due to low severity of this Bug (can be probably circumvented by modifying the vehicle script itself)?

I understand that this is not simply an API Bug but one which would require modifying engine code

robotboy655 commented 1 year ago

Can you even get a different result using vehicle scripts? As far as I know, there are no real gears in Source's vehicle physics, it's all faked with sounds.

I tried printing out https://wiki.facepunch.com/gmod/Vehicle:GetOperatingParams and the gear param barely ever goes above 1 or 2.

vaqxai commented 7 months ago

It probably is just sounds. Bummer, thought it would actually affect engine behaviour. Off to writing a combustion engine simulator and a gearbox I go, then.