Request: Unpassable Terrain Level Script

Started by Shockblast DX, February 20, 2021, 05:54:37 PM

Previous topic - Next topic

Shockblast DX

I'm looking for some help in making a script that makes Level 10 terrain unpassable to Creeper. I'm messing with a map idea, and using the void, as close as it is,  isn't functionally or aesthetically useful. I also do not mess with CRPL that often, so I don't know where I'd start doing it myself, so I'd rather ask the experts.

GoodMorning

#1
Here you are, if I recall my commands correctly:


once
    MapHeight 0 do
        MapWidth 0 do
I J dup2 GetTerrain 10 eq 2100 mul 1 sub SetTerrainOverride
loop
loop
endonce


Edit: Using 2148 was a poor move, it can cause pseudoterrain to overflow and look like a deep pit.
A narrative is a lightly-marked path to another reality.

TrickyPlayer

Quote from: GoodMorning on February 22, 2021, 03:12:27 AM
Edit: Using 2148 was a poor move, it can cause pseudoterrain to overflow and look like a deep pit.
You can have negative terrain overrides then? Never expected that to work, might be very interesting for me if it works. I mean, I could also just make all the other terrain higher but that doesn't really feel the same, you know? What do you mean by pseudoterrain by the way?
When you want an explanation for something I use in my levels, or if you want to suggest something, feel free to tell me. Just don't ask/suggest things every other day please :P

GoodMorning

There's a Creeper-anticreeper conversion caused by a bug-turned-feature, with 32-bit ints overflowing. It was used in a lot of CW2 custom maps and is intentionally added into the later games.

Terrain overrides apparently work by overriding the normal terrain when calculating Creeper flow. This is pseudo-terrain. At the time, shields also added their own smaller amount of pseudo-terrain (they're now field-based as of a later update). So there was a chance for the terrain to "convert" from very high to very low by integer overflow.

A negative terrain override is clamped to 0. Achieving that overflow-effect is now also much harder, perhaps not doable.

Using terrain overrides, you can get the effect of a 1000-high plateau and a 1000-deep pit by making your "normal" land height 1000 by override. But then terps aren't effective without more scripting which causes lag.
A narrative is a lightly-marked path to another reality.