Community Forum

overwritte :updateTick() function in a specialization

Forum Overview >> Farming Simulator 17

CategoryFarming Simulator 17
Created31.01.2017 11:56


Hendrik Elkmann (derelky) 31.01.2017 12:01
Hello,

is it possible to overwrite an updateTick() in a specialization?

i want to overwrite the Pipe:updateTick() because in this the Tiponground is done.
I write an new specialization which will be load after the Pipe. i know i can overwritte it with overwrittenFunction() and do it on the points like doOverload.

But how can i disable or overwritte the Pipe:updateTick() in my mod?
Its for a mill which will change the output filltype to a different than the input filltype. So to tip it on ground it is necessary to overwrite the Pipe:updateTick()

at the moment i replace the Pipe:updateTick() and it works but now every Vehicle with the Pipe Spec is using my new updateTick().

Bilbo Beutlin (BBeutlin) 31.01.2017 20:19
In the vehicle spec LUAs you'll find many examples for usage of "Utils.overwrittenFunction()", "Utils.appendedFunction()".
With these you can bypass the default functions to your own code.

Hendrik Elkmann (derelky) 01.02.2017 08:46
Hello,

yes i know how to use these functions.
but what i need is to overwrite some code in the Pipe.updateTick() but i dont know how to do this with the giving functions.

so how can i use overwrittenFunction to bypass the Pipe:updateTick() to my code only for the Vehicle which have the Spec.

it works fine with non standardFunction like doOverload e.t.c.


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