All functions can be found here, for reference: https://gdn.giants-software.com/documen ... nction=289
At the moment, what I'm trying to do, is to increase the fertilization layer on the map, and also make the soil look darker (like fertilizing normally does in FS). I want to do this masked by a fruit, so that if I cultivate that fruit into the soil, the fertilization level increases and the soil turns darker (yes, I know there are probably easier ways of doing this, but I want to understand these functions, and they're needed in a more complicated situation). Increasing the fertilization layer works fine when I use the following code:
Code: Select all
local detailId = g_currentMission.terrainDetailId
local sprayLevelFirstChannel = g_currentMission.sprayLevelFirstChannel
local sprayLevelNumChannels = g_currentMission.sprayLevelNumChannels
local x,z, widthX,widthZ, heightX,heightZ = Utils.getXZWidthAndHeight(detailId, x,z, x1,z1, x2,z2)
local fruitIdOil = g_currentMission.fruits[FruitUtil.FRUITTYPE_OILSEEDRADISH].id
addDensityMaskedParallelogram(
detailId,
x,z, widthX,widthZ, heightX,heightZ,
sprayLevelFirstChannel, sprayLevelNumChannels,
fruitIdOil,
0, 1,
1
)
Code: Select all
local detailId = g_currentMission.terrainDetailId
local sprayLevelFirstChannel = g_currentMission.sprayLevelFirstChannel
local sprayLevelNumChannels = g_currentMission.sprayLevelNumChannels
local x,z, widthX,widthZ, heightX,heightZ = Utils.getXZWidthAndHeight(detailId, x,z, x1,z1, x2,z2)
local fruitIdOil = g_currentMission.fruits[FruitUtil.FRUITTYPE_OILSEEDRADISH].id
setDensityMaskedParallelogram(
detailId,
x,z, widthX,widthZ, heightX,heightZ,
g_currentMission.sprayFirstChannel, g_currentMission.sprayNumChannels,
fruitIdOil,
0, g_currentMission.numFruitStateChannels,
1
)
Now in a more general way, how should / can I use the "setDensityMaskParams" and "setDensityCompareParams"? I understand how they should be used (id, comparator, value), but I don't know what they do. If somebody could give me a general explanation of these function, and the density functions in general, that would be great