Community Forum

Vehicle steering from script

Forum Overview >> Scripting

CategoryScripting
Created17.03.2016 10:55


Thomas Nagels (Unknown) 17.03.2016 10:57
Hi,


How do I steer a vehicle from a script? I would like to o it in such a way that all steered wheels respond to it at the proper ratio's.

(FYI: the goal is to create a tow bar which makes the vehicle steer as well, so that single players can properly tow vehicles.)


Thomas

Emil Drefers (Unknown) 18.03.2016 07:47
Hi,

as can be seen in the default scripts, the vehicles are steered by setting the variable "self.rotatedTime".
http://ls-mods.de/scriptDocumentation.php?lua_file=vehicles/specializations/Drivable (line 673 and following)
At least that is the way how the input is mapped to the rotation of the wheels.

Whata you need is probably a way to transfer an angle between the towbar and the attached vehicle to the rotation of the steering.
For this you can get some ideas from the steering of trailers.
http://ls-mods.de/scriptDocumentation.php?lua_file=vehicles/specializations/Attachable (line 362 and following)

Cheers,
Emil


Note: Log in to post. Create a new account here.