Community Forum

Brakelights script on tractor?

Forum Overview >> Farming Simulator 2011

CategoryFarming Simulator 2011
Created30.10.2010 17:54


Ducry Jerome (agrorepa) 30.10.2010 18:01
Hello, I would put a script to get the brakelight on a tractor. I used this script:

Lights = {};

Feux.prerequisitesPresent function (Specializations)
return true
end;

Lights function: load (xmlfile)
self.numbrakelights Utils.getNoNil = (getXMLInt (xmlfile, "vehicle.brakelights # count"), 0);
self.brakelights = {};
for i = 1, do self.numbrakelights
Local brakelightnamei = String.Format ("vehicle.brakelights.brakelight" .. "% d", i);
self.brakelights [i] = Utils.indexToObject (self.rootNode, getXMLInt (xmlfile, brakelightnamei .. "# index"));
setVisibility (self.brakelights [i], false);
end;
self.brakelightsActive = false;
end;

Lights function: delete ()
end;

function lights MouseEvent (posX, posY, IsDown, ISUP, button)
end;

Function Lights: KeyEvent (unicode, bal, modify, IsDown)
end;

Lights function: update (dt)
if ~ = nil Then self.isEntered
Then if self.brakelightsActive
for i = 1, do self.numbrakelights
Local Brakelight self.brakelights = [i];
setVisibility (Brakelight, self.brakelightsActive);
end;
else
for i = 1, do self.numbrakelights
Local Brakelight self.brakelights = [i];
setVisibility (Brakelight, self.brakelightsActive, false);
end;
end;
inputAxisY InputBinding.getAnalogInputAxis = (InputBinding.AXIS_FORWARD);
if (* self.movingDirection self.lastSpeed inputAxisY *-) <-0001 Then
self.brakelightsActive = true;
else
self.brakelightsActive = false;
end;
end;
end;

Lights function: draw ()
end;

And I added a TransformGroup with 2 coronalight in I3D the tractor but it does not work.

Someone would have some help for me?

Thank you in advance.

Lukas Tichy (Unknown) 30.10.2010 21:37
Change this: InputBinding.AXIS_FORWARD
this is in LS11 InputBinding.AXIS_MOVE_FORWARD_VEHICLE

Ducry Jerome (agrorepa) 31.10.2010 09:55
Thank you to you Lukas Tichy (djlukes215), it works, but not with this script feux.lua. I made the change on the script stvo.lua and everything works fine.

A big thank you for this help so fast and good game to you.

Sincerely, Agrorepa


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