Community Forum

Auto Load UAL Script Issue

Forum Overview >> Scripting

CategoryScripting
Created24.01.2017 18:31


Jeremy Wilson (Unknown) 24.01.2017 18:39
Ok Here is my problem I'm doing a auto load flatbed truck but I don't think this has been done and not sure if it can because the script requires its own vehicle type to work and there for eliminates the truck functions all but the lights is there a way to make this work without the bed being setup as mod its self and attachable to the truck I Want to keep it has one unit but every combination I have tried comes up empty handed I already found in Creating this mod that the type had to be set on forwarder for the tension Belts to work & now with this UAL It looking like it may not work. Is there a way to may be have mod load with two vehicle types. Type Required for UAL Is transportTrailerUAL

Bilbo Beutlin (BBeutlin) 24.01.2017 18:53
There are already autoload trailers in modhub. Take these as template.

If you have a non-standard vehicle, you must define the vehicle type in the "modDesc.xml" with all specializations:
<vehicleTypes>
<type name="myMod" className="Vehicle" filename="$dataS/scripts/vehicles/Vehicle.lua">
<specialization name="..." />
...

See for reference "sdk/vehicleTypes.xml".


If the mod uses custom scripts, these have to be pre-defined
<specializations>
<specialization name="mySpec" className="newSpec" filename="myScript.lua"/>

Jeremy Wilson (Unknown) 24.01.2017 19:17
This is not my First time doing A Auto load Trailer how ever It Is My First flatbed Truck and that's where it getting me messed up the vehicle type must be transportTrailerUAL In vehicle xml file for Script to work but by doing so I Lose all truck functions I have even Added Drivable, Motorized, Steerable to moddesc In specializations it and no matter what vehicle type I set the moddesc on it does not change the outcome

Jeremy Wilson (Unknown) 24.01.2017 19:18


Bilbo Beutlin (BBeutlin) 24.01.2017 22:15
You must collect all specs from trailer AND truck and join them in the modDesc <vehicleTypes>
Take care of the order of specs. Many specs expect other specs defined already. See "sdk/vehicleTypes.xml".

I don't know the AutoLoad in detail - perhaps there's also a global script for <extraSourceFiles> .. in the modDesc.

At least you must have in the modDesc the order:
<extraSourceFiles>
<specializations>
<vehicleTypes>

Where the modDesc <type name="myMod" .. must conform to the mod.xml tag <vehicle type="myMod">


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