How to make creeper not to pass level 10 terrain?

Started by Qwerty Quazo, June 04, 2016, 11:02:46 AM

Previous topic - Next topic

Qwerty Quazo

On cw3 abraxas, on the last stage near the big emitter there was terrain level 10 that the creeper can't pass.

Can someone help me with crpl?
The brain is complicated. Use it or lose it.

Builder17

Script from web version under , I think virgil did it.  :-\

Qwerty Quazo

The brain is complicated. Use it or lose it.

Qwerty Quazo

Hey builder17,

I tested it but id didn't work. This is the right one:

once

do(MapHeight 0)
do(MapWidth 0)
if (GetTerrain(I J) gte(10))
SetTerrainOverride(I J 2147)
endif
loop
loop

endonce


It has a little problem with terps, but it works.

Got it from the credits mission.
The brain is complicated. Use it or lose it.

Builder17

That GetUpdateCount eq0...  >:(

Whyever it was there inside Awake function?  ???

GoodMorning

:awake gets called on reloads. So there may be something in that. Or the code may have been moved or adapted form a previous version. My bet is that the :awake is to make it lightweight, and the GetUpdateCount was to prevent terrain 10 from being converted on later missions.

Thought: Ghosts of Creeper past, where the Creeper follows the land that was before a city was built (Terrain override over the entire map). Ghosts of Creeper present, where the terrain override is reset to the Creeper depth, and Ghosts of Creeper yet to come, where it flows through the city, but you play on the land. No Terps anytime. Thoughts?
A narrative is a lightly-marked path to another reality.

Grayzzur

:Awake is used to set items that don't survive saving/loading the game.

You may want to save a test game in progress and load it up and continue, and see if the override terrain sticks. If not, putting that code in the :Awake function will fix it.

The GetUpdateCount eq0 would ensure something is only done once at the start of the game, but I think just using the once/endonce blocks would achieve that function better.

As for Terps, that's a known issue. Terping the terrain after the fact does not change the override terrain value. If you want to allow terping, you'll need code to scan terrain to find where it's less than 10 and overridden, and set the override back to zero.
"Fate. It protects fools, little children, and ships named 'Enterprise.'" -William T. Riker

GoodMorning

The Terp issue is what I was thinking of exploiting.

Is it possible to remove the override? I thought that setting it to 0 would make it function like Void+Digi.

Perhaps there's a versioning issue, or some subtlety with the override...
A narrative is a lightly-marked path to another reality.

Grayzzur

My mistake... setting the terrain override to -1 resets it to default (follow actual terrain value).
"Fate. It protects fools, little children, and ships named 'Enterprise.'" -William T. Riker

Builder17

And if player terps not terrain 10 to terrain 10?

GoodMorning

SetTerrainOverride works by cell. So, depending on the intended result, you can:

Set once and not update it (Terps can't affect it);
Set once and progressively erase it for non-10 cells (Terping affecting it going down, not up);
Progressively set it for 10-height cells, without erasing (Terps will affect it going up, not down);
Or progressively set and unset it (Terps will behave roughly as expected, but the height 10 terrain will be overridden).
A narrative is a lightly-marked path to another reality.

Grayzzur

Quote from: Builder17 on June 06, 2016, 03:38:38 AM
And if player terps not terrain 10 to terrain 10?

Depends. If you set the overrides at the beginning and then let it ride, terrain terped to level 10 afterwards will just be level 10 terrain. If your script runs through the map periodically making adjustments, you can account for it however you want.
"Fate. It protects fools, little children, and ships named 'Enterprise.'" -William T. Riker