Announcement: Be excellent to each other.


Caravel Forum : Caravel Boards : General : Some scripting related questions (Weapon tokens and ceiling lights)
New Topic New Poll Post Reply
Poster Message
LovaP48
Level: Smiter
Rank Points: 312
Registered: 05-31-2019
IP: Logged
icon Some scripting related questions (+2)  
Hello, I'm looking for some help as to what is possible to be done from the scripts - and if it IS possible, how to achieve it.

1. Can you build (weapon) tokens?

2. Can you change ceiling lights/ceiling darkness?

I'm looking to swap player weapons with the "Special Command" input in one of my rooms and wanted a really visual way of representing the current and upcoming states.

Apologies if these questions have been asked and/or answered previously. If you can link me to those, that'll be great too.
Cheers!
02-08-2025 at 12:45 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Nuntar
Level: Smitemaster
Avatar
Rank Points: 5342
Registered: 02-20-2007
IP: Logged
icon Re: Some scripting related questions (+2)  
1. Yes, you need to use a build command with _MyScriptF set to a certain value. The values for each token are at the end of this long post. As with all _MyScript variables, set it back to -9999 after use.

2. Not at the moment. You can activate/deactivate wall lights with "Activate item at". 5.2 will allow scripts to control the overall room lighting.

If you want to change the player's weapon with special command, the easiest way to do this is Set player weapon.

____________________________
50th Skywatcher
02-08-2025 at 01:22 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
LovaP48
Level: Smiter
Rank Points: 312
Registered: 05-31-2019
IP: Logged
icon Re: Some scripting related questions (0)  
Nuntar wrote:
If you want to change the player's weapon with special command, the easiest way to do this is Set player weapon.
I did see that command and I'm using it.
Nuntar wrote:
2. Not at the moment. You can activate/deactivate wall lights with "Activate item at". 5.2 will allow scripts to control the overall room lighting.
Ah, shame.
Nuntar wrote:
1. Yes, you need to use a build command with _MyScriptF set to a certain value. The values for each token are at the end of this long post. As with all _MyScript variables, set it back to -9999 after use.
Hm, sounds good and it does work, but only provided there isn't a weapon token on the tile already.
So I guess I should have asked whether I can override a weapon token with the build command.
Or perhaps build something on the tile to "erase" the previous weapon token in there, maybe like so (this is the version for pickaxe token build):
Set var "_MyScriptF" = ?????????
Build Alternate floor,15,17,15,17
Set var "_MyScriptF" = -15
Build Alternate floor,15,17,15,17
Set player weapon Pickaxe
Set var "_MyScriptF" = -9999

02-08-2025 at 02:11 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Xindaris
Level: Smitemaster
Avatar
Rank Points: 1744
Registered: 06-13-2015
IP: Logged
icon Re: Some scripting related questions (+1)  
Off the top of my head, I think the only way to delete tokens is for briar to grow over them. I don't think scripting can do that within a single turn, which can be kind of annoying.

____________________________
109th Skywatcher

Here are some links to Things!
Click here to view the secret text


[Last edited by Xindaris at 02-08-2025 04:20 PM]
02-08-2025 at 04:19 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : Caravel Boards : General : Some scripting related questions (Weapon tokens and ceiling lights)
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.9
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.