[FS19] Multi Terrain Angle

TracMaxx
Posts: 60
Joined: Mon Mar 11, 2013 11:41 am

Re: [FS19] Multi Terrain Angle

Post by TracMaxx » Mon May 13, 2019 12:25 pm

@Oddbob
1. ModMap.lua: numAdditionalAngleChannels = 4
3. map.i3d: numDensityMapChannels: 17, combinedValuesChannels "0 3 0:6 6 0:3 3 1"

I am satisfied with 2 additional channels resulting in angles of mlutiples of 11.25° (this I have tested and it works - thanks to all contributors of this thread *thumbsup* :hi: ), 4 additional channels will result in 2.8° angles (not tested by myself). Please let us know if it works, because 17 channels are one more as two bytes (16 channels), I wonder if this gdm can be converted into png.

Greetings TracMax

Oddbob
Posts: 19
Joined: Wed Nov 21, 2018 12:03 pm

Re: [FS19] Multi Terrain Angle

Post by Oddbob » Wed May 15, 2019 9:07 am

TracMaxx wrote:
Mon May 13, 2019 12:25 pm
@Oddbob
1. ModMap.lua: numAdditionalAngleChannels = 4
3. map.i3d: numDensityMapChannels: 17, combinedValuesChannels "0 3 0:6 6 0:3 3 1"

I am satisfied with 2 additional channels resulting in angles of mlutiples of 11.25° (this I have tested and it works - thanks to all contributors of this thread *thumbsup* :hi: ), 4 additional channels will result in 2.8° angles (not tested by myself). Please let us know if it works, because 17 channels are one more as two bytes (16 channels), I wonder if this gdm can be converted into png.

Greetings TracMax
Thank you for this. I actually got it working on a fresh start of the map I was working on, with numAdditionalAngleChannels = 3 and numDensityMapChannels: 16, combinedValuesChannels "0 3 0:6 5 0:3 3 1" and 31/32 in the groundshaderxml. Someone else on another site or maybe YouTube (can't remember) showed that, and I went with it, and am satisfied with it.

However thank you very much for the info provided as maybe in the future I will change to that.

canons
Posts: 1
Joined: Sun Oct 31, 2010 7:09 pm

Re: [FS19] Multi Terrain Angle

Post by canons » Sat Jun 01, 2019 11:32 am

Hi, I followed the tutorial step by step to apply the "Multi terrain angle" in the beautiful "Hof Bergmann" map, but when I try to start it I get this kind of error:

2019-06-01 11:16 Error: Running LUA method 'update'.
2019-06-01 11:16 dataS/scripts/BaseMission.lua(57) : attempt to index local 'missionCollaborators' (a nil value)
2019-06-01 11:16 Error: Running LUA method 'update'.
2019-06-01 11:16 dataS/scripts/events.lua(31) : attempt to index global 'g_currentMission' (a nil value)
2019-06-01 11:16 Error: Running LUA method 'update'.
2019-06-01 11:16 dataS/scripts/events.lua(38) : attempt to index global 'g_currentMission' (a nil value)
2019-06-01 11:16 Error: Running LUA method 'update'.
2019-06-01 11:16 dataS/scripts/events.lua(53) : attempt to index global 'g_currentMission' (a nil value)

what could it depend on? Thank you

TracMaxx
Posts: 60
Joined: Mon Mar 11, 2013 11:41 am

Re: [FS19] Multi Terrain Angle

Post by TracMaxx » Wed Jun 05, 2019 10:43 am

@canons
I never got this error in combination with the multi terrain angle. So I suggest something else got wrong or you have a typewriter error either in modDesc.xml or ModMap.lua.
For comparison an extract of my modDesc.xml

Code: Select all

    <maps>
        <map id="MapNonnenthal" className="ModMap" filename="scripts/ModMap.lua" configFilename="maps/Nonnenthal.xml" defaultVehiclesXMLFilename="defaultVehicles.xml" defaultItemsXMLFilename="defaultItems.xml">
            <title>
				<en>blank 4x Map</en>
				<de>Nonnenthal</de>
            </title>
            <description>
                <en>A simple blank map to get you started.</en>
                <de>Eine schöne Map in Süddeutschland</de>
            </description>
            <iconFilename>map_previewNT.png</iconFilename>
        </map>
    </maps>
and the ModMap.lua I use

Code: Select all

--- Thanks to [Team LTW] kingkalle
--- https://forum.giants-software.com/viewtopic.php?f=884&t=103797&start=90

ModMap = {}
local ModMap_mt = Class(ModMap, Mission00)

function ModMap:new(baseDirectory, customMt, missionCollaborators)
    local mt = customMt
    if mt == nil then
        mt = ModMap_mt
    end
    local self = ModMap:superClass():new(baseDirectory, mt, missionCollaborators)

    -- Number of additional channels that are used compared to the original setting (2)
    -- two additional channels give 16 directions and an angle of 11.25°
    local numAdditionalAngleChannels = 2;

    self.terrainDetailAngleNumChannels = self.terrainDetailAngleNumChannels + numAdditionalAngleChannels;
    self.terrainDetailAngleMaxValue = (2^self.terrainDetailAngleNumChannels) - 1;

    self.sprayLevelFirstChannel = self.sprayLevelFirstChannel + numAdditionalAngleChannels;

    self.plowCounterFirstChannel = self.plowCounterFirstChannel + numAdditionalAngleChannels;
    self.limeCounterFirstChannel = self.limeCounterFirstChannel + numAdditionalAngleChannels;

    return self
end
Hope it helps
TracMax

Post Reply