Community Forum

Error after install a mod

Forum Overview >> Farming Simulator 2009

CategoryFarming Simulator 2009
Created10.07.2009 21:29

Claudio Accotardi (Unknown) 10.07.2009 21:35
I have install a mod, this are the error into console first, don't appear the pricipal menu:
[string "dataS/scripts/main.lua"]: 291 attempt call method KeyEvent (a nil value)
[string "dataS/scripts/main.lua"]: 311 attempt call method update (a nil value)
[string "dataS/scripts/main.lua"]: 326 attempt call method render (a nil value)

That I can find into script lua for resolve this problem?
Lost a variables o what?
Thanks in advance
Best regards

Michael Pillkahn (Unknown) 11.07.2009 01:07
the problem is not in main.lua
you have an error in your script, but what have you add/change, find step by step, i think nearly :keyevent or in :update

Claudio Accotardi (Unknown) 11.07.2009 09:24
Best regards

I have comment all row into functions of my file lua, but I have still the error.
It's possible what the error is into modDesc.xml or into file i3d?
Thanks in advance
Best regards

If I remove into modDesc.xml the line seven:

<specialization name="mylua" className="mylua" filename="mylua.lua"/>
<type name="mylua" className="Vehicle" filename="$dataS/scripts/vehicles/Vehicle.lua">
<specialization name="attachable" />
<specialization name="trailer" />
<specialization name="mylua" /> lin what I have removed

the game run and register my type.
I don't understud what I mistake.
Thanks in advance
Best regards.

Michael Pillkahn (Unknown) 12.07.2009 02:19
mylua is very very poor to have overview:

<specialization name="myluascript" className="myluaclass" filename="myluafile.lua"/>
<type name="myvehicle" className="Vehicle" filename="$dataS/scripts/vehicles/Vehicle.lua">
<specialization name="myluascript" />

<vehicle type="myvehicle">

an on myluafile.lua:

myluaclass = {};

and every function begins with
function myluaclass:

end end after the : with prerequisitesPresent, load, update, draw, keyevent, mousevent etc...

Claudio Accotardi (Unknown) 12.07.2009 11:21
Hi Mr. Pillkahn,
I try immediately.
Best Regards

Thanks Mr. Pillkahn, now the game run but unfortunatly I have anoter problen, I don't see the mod into the store.

The error of console when I see the menu is:
Error: unsupported description version in mod nameofmymod
There is a file what descript the syntax of file modDesc.xml how file i3d?
Thanks in advance
Best regards

I have find the error of mod but I have still error with main.lua.
I am disheartened.
Thanks at all for support.
Best regards

Michael Pillkahn (Unknown) 12.07.2009 15:12
the best way you to see what and where you need anithing is taking a running mod and show what they wrote.

for store you find two entry in moddesc.xml
the first <storeItems> is the high group but you must say
your vehicle in <storeItem>
and end with </storeItem>

when you give the value <image you have save this imagefile in your mod.

the question with lua, is saved in myvehicle.xml with

Claudio Accotardi (Unknown) 12.07.2009 18:59
I have write how you are suggest me.
If I delete in modDesc, into tag <type......, this line
<specialization name="myluascript" />
I don't have error into console.
Into myluafile I have write this:
myluaclass = {};

function myluaclass:prerequisitesPresent(specializations)
return SpecializationUtil.hasSpecialization(Trailer, specializations);

function myluaclass:load(xmlFile)

function myluaclass:delete()

function myluaclass:mouseEvent(posX, posY, isDown, isUp, button)
print("myluaclassmouseEvent(posX, posY, isDown, isUp, button)");

function myluaclass:keyEvent(unicode, sym, modifier, isDown)
print("myluaclass:keyEvent(unicode, sym, modifier, isDown)");

function myluaclass:update(dt)

function myluaclass:draw()

It's possible that function print are incorrect?
Best regards

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