Community Forum

Script Problem

Forum Overview >> Farming Simulator 2009

CategoryFarming Simulator 2009
Created10.09.2010 12:55


Joshua Branson (unknown) 10.09.2010 13:00
I have made a new script, to lift a header attacher manually and when testing it doesn't work. The log error says this:

[string "C:/Documents and Settings/Helen/My Documents/My Games/FarmingSi..."]:18: '<eof>' expected near 'end'
Error vehicle types: unknown specialization Fendt9460R.HL

Here is most of the script, could an experienced scripter please point out what is wrong.

--ScriptStartsHere--
HL = {};

function HL.prerequisitesPresent(specializations)
return SpecializationUtil.hasSpecialization(Combine, specializations);
end;

function HL:load(xmlFile)
self.attacherJointRot = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.attacherJointRot#index"));
end;
end;
end;

function HL:mouseEvent(posX, posY, isDown, isUp, button)
end;

function HL:keyEvent(unicode, sym, modifier, isDown)
end;

function HL:update(dt)
if not self.autoHeader and self.isEntered and not self.isHired then
if InputBinding.isPressed(InputBinding.HEADERDOWN) then
if self.attacherRot < 30 then
self.attacherRot = self.attacherRot + 0.01 * dt;
end;
elseif InputBinding.isPressed(InputBinding.HEADERUP) then
if self.attacherRot > -7 then
self.attacherRot = self.attacherRot - 0.01 * dt;
end;
end;
end;

if self.attacherJointRot ~= nil then
if self.autoHeader then
local x,y,z = getRotation(self.attacherJointRot);
self.attacherRot = x/3.14 * 180;
end;
end;
end;

-- Movements --

-- Manual attacher movement
if not self.isHired and not self.autoHeader then
if self.attacherJointRot ~= nil then
setRotation(self.attacherJointRot, Utils.degToRad(self.attacherRot),0 ,0);
end;
end;

function HL:onLeave()
end;

function HL:onEnter()
end;

function HL:draw()
end;

Björn M. (KillaBot) 11.09.2010 18:53
you have some misplaced "end;"s in your script.

you should delete them in the following lines:
Line 10
Line 11
Line 38

and add one at line 48 (before the onLeave function



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