Jump to content

Recommended Posts

Posted

I really don't want to have to do the indoor mask by hand as I find the painting tools in GE tedious to say the least. I have written a script which will take a start, width and height parameter from transform groups in the same way as you'd define them for a single placeable, and paint the area for you. Just set the TG's in the corners of buildings you want to be excluded from the snow fall. This works create for buildings/objects that are square, but won't work for roads or different shaped buildings particularly easily.

However, I see there's a script shipped with the GE which creates a mask for you, using raycasts to find the objects and so on. However, if I run it on my 4x map, the first time it produces a really blocky and unrefined/coarse result. The second time I run it, it just whirrs and whirrs. Has anyone used this script, and if so, used it successfully on a 4x size map?

Posted

that's what I initially thought, but it picks up the terrain Density and scale and pixels per unit correctly. What turned out to be the problem seemed connected with the setting for water height. I reset it to 0, and it worked flawlessly. Bit odd really.

Posted

From the script it looks like the water height is the controlling factor (base water plane height)

--- Usage
-- Update water height: below this level all snow will be disallowed

caster.castSingle = function (self, x, z)
        local y = self:getTerrainHeight(x, z)

        if y < self.waterHeight then
            return -1 -- always hit the water surface
        end

        self.castResult = 0
        raycastAll(x, y + 0.0025, z, 0.0, 1.0, 0.0, "castCallback", 100.0, self, collisionMask)

        return self.castResult
    end

As normal with Giants there never is any information on setup and in this case no way of changing water height value without going into C:/Program Files /GIANTS Software/GIANTS_EDitor_9.0.4_64bit/scripts.

It would be quite simple to add a pop up panel to the script to allow for the water Height setting to be entered.

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now