COMMUNITY FORUM

Two Crop Calendars Showing

Forum Overview >> Scripting

CategoryScripting
Created21.11.2024 23:36


Ethan Baughman (drtydiesel) 21.11.2024 23:36
I was able to create a mod map edit of Riverbend Springs and have everything for the foliage files set to the correct path in the map's i3d file, plus the "fruitTypes.xml" files. When I load into the map it shows two sets of the same crop in the seasons growth calendar. I'm not sure why the game is trying to load the default xml files when I've set it to overwrite them like how FS22 would do. Anyone know if there is a setting I'm missing with the new game files?

Vidhostice S D K (apickwick) 10.12.2024 11:53
Hi,
I have the same problem. I added stubble rolling to my map using "fruitTypes.xml" and I also have crops added twice. How do I write to overwrite these crops and not add them?

<parentFile xmlFilename="string">
<attributes>
<set value="string" path="string" />
<clearList path="string" keepIndex="integer" />
<remove path="string" />
</attributes>
</parentFile>

This entry is possible in "fruitTypes.xml" but I have no idea what it is for?

Please help.

Vidhostice S D K (apickwick) 11.12.2024 09:33
So far it seems to work:
<foliageType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../shared/xml/schema/foliageType.xsd">
<fruitType name="wheat" shownOnMap="false" useForFieldMissions="true">
<mapColors default="0.6172 0.4072 0.0782 1" colorBlind="0.2918 0.3564 0.7011 1"/>
...
...

set to shownOnMap="false"

enjoy

Mirco W. (LaxZfive) 12.12.2024 14:15
If I add stubble destruction, I get a cuttereffects error when trying to harvest wheat for example. Do you have this too @apickwick?

Vidhostice S D K (apickwick) 16.12.2024 01:06
I have the same problem, it's caused by the fact that the crops are in the game twice.
I think we will have to use a lua script to convince the game not to load "maps_fruitTypes.xml" but to load our own fruitTypes.xml

I don't have a solution yet.

Mathieu Gendron (linkmat231) 17.12.2024 21:26
Its becauss its call by a lua FruitTypeManager somethings like this, but when i try to overwite the lua for my map,

the lua didnt find the good path!

i got the same error ! and i cannot delete them !

Vidhostice S D K (apickwick) 27.12.2024 07:45
stubble destruction without errors:
https://github.com/VidhosticeSDK/VidhosticeSDK/releases

enjoy it

Andrew L. (newbienearcologne) 30.12.2024 17:05
We are so happy, it looks good and we had added succesfully nonSeasonal data to standard fruits without the problems from before. We use it for the US map on a Dedi server.

We really enjoy it!

When we try to use only this part:
-- This script overrides the function that loads the default maps_fruitTypes.xml from the map folder.
source(g_currentModDirectory .. "scripts/fruitTypes.lua")

it doesn't work and we also got the error that the lua can't open our modified maps_fruitTypes.xml.

Only if we use also the first part:
-- This script will allow you to rewrite the path to the map folder using the hash sign # at the beginning.
source(g_currentModDirectory .. "scripts/getFilename.lua")

it works.

So many thanks for the link to the VidhosticeSDK.

Vidhostice S D K (apickwick) 31.12.2024 12:48
Yes, you need to use both scripts:
scripts/getFilename.lua
scripts/fruitTypes.lua
because the only way to write custom items loaded from the map into maps_fruitTypes.xml is via the hash sign #

--------------------------------

hash sign # can redirect XML file for "preplaced placeable" directly into map.i3d (user attributes)

in this sample map two identical silos with different capacity are inserted
<Attribute name="xmlFilename" type="string" value="#placeables/neuero/nl1622_2000/nl1622_2000-200000.xml"/>



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