Community Forum

Light and turnsignal functions

Forum Overview >> Farming Simulator 15

CategoryFarming Simulator 15
Created18.05.2015 20:11


Martin Fabik (Hungar) 18.05.2015 20:19
Hi,

I creating scripts and I need functions/variables which controls lights - I have self:setLightsVisibility(bool visibility) function but this function controls only normal light and I need to control all light types. Can you tell me functions to control this?
And one more thing - can you tell me definition of funtion(s) to control turn signals?

Regards, Martin FabĂ­k.

PS: When will be documentation avaible? - a lot of things would be easier

Emil Drefers (giants.edrefers) 19.05.2015 07:38
Hi,

setLightsVisibility() is more or less deprecated.

You can use Steerable.setNextLightsState(self) to toggle through the different lights.

Or you can use self:setLightsTypesMask(lightsTypesMask, noEventSend)
Check:
http://ls-mods.de/scriptDocumentation.php?lua_file=vehicles/Vehicle
and
http://ls-mods.de/scriptDocumentation.php?lua_file=vehicles/specializations/Steerable
To get an idea of it.
In FS15 it is a bit different, but more or less the same.
So whtaver you wanna do should be applicable after understanding the "lightsTypesMask".


The turn signals can be controled with:
self:setTurnSignalState(state, noEventSend)
where state is one of the following values:
Vehicle.TURNSIGNAL_OFF = 0;
Vehicle.TURNSIGNAL_LEFT = 1;
Vehicle.TURNSIGNAL_RIGHT = 2;
Vehicle.TURNSIGNAL_HAZARD = 3;
e.g.:
self:setTurnSignalState(Vehicle.TURNSIGNAL_HAZARD, false)
to make the hazard lights blink and sync the event for MP


The documentation will be published as soon as we have the ptach 1.3 finished.
It took us a bit longer than expected to get the patch to the state which we want it to have.
But it is not anymore far away.

Cheers,
Emil



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