Community Forum

Lua script issues

Forum Overview >> Farming Simulator 2011

CategoryFarming Simulator 2011
Created04.02.2011 20:42


Frederik Jørgensen (unknown) 04.02.2011 20:43
Hey :)

I got this LUA script i made..

But it wont work please help me :D

--
-- Rpm controlled Lights by Fnugski!
-- When your engine reach 1500 RPM the lights you specified will turn on!
-- @author Fnugski
-- Thanks to Sven777b for helping me making it!
-- You would have to use this with the beleuchtungV3 script by Sven777b
-- You can only modificate the RPM and the lights it should turn on!.
-- Other modifications will be taken as a rule break!
-- If you want to modificate other things ask me first!
-- Contact:
-- Skype account: frederik.joergensen1
-- MSN account: fnuggi22@hotmail.com


RLC1 = {};
function RPMlightcontrol.prerequisitesPresent(specializations)
print("specialization RPM controlled lights by Fnugski sucessfull loaded");
return true;
end;

function RLC1:load(xmlFile)
end;
function RLC1:update()
if self.motor.lastMotorRpm < 1500 then
self:setState("work:2", false);
self:setBeaconLightsVisibility(false);
end;
if self.motor.lastMotorRpm > 1500 then
self:setState("work:2", true);
self:setBeaconLightsVisibility(true);
end;
end;
function RLC1:draw()
end;

function RLC1:onEnter()
end;

function RLC1:onLeave()

self:setState("work:2", false);
self:setBeaconLightsVisibility(false);

end;
function RLC1:keyEvent(unicode, sym, modifier, isDown)
end;
function RLC1:mouseEvent(posX, posY, isDown, isUp, button)
end;
function RLC1:delete()
end;

i cant find the fail :O?

Frederik Jørgensen (unknown) 04.02.2011 23:10
by the way i added this in my moddesc

<specialization name="RPMlightcontrol" className="RLC1" filename="Scripts/RPMlightcontrol.lua />

and this

<specialization name="RPMlightcontrol" />

Stefan Geiger - GIANTS Software 08.02.2011 13:57
You have RPMlightcontrol.prerequisitesPresent
This should be RLC1.prerequisitesPresent

Apart from this it looks ok. What is the error you get?
Do you have the beleuchtungV3 specialization added? Otherwise the setState function won't exist.

Frederik Jørgensen (unknown) 08.02.2011 17:09
I fixed the RCL thingie ;)

but about the beleuchtungV3 how would i add that as specialization ?:)


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