Hello
Im a newbie at lua and was looking for some help
i working on a trailer and would like to get the a transform in this trailer to always point in the same direction of the tractor along its x Axis.. if the tractor turns i want the transform to rotate so its always targeting the x axis at it.
How would i go about achieving this. ???
Help With Lua
8 posts
Page 1 of 1
Re: Help With Lua
Hi,
when I understand you correctly you want to align a TG in a trailer so that its x axis always points towards the tractor?
Check the script doumentation at GDN:
http://gdn.giants-software.com/document ... ipting.php
There are a lot of commands listed which you can use.
As soon as the trailer is attached you can use the following variable to have "access" to the tractor:
self.attacherVehicle
Cheers,
fruktor
when I understand you correctly you want to align a TG in a trailer so that its x axis always points towards the tractor?
Check the script doumentation at GDN:
http://gdn.giants-software.com/document ... ipting.php
There are a lot of commands listed which you can use.
As soon as the trailer is attached you can use the following variable to have "access" to the tractor:
self.attacherVehicle
Cheers,
fruktor
Re: Help With Lua
thanks for the reply Fruktor, but i have no idea where to start with lua. Also Yes you understand properly a transform in my Trailer should have its X axis always point at the tractor.
- bassaddict
- GIANTS Software | Web/Script Programmer
- Posts: 11983
- Joined: Tue Nov 29, 2011 2:44 pm
- Location: ER, DE
Re: Help With Lua
Could you explain what exactly you want to achieve? Because there's always at least one part pointing towards the tractor (i.e. drawbar to attacher).
Re: Help With Lua
yes i know about the drawbar but at slow speeds there can be a offset, so i would like to make a tranforms X Axis is Always pointing at the Tractor.bassaddict wrote:Could you explain what exactly you want to achieve? Because there's always at least one part pointing towards the tractor (i.e. drawbar to attacher).
Re: Help With Lua
well ... first of all you should understand how to insert a new script into a vehicle.
As soon as you have a new script you can get started
- get (world) position of (which?) reference node at the tractor
- transform these coordinates into the local space of the part you want to align (actually to the parent of this part )
- align
- done
You might also make use of drawDebugPoint/Line to visualize some of the results.
Still, the question remains what you exactly want to do?
Improving the drawbar? In which situations exactly? Might be a hard job
Cheers,
fruktor
- bassaddict
- GIANTS Software | Web/Script Programmer
- Posts: 11983
- Joined: Tue Nov 29, 2011 2:44 pm
- Location: ER, DE
Re: Help With Lua
Hydraulic hoses: There's already a script for that. At least for FS13. I don't know if the original modders already converted the script to FS15, but even if not, you would still have a good base to start with.
That mod is available on FS-UK. Don't know the exact name, but shouldn't be hard to find.
That mod is available on FS-UK. Don't know the exact name, but shouldn't be hard to find.
8 posts
Page 1 of 1