Community Forum

Buy placeable/husbandry with farmland

Forum Overview >> Farming Simulator 19

CategoryFarming Simulator 19
Created08.11.2021 10:22


54reddog 08.11.2021 10:22
I'm using the Global Company mod with my map I'm building, to allow choice of which of the many yards you want to start with. I've just started building my first husbandry for a cow farm. I can only get it to work, if I specify the farmID=1 in the items xml. This is fine for the xml that relates to that particular yard, but I'd like the husbandry to still be there for the other farm choices, as a player may choose later to buy the land.

I've tried various locations for the <boughtWithFarmland>true</boughtWithFarmland> tags in the xml, but it doesn't seem to work under any circumstances.

Has anyone successfully done this?

Bilbo Beutlin (BBeutlin) 08.11.2021 22:24
See example maps like "Ravensberg" (on ModHub).

54reddog 09.11.2021 08:56
Thanks. I can see no difference with the way that map is set up and the way mine is in regards to the xml for items and the husbandry itself. Ravensberg includes a heck of a lot of extra stuff, which makes understanding why it works for that map, and not for mine somewhat difficult.

Any pointers?

Bilbo Beutlin (BBeutlin) 09.11.2021 09:12
Are your mod items registered properly in the modDesc.xml <storeItems> ?

Else I can only advice to compare carefully the defaultItems and your placeable XML's.
It works on the "Ravensberg", so it should also work on your map.

54reddog 09.11.2021 16:30
Hi, no, the placeable was not in the modDesc.xml <storeItems>. I fell into the trap that it "worked" without being there for another placeable (refillable fuel tank) so thought that was a redundant step. As it turns out, not so much! Thanks.

54reddog 10.11.2021 13:15
So that fixed the problem for the husbandry, but when trying to add fillable fuel storages to the farm yards, I'm coming up against the same issue, it just isn't be assigned when buying the land, despite the exact same setup as above. Are some placeable types not eligible for purchase when you buy land?


Bilbo Beutlin (BBeutlin) 10.11.2021 14:07
Insert the tag <boughtWithFarmland>true twice: 1x within the main section <placeable>, 1x in <storeData>. This should fix the problem.
Else there's something wrong with your mod (xml). See for comparison the "Ravensberg" farm silos for fertilizer, seeds, etc.

54reddog 10.11.2021 15:28
The Ravensberg xmls for the seeds/fert etc don't have it in the storeData section?

This is the xml I'm using

<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<placeable>
<storeData>
<name>
<en>Fuel Storage</en>
<de>Kraftstofflager</de>
</name>
<specs>
<capacity>12000</capacity>
<filltypes>DIESEL</filltypes>
</specs>
<functions>
<function>$l10n_function_fuel_Store</function>
</functions>
<price>13500</price>
<dailyUpkeep>0</dailyUpkeep>
<rotation>0</rotation>
<canBeSold>false</canBeSold>
<showInStore>false</showInStore>
<lifetime>1000</lifetime>
<species>placeable</species>
<category>silos</category>
</storeData>

<placeableType>silo</placeableType>
<filename>sellpoints/fillableFuelTankA.i3d</filename>
<placement testSizeX="3" testSizeZ="5" sizeX="2" sizeZ="4" useRandomYRotation="false" useManualYRotation="true"/>
<boughtWithFarmland>true</boughtWithFarmland>
<unloadingStation stationName="Fuel Store" appearsOnPDA="false" storageRadius="6">
<unloadTrigger exactFillRootNode="2|0|0|0|0" />
</unloadingStation>

<storages>
<storage node="2|2" fillTypes="DIESEL" capacityPerFillType="10000" />
</storages>

<loadingStation stationName="Fuel Store" appearsOnPDA="false" storageRadius="6" fillSoundIdentifier="fillSound01">
<loadTrigger triggerNode="2|1|0" autoStart="false" fillLitersPerSecond="75" />
</loadingStation>

<leveling requireLeveling="true" maxSmoothDistance="8" maxSlope="30" maxEdgeAngle="30">
<levelAreas>
<levelArea startNode="4|0" widthNode="4|1" heightNode="4|2" groundType="asphalt"/>
</levelAreas>
</leveling>

<clearAreas>
<clearArea startNode="5|0" widthNode="5|1" heightNode="5|2"/>
</clearAreas>

<seasonAreas>
<seasonArea startNode="6|0" widthNode="6|1" heightNode="6|2"/>
</seasonAreas>
</placeable>

And this is how I'm adding it via the items.xml
<item className="SiloPlaceable" filename="$mapdir$/sellpoints/fillableFuelTankA.xml" position="-1697.77 23.311 870.05" rotation="180 21.013 -180" />

Bilbo Beutlin (BBeutlin) 10.11.2021 15:38
On first glance I don't see obvious errors.
Best bet: make the mod a stand-alone placeable and test it on a standard map (without any other mods in modfolder).


PS
Concerning <boughtWithFarmland> I'm not sure. The default BGA's still have the tag within the <storeData>.

I remember some time ago I had similar problems. The double entry of <boughtWithFarmland> fixed it. But that's some FS updates ago and I don't know if there was changed something.

54reddog 10.11.2021 16:13
Hi Bilbo, thanks for your help.

I note in the log I'm now getting this error
2021-11-10 15:07 E:/FS Mods/Thurlby/FS19_Fen_Edge/sellpoints/fillableFuelTankA.i3d (3.16 ms)
2021-11-10 15:07 Error: Running LUA method 'update'.
2021-11-10 15:07 dataS/scripts/placeables/Placeable.lua(1224) : attempt to index local 'storeItem' (a nil value)

which I'm guessing is why it isn't working.

My modDesc.xml is
<storeItems>
<storeItem xmlFilename="sellpoints/gasStation.xml" />
<storeItem xmlFilename="sellpoints/sellingStationFenland.xml" />
<storeItem xmlFilename="sellpoints/husbandryCowManthorpe.xml" />
<storeItem xmlFilename="sellpoints/fillableFuelTankA.xml" />

</storeItems>

Kinda puzzled now. The placeable started off as a modhub placeable, which I have changed the model in the i3d.. I wonder if that could be the issue here. I thought I'd replicated the exact node structure but potentially not.



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