Community Forum

Enable dt In Function Other than Update?

Forum Overview >> Farming Simulator 2011

CategoryFarming Simulator 2011
Created06.02.2011 13:15

Harry Paul Jones (unknown) 06.02.2011 13:25
I have a script for some indicators , the script has been MP done and works off of an inputbinding , each light (Left,Right,Hazzards) all have there own function

function Indicators:SetRight(dt, isRight, noEventSend)
SetRightEvent.sendEvent(dt, self, isRight, noEventSend);

function Indicators:SetFlash(dt, isFlash, noEventSend)
SetFlashEvent.sendEvent(dt, self, isFlash, noEventSend);

function Indicators:SetLeft(dt, isLeft, noEventSend)
SetLeftEvent.sendEvent(dt, self, isLeft, noEventSend);

As you can see ive added dt , this hasn't helped as all that seems to reoccur when pressing the key is

Lua: Error running function: update
C:/Users/Harry/Documents/My Games/FarmingSimulator2011/mods/Bailey_Pack/Scripts/Indicators.lua(126) : attempt to compare number with nil

on that line 126

if self.delayOnLeft >= -1 then

i can give the whole function if needed but this all i will state for now , i would be more than just grateful for anyone's help.

Thomas H. (Patar) 23.02.2011 11:20
if you wont to have the dt variable in your functions you must give it as a parameter and call the function at every run of the update-function.

or you work with self.dt and add that line to update funktion:

self.dt = dt;

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