Page 1 of 1

modding a mod. first time help. sheep cheese

Posted: Tue Sep 27, 2022 8:42 am
by SonoKinoko
Hi guys.

I'm a wannabe modder, and I'm playing around with some other people mod. I'm focusing on production (as I think it's the biggest update since fs19 and surprisingly it's quite forgotten so far).

I found a cute mod that add "sheep cheese" production. The mod is quite simple, and edit the vanilla sheep barn that produce "sheep milk" and sheep cheese production, which is a copy-paste from the original dairy factory, that produce "sheep cheese" instead of cheese.
Everything is sweeten up with icons and such.

Now. I'm trying to edit its file to make the dairy not just produce "sheep cheese" (which, would be ironic, placing that building next to the other dairy I have on the map!), but "sheep cheese" AND "cheese" the vanilla one.

I can't get my head around it.


this is /production on the mod file
<productions>
<production id="sheepCheese" name="$l10n_fillType_sheepCheese" cyclesPerHour="60" costsPerActiveHour="10">
<inputs>
<input fillType="MILKSHEEP" amount="3" />
</inputs>
<outputs>
<output fillType="SHEEPCHEESE" amount="2" />
</outputs>
</production>
</productions>


and this is the vanilla code
<production id="cheese" name="$l10n_fillType_cheese" cyclesPerHour="50" costsPerActiveHour="1">
<inputs>
<input fillType="MILK" amount="3" />
</inputs>
<outputs>
<output fillType="CHEESE" amount="2" />
</outputs>
</production>

I tried to literally copy paste these part back in the file, but..... if I do so, the production point disappear from the shop.


I noticed that the mod also make use of a file called "filltypes.xml" which define what is "sheepmilk, sheepcheese, etc".
Should I also write in there the definition of milk and cheese, chocolate and such?





this is the original mod:
https://www.farming-simulator.com/mod.p ... tle=fs2022

Re: modding a mod. first time help. sheep cheese

Posted: Tue Sep 27, 2022 8:49 am
by SonoKinoko
ah, worth to say I'm trying to contacting the original modder, which is Spanish, but no reply so far

Re: modding a mod. first time help. sheep cheese

Posted: Tue Sep 27, 2022 11:46 am
by Eische
Please attach your changed xml.
If the mod is not available in the shop anymore, you probably broke the xml structure by adding the second normal cheese production line.

Compare your file with other default factories featuring multiple production lines like the bakery.

Re: modding a mod. first time help. sheep cheese

Posted: Tue Sep 27, 2022 3:29 pm
by SonoKinoko
Eische wrote: Tue Sep 27, 2022 11:46 am Please attach your changed xml.
If the mod is not available in the shop anymore, you probably broke the xml structure by adding the second normal cheese production line.

Compare your file with other default factories featuring multiple production lines like the bakery.
Hi Eische, thank you very much for your reply.

what I did is copy few bunch of line from the original "dairyEU", the vanilla file into the dairysheep xml (all file attached). Not surprisingly, the mod is based on the dairyEU itself, and most of the lines are actually the same.

To cross checked I used the Notepad++ compare tool to get my head around it.


I even try to just copy one block of <production>, just for the milk, but got the same result.

This is the part I copied.

<production id="cheese" name="$l10n_fillType_cheese" cyclesPerHour="50" costsPerActiveHour="1">
<inputs>
<input fillType="MILK" amount="3" />
</inputs>
<outputs>
<output fillType="CHEESE" amount="2" />
</outputs>
</production>


No matter how I look at it, it seems correct. the only doubt I have is that maybe the filltype are not recognized? do I have to add "milk" and "cheese" in the filltype file, even if they are vanilla items?

thanks

Re: modding a mod. first time help. sheep cheese

Posted: Tue Sep 27, 2022 3:30 pm
by SonoKinoko
this is the filltype file that was in the mod

Re: modding a mod. first time help. sheep cheese

Posted: Tue Sep 27, 2022 3:56 pm
by Eische
OK, looking at your dairySheep.xml:

1.
you are missing the </production> closing line on the last production block (chocolate).
This will be the reason the mod does not appear in the shop.

2.
you don't need to add default filltypes to the filltype.xml the mod contains.
The filltype.xml of the mod simply adds those filltypes to the filltype.xml of the map.

3.
Check the sellingstation block.
You only need one line for unloadTrigger. Just add all desired filltypes so that the line looks like this:
<unloadTrigger exactFillRootNode="unloadTrigger" aiNode="unloadTriggerAINode" fillTypes="MILK SUGAR MILKSHEEP"/>
Remove the line
<fillType name="MILKSHEEP" priceScale="0.0"/>
completely, as this is of no use for factories.

The rest seems to be fine as far as I can see.

Re: modding a mod. first time help. sheep cheese

Posted: Wed Sep 28, 2022 8:12 am
by SonoKinoko
It works!!

well, almost. If I deliver milk (and I assume sugar and cocoa as well) it flash the "milk is not accept here" error message.
I've looked at the code, but I cannot find where it was suppose to go