Announcement: Be excellent to each other.


Caravel Forum : Caravel Boards : General : Build marker scripting question
New Topic New Poll Post Reply
Poster Message
gavgav123
Level: Delver
Avatar
Rank Points: 34
Registered: 12-12-2009
IP: Logged
icon Build marker scripting question (0)  
So I'm trying to make a hold where you can just dig around places by using the special command key "." and i want a similar effect to the digging feature in "TSS>Somewhere under the ocean> Twice west" where pressing "." would create a build marker that can be dug out by engineers. So i did a little bit of searching through the commands in scripting and couldn't find a way to set build markers relative to the players position. Anyone know a way to do this?
03-20-2016 at 04:42 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
DezzTech
Level: Smiter
Rank Points: 327
Registered: 03-31-2009
IP: Logged
icon Re: Build marker scripting question (+5)  
You'll need to use some _MyScript magic for this. _MyScript are special variables that, if set to some value other than -9999, may affect how some scripting commands work.

For example, for setting a build marker: _MyScriptX / _MyScriptY values will override the location at which the build marker will be placed. If you, say, set _MyScriptX to 5 and _MyScriptY to 10 and then placed a build marker at some location in the room, it will be placed at (5, 10) instead. _MyScriptW and _MyScriptH affect the width and height of the rectangle that will be covered by build markers. (starting at zero, so _MyScriptW = 0 is width of 1, _MyScriptW = 1 is width of 2, etc.) For example, in addition to the previous settings if you set _MyScriptW/H to 2 and 3 respectively, build marker command will place build markers at (5, 10)-(7, 13) (starting at (5, 10), 3 tiles wide, 4 tiles high).

There are also special variables _X, _Y and _O which can be used to check/change player's position and orientation. So using those in conjunction with _MyScript you should be able to do what you need.

Also, don't forget to reset _MyScript to -9999 after using them, so you don't end up accidentally affecting other commands, such as Wait, which can use _MyScriptX to set the number of turns to wait.

If I can get TSS working on this laptop, I'll write you an example script. Do you want just a 1x1 square to be marked or 3x3, like in TSS?

EDIT: Oops, fixed small mistake in the explanation.

Also, here's a script for 1x1 region to be marked:

Click here to view the secret text


EDIT2: Script for 3x3 region:
Click here to view the secret text


____________________________
Click here to view the secret text


[Last edited by DezzTech at 03-20-2016 06:15 AM]
03-20-2016 at 05:28 AM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
gavgav123
Level: Delver
Avatar
Rank Points: 34
Registered: 12-12-2009
IP: Logged
icon Re: Build marker scripting question (0)  
DezzTech wrote:
You'll need to use some _MyScript magic for this. _MyScript are special variables that, if set to some value other than -9999, may affect how some scripting commands work.

For example, for setting a build marker: _MyScriptX / _MyScriptY values will override the location at which the build marker will be placed. If you, say, set _MyScriptX to 5 and _MyScriptY to 10 and then placed a build marker at some location in the room, it will be placed at (5, 10) instead. _MyScriptW and _MyScriptH affect the width and height of the rectangle that will be covered by build markers. (starting at zero, so _MyScriptW = 0 is width of 1, _MyScriptW = 1 is width of 2, etc.) For example, in addition to the previous settings if you set _MyScriptW/H to 2 and 3 respectively, build marker command will place build markers at (5, 10)-(7, 13) (starting at (5, 10), 3 tiles wide, 4 tiles high).

There are also special variables _X, _Y and _O which can be used to check/change player's position and orientation. So using those in conjunction with _MyScript you should be able to do what you need.

Also, don't forget to reset _MyScript to -9999 after using them, so you don't end up accidentally affecting other commands, such as Wait, which can use _MyScriptX to set the number of turns to wait.

If I can get TSS working on this laptop, I'll write you an example script. Do you want just a 1x1 square to be marked or 3x3, like in TSS?

EDIT: Oops, fixed small mistake in the explanation.

Also, here's a script for 1x1 region to be marked:

Click here to view the secret text


EDIT2: Script for 3x3 region:
Click here to view the secret text

Worked perfectly. Thanks!

03-21-2016 at 12:57 AM
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 : Caravel Boards : General : Build marker scripting question
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.