Announcement: Remember: you are giving away your fantastic ideas for free, and somebody else might even make money from them (or appear to). That's just how the world works! If you're worried about it, maybe you shouldn't post your ideas here.


Caravel Forum : DROD Boards : Feature Requests : Ability to replace elements with another element type (To reduce tedium of changing things with "Build" command)
New Topic New Poll Post Reply
Poster Message
azb
Level: Master Delver
Rank Points: 169
Registered: 03-08-2014
IP: Logged
icon Ability to replace elements with another element type (+1)  
Currently, when you want to, say, fill a complex-shaped (not just a simple rectangle or square) pit with water or vice-versa, you need to use separate "build" commands to break it up into rectangular parts. This can get grating quickly, especially if it is consisting of many squares that are connected diagonally (A classic example of this shape pattern is in King Dugan's Dungeon: Tenth Level: 1N1E.)

Therefore, I propose a simple one-line script to take care of this type of process quickly: "Replace all instances of (element 1) with (element 2)".

In the example provided above, the simple scripting command of "Replace all instances of Pit with Water" would take up much less scripting lines and time than individual Build commands of "Build Water at (15, 13)-(15, 13)", "Build Water at (16, 14)-(17, 18)" etc.

The interface for this command would use the drop-down lists as seen in "Build" or "Wait for item at" to select the element types. However, because there are two arguments, you would have a drop-down list on the left for selecting the element you want to replace, and a drop-down list on the right for selecting the element you want to be there.

____________________________
Come on down, and contribute a level to Advanced Concepts for TSS!

[Last edited by azb at 04-30-2017 05:55 PM : Corrected example name]
04-30-2017 at 05:32 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
superluminal
Level: Delver
Rank Points: 56
Registered: 05-26-2016
IP: Logged
icon Re: Ability to replace elements with another element type (0)  
There's a pretty easy scripting fix around this, albeit with a few limitations:

  Set var "_MyScriptX" = 0
  Set var "_MyScriptY" = 0
Label loop
  If ... 
        Wait for item Pit,0,0,0,0
     Build Water,0,0,0,0
  If End 
  If ... 
        Wait until var "_MyScriptX" > 37
     Set var "_MyScriptX" = 0
     Set var "_MyScriptY" + 1
  If End 
  If ... 
        Wait until var "_MyScriptY" > 31
     Set var "_MyScriptX" = -9999
     Set var "_MyScriptY" = -9999
     Go to end
  If End 
  Set var "_MyScriptX" + 1
  Go to loop
Label end

It's not the cleanest code (I scraped it together in a few minutes), but it gets the job done. This code will iterate across the entire room and replace every instance of pit with water.

____________________________
spacelike

[Last edited by superluminal at 04-30-2017 07:23 PM]
04-30-2017 at 07:21 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
azb
Level: Master Delver
Rank Points: 169
Registered: 03-08-2014
IP: Logged
icon Re: Ability to replace elements with another element type (0)  
This works well as a condensed version in addition to the original request. :)

However, if a room's scripting were more complex and needed more calls of "replace instance" (IE: replacing four elements with four different elements at the same time), the original request would be more condensed than copying the fix repeatedly.

____________________________
Come on down, and contribute a level to Advanced Concepts for TSS!
04-30-2017 at 08:57 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : DROD Boards : Feature Requests : Ability to replace elements with another element type (To reduce tedium of changing things with "Build" command)
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.