- Adjust the map i3d so that the density map can store the additional data:
Change the line
<DetailLayer name="terrainDetail" numDensityMapChannels="11" ...
to
<DetailLayer name="terrainDetail" numDensityMapChannels="12" ... - Adjust the map i3d so that the additional data is also passed over to the renderer.
Adjust the attribute on the same line as in the previous step
combinedValuesChannels="0 3 0;5 2 0;3 2 1"
to
combinedValuesChannels="0 3 0;5 3 0;3 2 1" - Adjust groundShader.xml:
Change the line 207
angle = ceil(angle*3-0.0001)/4*3.14159;
to
angle = ceil(angle*7-0.0001)/8*3.14159; - Create a lua file to make some script adjustments (ModMap.lua):
Code: Select all
ModMap = {} local ModMap_mt = Class(ModMap, Mission00) function ModMap:new(baseDirectory, customMt) local mt = customMt if mt == nil then mt = ModMap_mt end local self = ModMap:superClass():new(baseDirectory, mt) -- Number of additional channels that are used compared to the original setting (2) local numAdditionalAngleChannels = 1; self.terrainDetailAngleNumChannels = self.terrainDetailAngleNumChannels + numAdditionalAngleChannels; self.terrainDetailAngleMaxValue = (2^self.terrainDetailAngleNumChannels) - 1; self.sprayLevelFirstChannel = self.sprayLevelFirstChannel + numAdditionalAngleChannels; self.ploughCounterFirstChannel = self.ploughCounterFirstChannel + numAdditionalAngleChannels; return self end
- Let the game know to use the ModMap.lua:
Adjust the according map definition line in the modDesc.xml. E.g. the following line
<map id="SampleModMap" className="Mission00" filename="$dataS/scripts/missions/mission00.lua" configFilename="maps/map01.xml" defaultVehiclesXMLFilename="defaultVehicles.xml">
needs to be adjusted to
<map id="SampleModMap" className="ModMap" filename="ModMap.lua" configFilename="maps/map01.xml" defaultVehiclesXMLFilename="defaultVehicles.xml"> - The cultivator_density.gdm of your map also need to be extended to 12 channels. Therefore, the easiest way is to convert the .gdm file to a .png so that the editor can automatically extend it to 12 channels. Note that, however, some informatione might be slightly wrong after extending it. For exaxmple fields that have been rotated by 90° degrees will only use 45° afterwards, since the store information is interpreted differently and the editor doesn't know how to convert that.
-For this, download the GRLE Converter from gdn.giants-software.com and unzip it.
-Drag&Drop the cultivator_density.gdm of your map onto the "convert.cmd".
-Check that a file cultivator_density.png has been created at the same folder as the cultivator_density.gdm
-Delete the cultivator_density.gdm
-Open your map in the GIANTS Editor and make sure that it displays correctly.
-Save the map.
-Check that a new cultivator_density.gdm file has been created.
-And finally, delete the cultivator_density.png again and just keep the new cultivator_density.gdm.
The used numbers in this tutorial will allow you to use 8 different direction for the fields, instead of the 4 used by default. If more directions are needed, the numbers for numDensityMapChannels, combinedValuesChannels, the shader and numAdditionalAngleChannels in the script need to be adjusted accordingly.