Community Forum

call mod within a mod

Forum Overview >> Farming Simulator 22

CategoryFarming Simulator 22
Created23.03.2022 13:39


Charles Allman (BigPapaMax) 23.03.2022 13:39
IS it possible to call another mod within a mod? Hope that makes sense. Here is what I have tried. I edited a harvester fill level. Then I edited the headers to work at a faster speed. Now i was trying to add the edited headers to the combination statement within the specs of the harvester however they don't showup. Here is the line of code i used.

<specs>
<power>387</power>
<maxSpeed>40</maxSpeed>
<combination xmlFilename="$moddir$/FS22_BP_Modded_header625X/BP_modded_header625X.xml" />
<combination xmlFilename="$mosdir$/FS22_BP_Modded_header608C/BP_modded_header608C.xml" />
<combination xmlFilename="$moddir$/FS22_BP_Modded_diamant8/BP_modded_diamant8.xml" />
<combination xmlFilename="$data/vehicles/capello/helianthus5700/helianthus5700.xml" />
</specs>

Also me and my buddy play multi-player on a map and i edited one filltype to increase the price of the fill type zipped the map files back up and sent him the copy. We can play just fine however he sees one price and i see another price but if i load mine in single player i see thje same price he does. Anyone have any insight on what maybe causing this? Thanks so much for your time and help.

BigPapa aka Charlie

Ed Propsner (crotchfrog) 23.03.2022 14:59
You have a typo here <combination xmlFilename="$mosdir$/FS22_BP_Modded_header608C/BP_modded_header608C.xml" /> $mosdir$ instead of $moddir$

Charles Allman (BigPapaMax) 23.03.2022 16:53
Thanks for pointing that out I didnt even see it. However the only one that shows under the combination tab for the harvester is the $data one.

Charles Allman (BigPapaMax) 23.03.2022 17:11
Thanks for pointing that out I didnt even see it. However the only one that shows under the combination tab for the harvester is the $data one.

Ed Propsner (crotchfrog) 23.03.2022 17:57
Other than the typo, I probably wouldn't be of much help. It's rare that I get into anything vehicle related. This seems doable but like I said, I'm more of a map guy :)

Charles Allman (BigPapaMax) 23.03.2022 18:01
Ed,
Thanks for your input. Seeing youre a map guy any insight on why me and my buddy sees different prices for one good i changed the value in the fill type.xml? Its on multiplayer game. Thanks again for your time and input.

Charles Allman (BigPapaMax) 23.03.2022 18:30
Ed,
Thanks for your input. Seeing youre a map guy any insight on why me and my buddy sees different prices for one good i changed the value in the fill type.xml? Its on multiplayer game. Thanks again for your time and input.

Colin Smith (WrinkleysRule) 23.03.2022 19:41
Looking at your filename

<combination xmlFilename="$moddir$/FS22_BP_Modded_header625X/BP_modded_header625X.xml" />

compared with

<combination xmlFilename="$data/vehicles/capello/helianthus5700/helianthus5700.xml" />

it would appear you are trying to call an xml directly from the mod directory and not from a folder within the directory basically calling the xml a mod

Charles Allman (BigPapaMax) 23.03.2022 19:54
Colin,

Thank you for the reply. I am def not a coder. But I pulled the code structure from another mod that calls for another mod if that makes sense. Here is the line i used as example to point to the mod. I know its for placeables but I assumed the code structure would be the same.

<placeable filename="$moddir$FS22_Hessian_Farm/MW_Hessen_Hof_Haus.xml" position="-237.4714050293 102.14 110.70881652832" rotation="0 0 0" farmId="1" />

Ive tried it with and without the / between $moddir$FS22.. The FS_22BP_Modded_header625X is the actual zip folder the mod(.xml file) is sitting in. Just like the example above the FS22_Hessian_Farm is a zip folder. This is why i believed I could just use the code structure in mine to point to the mod.

Thanks again for you time

Colin Smith (WrinkleysRule) 23.03.2022 20:20
So what you are saying is the mod name is

FS22_BP_Modded_header625X/BP_modded_header625X

and your xml name is

FS22_BP_Modded_header625X/BP_modded_header625X.xml

leading to a filename of

$moddir$FS22_BP_Modded_header625X/BP_modded_header625X/FS22_BP_Modded_header625X/BP_modded_header625X.xml


Ed Propsner (crotchfrog) 23.03.2022 21:11
@Charles:

Did you copy the filltypes.xml into the map project and change the path in the map.xml to point to that edited copy? I'm assuming that you have, if not which filltype did you edit? Sounds like you're reading the local edited copy and your buddy is reading his price from the game source but I'm not sure how that would be possible, so maybe it has something to do with the savegame or your buddy didn't update his copy properly? Things can get wonky much easier in a multiplayer environment.

Concerning the mod within a mod, maybe consider merging everything into a single mod so you're not calling for bits and pieces from different mods/locations? I'm a bit confused on the file structure.

@Colin: Seems completely valid to me!! :)

Charles Allman (BigPapaMax) 23.03.2022 21:30
Colin and Ed,

The FS22_BP_Modded_header625X is the actual zip folder of the mod inside the mods folder. The BP_modded_625X.xml is the xml file sitting inside the zipped folder FS22_BP_Modded_header625X. The same code structure is used in the placeable example i gave earlier. The new mod map Fruhling(which is a mod so to speak) within its code on placeable it directs to another mod called FS22_HessianFarm. This is why I assume I should be able to do it as well.


The map is a modded map so it had a custom filltypes.xml So it doesnt reference the base game filltypes.xml. Its Yukon Valley I just change the price for the gold bars because i felt they were a lil low. Changed the vlaue zipped the files backup sent to my friend and we see different prices in multi-player. We have to have the same copy of file(hash numbers have to match) to connect to multi-player.

Thanks guys for your help

Charles Allman (BigPapaMax) 23.03.2022 21:41
Colin and Ed, Maybe this will help. I took a screenshot of what I was trying to do do. Maybe it cant be done the way i think it can. Hope this helps. I put a screenshot and files for what I am doing plus the file structure of the example.

https://drive.google.com/drive/folders/1-2DHZKr_wf1RwDfX3UNbKRzTS6hb0SPx?usp=sharing

Let me know if this link works or not.


Charles Allman (BigPapaMax) 23.03.2022 21:53
Colin and Ed,

Maybe Im not using the correct wording for what I am attempting to do. I just want the modded header to show up under the combination screen of the mooded harvester. So Im not trying to load a mod inside a mod so to speak just to point to the modded header that will work with the modded harvester.

Thanks

Ed Propsner (crotchfrog) 23.03.2022 22:34
I see what you're trying to do. I still think it would be easier to take all those components and merge them into a single mod, if just for the sake of simplicity. This way you're only calling a single mod, instead of mods calling mods. Even mods as placeables, I break them down to only what I need, and I don't use them in their zipped state.

I was originally thinking this was a map you made yourself. I wasn't really thinking about multiplayer and hashes so that definitely makes it more difficult to not be running the same copy. All I can really think of is something with the savegame since as far as I know it's the closest the game comes to caching anything locally so that you would be seeing two different prices. In the map.xml there are certain items that you can change their revision number and force an update/reload of that particular element, but I don't think fillTypes is one of them.

Sorry I couldn't be more helpful.

Colin Smith (WrinkleysRule) 24.03.2022 11:40
Have you tried this method
Create a folder in your placeables folder called vehicles, put your modified header in a folder there then reference it in the file path

<combination xmlFilename="placeables/vehicles/FS22_BP_Modded_header625X / BP_modded_header625X.xml" /> (/ spaces for clarity)

if you have only modified the xml then that is all you need to put in that folder as all the store/i3d paths will still point to the ingame model, however any changes to the i3d will require a new i3d and an adjustment of filepaths in the xml






Colin Smith (WrinkleysRule) 24.03.2022 14:05
Just a thought I presume you have the correct combination data into your BP_modded_header625X.xml in the <specs></specs> section

Charles Allman (BigPapaMax) 24.03.2022 17:13
Colin..

I think there is a little misunderstanding and its probably on my end. Just disregard the "placeables" i was just using that code as an example where one mod was pointing to another and to get the code to point back to the mods folder. I took the John Deere T560 base game harvester and edited the amount it will hold. I took all the files from the base game copied them to my desktop created the modDsec file made the changes i wanted and zipped it up and placed it in the mods folder. It shows up in the store and works as expected. I did the same thing for the grain header 625X and the corn header 608C. They all show up in the game and work just as expected. I was just wanting to get them to show up under the combination screen if possible. Within the log file the mods load with no warnings or errors its just the items do not show up under combinations screen. I add the harvester to the 625X header and it doesnt show either. So i may try to put a "header" folder within the harvester mod and place the header files in there then point the combinations to that folder and see if it works.



Colin Smith (WrinkleysRule) 24.03.2022 18:48
I was just using the placeables folder as a place to put your mod to see if it was the $moddir$ Id causing the problem.






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