Community Forum

sowing machine local variable lowered

Forum Overview >> Farming Simulator 15

CategoryFarming Simulator 15
Created24.08.2015 15:24


Simon Ford (Unknown) 24.08.2015 15:32
Hi, I would like to run a script once a sowing machine has been lowered; is there a way to detect that the lower animation has been run or that the lowered state has changed and then trigger the script? I need to increment a counter each time the seeder is lowered and then I will run a custom animation once a certain number is reached in the count.

Thanks for any help you can provide

Emil Drefers (Unknown) 25.08.2015 08:04
Hi,

sure there is a way.

First of all, here is the script documentation:
http://ls-mods.de/scriptDocumentation.php

You have different options, depending on how the machine/tool is lowered.

So, you could hook into the function setJointMoveDown() of the attacher vehicle and check if the sowing machine should be lowered.
You could also check the value moveAlpha of the joint in every update (better updateTick) to see if the machine has been lowered completly.
If the tool uses an animation to be lowered ... probably by using the Foldable specialization?
(http://ls-mods.de/scriptDocumentation.php?lua_file=vehicles/specializations/Foldable)
Just check the variable "foldAnimTime" and compare it to "turnOnFoldDirection" to see if the tool is lowered completly.

Finally, you could also call the function "isLowered()" (Vehicle.lua) which might be all the information you need.

Cheers,
Emil

Simon Ford (Unknown) 28.08.2015 15:46
Thanks Emil,

I have been able to use self:Islowered() to check the state


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