Post
by mligh2 » Sat Feb 02, 2019 4:55 am
Azfoor wrote: ↑Tue Jan 29, 2019 10:38 pm
I can not get this to wort no mather how many times i folow the tutorial.... and i did this all the time in 17....
the error i get is this /Error: mission class LS19_Zweisternhof_GP.ModMap could not be found
I hate to be that guy but following this tutorial did work for me - first time too. I added 3 channels to the Rolling Hills map for FS19, even though I'm sure DR modding will have it in their next iteration of the map.
Steps are as follows (note: don't type the quotation marks I use below into the scripts; if quotation marks are already used in a script then don't delete them):
1. ModMap.lua --- Create a lua file using the script modelleicher left for us. I used the one he linked at pastebin. Be sure it's lua and not still a text document. I just pasted the script into notepad++ and changed the language to lua and then saved it. Then change the number to how many channels you want to ADD. In my case I added 3 channels so this now reads "numAdditionalAngleChannels = 3".
2. modDesc.xml --- Change the mission class in the modDesc.xml file to ModMap. I would just call it ModMap instead of having to change all the other stuff he mentions if you want to call it something else. Keep it simple. Then change the filename to ModMap.lua so that it points to the file you just created and placed in the mod folder. If you place this file anywhere else be sure your file path is correct. Again, I would keep it simple to mitigate the potential for scripting errors.
3. map.i3d --- Now dive into the map folder and edit the i3d file for the map (not the shapes file) in notepad++. In the files section you want to edit the script that points to your groundShader.xml file. You can put this wherever you want but be sure your file path is correct. In the video he places it in a folder called shaders within the mod folder itself (as opposed to the Farm Sim data folder where your game is installed). The actual groundShader file comes in the next step. Now find the terrainDetail line in the code and change the numDensityMapChannels to 13 PLUS however many channels you want to ADD. In my case, I added 3 channels so in my script I changed this to 16. Now scroll to the right and find combinedValuesChannels. There are 3 sets of 3 numbers here and in a stock map they will read "0 3 0:6 2 0:3 3 1". The number you want to change is right in the middle. So in my case I changed the whole script to now read "0 3 0:6 5 0:3 3 1" because I added 3 channels and 2+3=5.
4. groundShader.xml --- Create a folder called "shaders" and copy the groundShader.xml file from your FS19 game data folder (it's also in a folder called "shaders"). I bought this game on Steam and my game library is on my storage drive which is labeled with the letter E so if you're like me the file path will be E:\Program Files (x86)\Steam\steamapps\common\Farming Simulator 19\data. Now on lines 12 and 15 you'll need to remove the two dots in the file path for defaultFilename and change them to "$data" instead. This is because the xml file is no longer in the FS data folder but you need it to still point to other files that are saved there. Now on line 210 change the line for the angle. You need to change the 3 where it says "angle*3" and you need to change the 4 where it says "/4*3.". Multiply the 4 by 2 to the power of how many channels you added. So in my case 4*2^3=32. Then the 3 gets changed to whatever that is minus 1 - which in this case means it's now 31. So the script was "angle = ceil(angle*3-0.0001)/4*3.14159;" and now after we've added 3 channels it reads as "angle = ceil(angle*31-0.0001)/32*3.14159;".
5. cultivator_density.gdm --- Now as the video demonstrates you need to convert the cultivator_density.gdm file in your FS19 map to a png file using the grleConverter which is available on the developer network. Then take this png file and put it into an FS17 map folder (I used a stock version of Westbridge Hills, you can also just use the sample mod map that comes with the game). Make sure you delete the original gdm file that's in this FS17 map so that you can create a new one when you save it.
6. FS17 map adjustments --- Go into your FS17 map files now and update the groundShader.xml file just as you did in the FS19 map (don't change file paths though because you're not moving this one). As for the map.i3d file you need to add the same number of channels but you want to have the same numbers that are in your FS19 map so that the gdm file gets scripted properly. So if you add 3 channels like I did then change the numDensityMapChannels from 11 to a 16 and change combinedValuesChannels from "0 3 0;5 2 0;3 2 1" to now read as "0 3 0;5 5 0;3 2 1".
7. Moving files --- Now open your FS17 map in Giants editor version 7.1.0 (yes, the old version). Yes, it will look weird because it's now using the terrain detail from your FS19 map - it's ok , just hit save. Once the new gdm file is created for your FS17 map copy it and save it in your FS19 map (replace the gdm file that's already saved there if you didn't already delete it). Then delete the png file you created and saved there with the grleConverter. So to recap, all you do is take your FS19 gdm file - convert it to a png - load it into an FS17 map after you also change the scripting to allow for more terrain channels - use the old version of the Giants editor to convert it back to a gdm file which is now scripted properly - then load your newly scripted FS17 gdm file back into your FS19 map and delete the png file. Actually a simple process, just a lot of steps.
DONE.