Request: Unpassable Terrain Level Script

Shockblast DX · 2272

Shockblast DX

  • Full Member
  • ***
    • Posts: 154
  • Wheeeeeeeew!
on: February 20, 2021, 05:54:37 pm
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.

"Loop a hoop hoop hopitty loplop." - Chili Dawg Dawen


GoodMorning

  • Community Guild
  • *****
    • Posts: 3450
  • (Pusillanimous)
Reply #1 on: February 22, 2021, 03:12:27 am
Here you are, if I recall my commands correctly:

Code: [Select]
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.
« Last Edit: March 02, 2021, 04:28:13 am by GoodMorning »

A narrative is a lightly-marked path to another reality.


TrickyPlayer

  • Full Member
  • ***
    • Posts: 302
Reply #2 on: May 05, 2021, 10:28:45 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

  • Community Guild
  • *****
    • Posts: 3450
  • (Pusillanimous)
Reply #3 on: May 12, 2021, 02:13:41 am
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.