Community Forum

attempt to index local 'storeItem' (a nil value)

Forum Overview >> Farming Simulator 19

CategoryFarming Simulator 19
Created18.02.2019 18:48


William B (parzival) 18.02.2019 18:48
what I am trying to accomplish is, a pre built main farm where the player can sell everything if they choose,
here is the same errors I get for the husbandry, yet one is an actual giants file and the other is a mod, yet bot have same errors, I tried adding to storeitems with the placeable string yet error continues and can not sell any items,

2019-02-18 09:15 dataS/scripts/placeables/Placeable.lua(1092) : attempt to index local 'storeItem' (a nil value)
2019-02-18 09:15 C:/Users/Home/Documents/My Games/FarmingSimulator2019/mods/FS_19_Easy_Shed_Pack/easyShed02.i3d (359.06 ms)
2019-02-18 09:15 Error: Running LUA method 'update'.
2019-02-18 09:15 dataS/scripts/placeables/Placeable.lua(1092) : attempt to index local 'storeItem' (a nil value)
2019-02-18 09:15 data/placeables/mapUS/farmBuildings/farmHouse.i3d (1120.80 ms)
2019-02-18 09:15 Error: Running LUA method 'update'.

I have been searching for this issue, and so far it seems it is the mod, there is no gameplay or something in the mod, yet have no idea

the mods where imported from the placeable folder within the actual map files, then deleted so the are not permanent structures,. added to items and modDesc, the entire mod is inside the map files, just incase a file is needed, i was going to clean them once i had a error free log

any help would be greatly appreciated,

Bilbo Beutlin (BBeutlin) 18.02.2019 19:45
Placeable items within your map folder must be registered in the map's modDesc.xml with the filepath relative to the modDesc, eg. your building.xml is in map subfolder "placeables":
<storeItems>
<storeItem xmlFilename="placeables/building.xml" />
...

Make sure you have a complete and valid <storeData> section in your building.xml - take similar default items for template.

William B (parzival) 18.02.2019 19:58
as shown above, with the farm house, does this not have a complete store data?
yet even when added to moddesc the error continues and can not sell the placeable, the sell screen says can not sell. and the error is still present?

giants farm house errror
2019-02-18 09:15 dataS/scripts/placeables/Placeable.lua(1092) : attempt to index local 'storeItem' (a nil value)
2019-02-18 09:15 data/placeables/mapUS/farmBuildings/farmHouse.i3d (1120.80 ms)
2019-02-18 09:15 Error: Running LUA method 'update'.

from the giants farm house xml
<placeable>
<storeData>
<name>$l10n_object_farmhouse</name>
<functions>
<function>$l10n_function_farmHouse</function>
</functions>
<image>$data/placeables/mapUS/farmBuildings/store_farmHouse.png</image>
<price>180000</price>
<dailyUpkeep>150</dailyUpkeep>
<lifetime>1000</lifetime>
<rotation>0</rotation>
<brand>LIZARD</brand>
<species>placeable</species>
<category>farmhouses</category>
<vertexBufferMemoryUsage>1152</vertexBufferMemoryUsage>
<indexBufferMemoryUsage>144</indexBufferMemoryUsage>
<textureMemoryUsage>128</textureMemoryUsage>
<instanceVertexBufferMemoryUsage>0</instanceVertexBufferMemoryUsage>
<instanceIndexBufferMemoryUsage>0</instanceIndexBufferMemoryUsage>
</storeData>

Bilbo Beutlin (BBeutlin) 18.02.2019 20:25
There are two versions each (DE/US) of the farmhouses: one for placement by defaultItems and one user-placeable for shop.
Depending on your intention you must choose the right xml.

William B (parzival) 18.02.2019 20:45
as the string states .... is this not the correct xml? how many are there, i can only find one for the US famrhouse, also this issue is with many, yet not all, and seems to be an issue,

default items,
<item className="FarmhousePlaceable" id="25" filename="data/placeables/mapUS/farmBuildings/farmHouse.xml" position="617.473 33.475 490.239" rotation="0.0000 32.87 0.0000" farmId="1"/>

modDesc
<storeItem xmlFilename="maps/placeables/farmHouse.xml" />

error log

2019-02-18 11:40 data/placeables/mapUS/farmBuildings/farmHouse.i3d (1092.20 ms)
2019-02-18 11:40 Error: Running LUA method 'update'.
2019-02-18 11:40 dataS/scripts/placeables/Placeable.lua(1092) : attempt to index local 'storeItem' (a nil value)

i removed the other to find the issue with a default giants item, since there should be no issue placing a farm house.....

the farmhouse.xml from data/placeables/mapUS/farmBuildings/farmHouse.xml is copied into the "maps/placeables/" folder

there is no errors at all in the log for the map or any other issue no mods are loaded, and no start up errors.... in game and in editor

Bilbo Beutlin (BBeutlin) 18.02.2019 21:24
There shall be some minor details which prevent your placeable from working.
I'd suggest you take the Giants map "Estancia Lapacho" as template how to setup the modDesc, defaultItems and buildings xmls.
Especially be cautious at filename/path - unluckily game and GE have no consistent syntax - so there is often confusion between usage of "data/.." versus "$data/.."

William B (parzival) 18.02.2019 21:56
what this is telling me is, we will have to tweek things to work right now and when they make the fix, they will ignore the script to replace what was needed to get this to work and will require another edit after the patch to work again...

Bilbo Beutlin (BBeutlin) 18.02.2019 22:12
Though you didn't mention which FS version you use - I assume 1.3 beta?
Well - problems were to be expected on a beta. Hopefully the next regular patch will be halfways 'final'.
This is why I didn't spent much work in the current version.

William B (parzival) 18.02.2019 23:15
thanks for the help....used the 8.1 newest editor,
to help others
for placing a giants item that is part of the program files, you only require the xml, and link to the original source in program files,
moddesc
<storeItem xmlFilename="maps/placeables/farmBuildings/farmHouse.xml" />
default items
<item className="FarmhousePlaceable" id="25" filename="$mapdir$/maps/placeables/farmBuildings/farmHouse.xml" position="617.473 33.475 490.239" rotation="0.0000 32.87 0.0000" farmId="1"/>

farmhouse id3
<filename>$data/placeables/mapUS/farmBuildings/farmHouse.i3d</filename>

this will allow only the xml in your map files.

I am about to play with the mods to see if you can link to the mods folder and only use the xml as well,

William B (parzival) 18.02.2019 23:41
thanks for the help....used the 8.1 newest editor,
to help others
for placing a giants item that is part of the program files, you only require the xml, and link to the original source in program files,
moddesc
<storeItem xmlFilename="maps/placeables/farmBuildings/farmHouse.xml" />
default items
<item className="FarmhousePlaceable" id="25" filename="$mapdir$/maps/placeables/farmBuildings/farmHouse.xml" position="617.473 33.475 490.239" rotation="0.0000 32.87 0.0000" farmId="1"/>

farmhouse id3
<filename>$data/placeables/mapUS/farmBuildings/farmHouse.i3d</filename>

this will allow only the xml in your map files.

I am about to play with the mods to see if you can link to the mods folder and only use the xml as well,

Bilbo Beutlin (BBeutlin) 18.02.2019 23:55
Your storeItem points already to your modmap folder.
You'll also see that the path "maps/placeables/farmBuildings/.." doesn't exist in game installation (at least here - I'm still using game v1.2)

New (in 1.3) seems to be the usage of "$mapdir$" (points to current map root folder)
In earlier mapSA was still used "$moddir$FS19_EstanciaLapacho/" - so you had to keep exactly the modmap name

After all one can assume a couple of problems are caused by incompatibilities between the game versions (and/or editor vs).

William B (parzival) 19.02.2019 00:52
maps/placeables/farmBuildings/farmHouse.xml points to the xml in the map files that is required, the xml points to the id3 using $data/placeables/mapUS/farmBuildings/farmHouse.i3d within the i3d , where one could add the folders to the map yet seems not to be required,

I am about to test to see if this will also work for a mod in the mods folder, so that only the xml is required and all the associated files will stay in the zipped mod folder.

as for the string issues and changes, even basic word has find and replace and is showing nothing but laziness in programming on giants part, just like any website, the editor is only a wyswyg to assit in the 3d placement, the editor is actually not needed if one could place the objects correctly without it,

William B (parzival) 19.02.2019 17:51
I cant seem to find the proper string for the xml to find the id3 in the mods folder.

hallpack6 xml
<filename>$moddir$FS19_compositeHallPack/compositeHall6.i3d</filename>

this string and the others can not find the mods folder and the files inside it, is there a string for this or does one have to link directly to it ?

there should be no reason why all files must be added to the map files, only the xml is required, the issues is how the program finds it,.


William B (parzival) 19.02.2019 18:18
it seems the files are being forced to the map folder in the mods folder,

2019-02-19 09:14 Error: failed to load i3d file 'C:/Users/Home/Documents/My Games/FarmingSimulator2019/mods/Flusstal2

what is the string to go back one folder to mods/hallpack.?

Bilbo Beutlin (BBeutlin) 19.02.2019 18:26
What I've found so far: the filepath of i3d is relative to the mod's root folder. At least in this style the latest Giants' mods are setup. They also recommand a certain directory structure to keep it compatible.

If you want to point to an external i3d, you'll need the 'parent' - eg. filename="../FS19_otherMod/path/file.i3d" (usual Windows/DOS syntax)

William B (parzival) 19.02.2019 18:35
yes, I understand that, yet the map only need to find the i3d file, no matter where it is, should not need a duplicate i3d in the map and also in the mods folder, all that should be needed is the xml to point to the correct spot for the i3d file to load,

yet the xml seems to default to the map parent directory, where another string %modir% could be implemented to allow for simple coding,

William B (parzival) 19.02.2019 18:44
yes, I understand that, yet the map only need to find the i3d file, no matter where it is, should not need a duplicate i3d in the map and also in the mods folder, all that should be needed is the xml to point to the correct spot for the i3d file to load,

yet the xml seems to default to the map parent directory, where another string %modir% could be implemented to allow for simple coding,

Bilbo Beutlin (BBeutlin) 19.02.2019 18:52
yeah - it has become better - however far away from 'consistent syntax'.
Primarily is still confusion about the 'home dir' lock and when to use placeholders like $moddir$ and $mapdir$.
Giants seems to like keeping the modders in 'trial and error'. *g*

William B (parzival) 19.02.2019 19:28
hopefully they will release some real documentation and then update is as required,
thanks for all your help, the time you take to help everyone, greatly appreciated,.

using just the xml works (have to set location to store as well in xml), and does not give a error in the log, yet in the store/garage to sell the item, you can sell the item, yet there is an error, you can see the picture but the name has an error.

is there a fix for this? does it cause any in game issues?
since this method will allow for all large husbandry to be added to a default map ( was going to set it up with defaultitem so will only be avail in basic start mode like intended by the game,

Bilbo Beutlin (BBeutlin) 19.02.2019 20:01
With "name" you mean the notation in store?
There's no failure for gameplay to be expected, will give merely a warning "missing l10n..".
You may add the name in modDesc, example for <name>$l10n_abcdef</name> :
<l10n>
<text name="abcdef"> <en>anything</en> ... </text>
</l10n>

Björn Gottschalk (bgo1973) 03.03.2019 19:18
This will help:
https://www.modding-welt.com/forum/thread/17406-platzierbare-objekte-in-map-einbinden/


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