Knuckle Cracker

Creeper World 3 => The Coder's Corner => Topic started by: IntelectualMind on March 29, 2016, 02:22:50 PM

Title: Terp Terrain Detection Code
Post by: IntelectualMind on March 29, 2016, 02:22:50 PM
hey is there a way to make crpl detect if pixels are designated for terraforming if so could you tell me what it is and the perameters to use it
thx
Title: Re: Terp Terrain Detection Code
Post by: milkev on March 29, 2016, 04:01:42 PM
personally i dont know, but this seems like something that would be amazing on maps, if you can edit it then you can disable terraforming in certain areas of the map or make it so the player is forced to terraform an area before moving into it.
Title: Re: Terp Terrain Detection Code
Post by: GoodMorning on March 29, 2016, 06:52:45 PM
There is, I believe, currently no way to give Terp commands except while playing or editing. The closest CRPL can get is with SetTerrain/GetTerrain and the Override forms. See the wiki CRPL docs.

SetTerrainOverride, properly applied, could make the Creeper unaffected by the terrain. SetTerrain can reverse terraforming... but only after the level has changed.

Forcing the player to terraform before occupying can be done now, by changing heights in nearby cells. One cell in nine can be raised by one notch, making the ground uneven. This can easily be Terped level. Further unevenness can make it harder.

There exists a bug where flagging terrain for terraforming in editor, the making it void. Terps will then take a very long time to change it from 500 (void height, notionally, so that Creeper stays on land...) to a normal level. Thus, I hear, can a bridge be built through void, no CRPL required.
Title: Re: Terp Terrain Detection Code
Post by: IntelectualMind on March 30, 2016, 01:17:20 PM
it would be nice if virgil or madmag or someone could make a patch to set terrian like the terrain editor in game that would be awesome for some custom units
and thx both of you for the help. I have played CW, CW2, and CW3 love the games favs are CW and CW3
Title: Re: Terp Terrain Detection Code
Post by: GoodMorning on March 30, 2016, 09:31:43 PM
This has been requested before, but the consensus is that it would rapidly become an overused feature, and that Virgil would better spend time on developing Particle Fleet, rather than extending CRPL.

The custom units don't really suffer all that much, as we can change terrain in other ways. It has a few applications, but not enough.
Title: Re: Terp Terrain Detection Code
Post by: Vanguard on March 31, 2016, 05:15:46 AM
Depending on purpose of the script, you could at least take a "screenshot"/snapshot of the map once at the beginning and compare it each 30 frames or something to a newly created snapshot of the map and react to terrain changes. Not as elegant, but surely a solution to some problems.
Title: Re: Terp Terrain Detection Code
Post by: GoodMorning on March 31, 2016, 09:18:48 AM
To make it more efficient, you could only look at a small area, and only every few frames. SetTerrain is notoriously laggy.