Knuckle Cracker

Creeper World 3 => Gameplay Discussion => Topic started by: Qwerty Quazo on June 04, 2016, 11:02:46 AM

Title: How to make creeper not to pass level 10 terrain?
Post by: Qwerty Quazo on June 04, 2016, 11:02:46 AM
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?
Title: Re: How to make creeper not to pass level 10 terrain?
Post by: Builder17 on June 04, 2016, 11:27:49 AM
Script from web version under , I think virgil did it.  :-\
Title: Re: How to make creeper not to pass level 10 terrain?
Post by: Qwerty Quazo on June 04, 2016, 12:10:45 PM
Oh ok thanks.
Title: Re: How to make creeper not to pass level 10 terrain?
Post by: Qwerty Quazo on June 05, 2016, 04:24:30 AM
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.
Title: Re: How to make creeper not to pass level 10 terrain?
Post by: Builder17 on June 05, 2016, 04:40:57 AM
That GetUpdateCount eq0...  >:(

Whyever it was there inside Awake function?  ???
Title: Re: How to make creeper not to pass level 10 terrain?
Post by: GoodMorning on June 05, 2016, 05:59:18 AM
: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?
Title: Re: How to make creeper not to pass level 10 terrain?
Post by: Grayzzur on June 05, 2016, 12:04:43 PM
: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.
Title: Re: How to make creeper not to pass level 10 terrain?
Post by: GoodMorning on June 05, 2016, 09:53:05 PM
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...
Title: Re: How to make creeper not to pass level 10 terrain?
Post by: Grayzzur on June 05, 2016, 10:52:20 PM
My mistake... setting the terrain override to -1 resets it to default (follow actual terrain value).
Title: Re: How to make creeper not to pass level 10 terrain?
Post by: Builder17 on June 06, 2016, 03:38:38 AM
And if player terps not terrain 10 to terrain 10?
Title: Re: How to make creeper not to pass level 10 terrain?
Post by: GoodMorning on June 06, 2016, 07:02:26 AM
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).
Title: Re: How to make creeper not to pass level 10 terrain?
Post by: Grayzzur on June 06, 2016, 02:25:06 PM
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.