Community Forum

access shared shaders and materials from mod

Forum Overview >> Farming Simulator 19

CategoryFarming Simulator 19
Created02.10.2021 21:46

Jaclyn 02.10.2021 21:46
Hey guys, I'm very new to creating new mods. I've played around with the XML files of other mods and the base XML files for some time, but usually just changing a few simple values. I'm creating a mod for my own personal use that copies a few vehicles from the base game and uses those to make a customized version of them. I got everything working except for the shaders and materials. When I look at my vehicles in the store, they are invisible except for the wheels and shared lights. Looking at the XML for the wheels and lights they have a filename property within their nodes. Can I simply add a filename property to the <material> and <shaderParameter> nodes to fix this issue? I.e. <material name="axial9240_mat1" baseNode="axial9240_vis"> would become <material name="axial9240_mat1" baseNode="axial9240_vis" filename="$data/shaders/vehicleShader.xml">. Not sure how to point it at the shaders in the data folder. If I copy the shaders and shared folders into my mod folder everything works, but that's inefficient design.

Bilbo Beutlin (BBeutlin) 03.10.2021 04:09
Very probably you have exported the mod with wrong options.
In general answer upcoming queries
- "use parent directory" : NO
- "use game default path" : YES
All other is for special use only.

Also check the editor preferences for proper setup of game install path.

Jaclyn 03.10.2021 18:02
I haven't exported anything. I just copied the vehicle files from data/vehicles and used that as the starting point. From there all I've done is modify the XML files.

Bilbo Beutlin (BBeutlin) 04.10.2021 00:11
That's wrong. To create a new mod you cannot simply copy the files from FS install. There all filepaths are relative to the FS data folder.
Experienced users can adapt the filepaths manually. However the easier way for beginners is loading the i3d into Giants editor, then "new mod from game".

Jaclyn 05.10.2021 00:55
Aren't the file paths in the xml files? What property points at the shaders?

Bilbo Beutlin (BBeutlin) 05.10.2021 01:38
The shaders are basically part of the i3d, i.e. to change them, the i3d must be edited.
The xml allows merely the passing of certain shader parameters.

Erik Halsteinrud (NorModding) 05.10.2021 02:45
For the MF 5600 tractor for FS19, you need to open up MF5600.I3D in a text/machine code editor like Notepad ++ and look for lines such as:

<File fileId="32" filename="$data/shaders/mirrorShader.xml"/>
<File fileId="3" filename="$data/shaders/vehicleShader.xml"/>

So no, the shader paths aren't in the XML files. It's in the I3D-file.

The property that points to shaders are in this case filed and filename, which is the file path for the shader that points to the vanilla game directory called 'data"...where this is referred to as $data.

Then you have a Material that points to the vehicle shader, such as:

<Material name="MF5613_engine_decal_mat" materialId="20" cosPower="50" specularColor="1 1 1" ambientColor="1 1 1" alphaBlending="true" customShaderId="3" customShaderVariation="Decal">
<Texture fileId="19"/>
<Normalmap fileId="20"/>
<Glossmap fileId="21"/>

where customShaderId=3 is pointing to <File fileId="3" filename="$data/shaders/vehicleShader.xml"/>

IF you are going to use your own (let's say) vehicleShader or materials such as own textures that is not from the vanilla game ($data) then you can open up some other vehicle mod that is not from the game, and look at what file paths the mod is using.

Bilbo Beutlin (BBeutlin) 05.10.2021 03:44
Just a note:
The game default files almost always have relative paths, eg. the original MF5600.i3d
<File fileId="3" filename="../../../shaders/vehicleShader.xml" />
This is what I've meant in my post above 00:11
So you cannot use this for a mod by a simply copy without filepath adaption (manually or by using the GE).

Jaclyn 08.10.2021 01:26
Thank you kind gentlemen, you have been most helpful. I dunno why, but the old curmudgeon in me grumbled and groaned when I was first told I needed to use a tool other than a text editor. Probably too many hours spent in nano.

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