Announcement: Be excellent to each other.


Caravel Forum : DROD Boards : Bugs : "Set player sword Off" and Disarm tokens (Stepping on token twice does not return sword. Intentional?)
New Topic New Poll Post Reply
Poster Message
CuriousShyRabbit
Level: Smitemaster
Rank Points: 3170
Registered: 10-14-2006
IP: Logged
icon "Set player sword Off" and Disarm tokens (0)  
The following question came up when testing Hartleyhair's hold Utopolis Life. I'm playing in 3.1.0.54

I'm wondering whether the following behavior is intentional or buggy?

Use the script "Set player sword Off" and then have the player step on a disarm token twice. The player remains swordless, even though it looks like the second use of the disarm token will return the player's sword. (The script and the disarm token do not have to be in the same room or in the same level.)
10-18-2007 at 04:22 AM
View Profile Send Private Message to User Show all user's posts Quote Reply
coppro
Level: Smitemaster
Rank Points: 1308
Registered: 11-24-2005
IP: Logged
icon Re: "Set player sword Off" and Disarm tokens (+1)  
That's a bit odd, but I think it is correct behavior. The disarm token and the script option affect different sword variables; if either one turns the sword off, the sword goes off. So therefore, the disarm token represents the token's sword state - which may matter if a script suddenly decides to give Beethro back his sword, and he's set not to have one (personally, though, I think there's more potential in tokens giving Beethro his sword back, but it's not to be)
10-18-2007 at 04:29 AM
View Profile Show all user's posts Quote Reply
CuriousShyRabbit
Level: Smitemaster
Rank Points: 3170
Registered: 10-14-2006
IP: Logged
icon Re: "Set player sword Off" and Disarm tokens (0)  
Thank you very much! That's exactly what I wanted to know. :)
10-18-2007 at 04:32 AM
View Profile Send Private Message to User Show all user's posts Quote Reply
Kalin
Level: Master Delver
Avatar
Rank Points: 175
Registered: 01-25-2016
IP: Logged
icon Re: "Set player sword Off" and Disarm tokens (0)  
I just ran into this myself, where using "Set player weapon Off" causes disarm and rearm tokens to do nothing (except toggle themselves).

I was expecting "weapon Off" to act identically to stepping on a disarm token, and "weapon On" to be a rearm token. And this thread shows that "If ... Set player weapon Off" will now return true if player is disarmed by token as well as by script.

What is "Set player weapon Off" doing (or not doing) differently than disarm tokens? And is this a bug?
12-07-2023 at 07:16 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
hyperme
Level: Smitemaster
Avatar
Rank Points: 1055
Registered: 06-23-2006
IP: Logged
icon Re: "Set player sword Off" and Disarm tokens (+2)  
This is still not a bug, and is entirely by design.

The player has both a local (to a room) and global disarm state. Disarm tokens set the local state, while the script command sets the global state. Character scripts are the only game element given the privilege to alter the global game state, and that's not going to change, as rooms are generally considered to be self-contained. See also: weapon tokens.

Disarm tokens also affect whether Mimics and Decoys have a weapon. This means there is a valid use case to have them appear in rooms where the player is disarmed by a script. I don't know if such rooms exist, but if they do, allowing disarm tokens to change the global disarm state would not only break those rooms, but possibly the entire hold that contains them. This would be very bad.

____________________________
[Insert witty comment here]
Qzvlkx?
12-07-2023 at 08:29 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Kalin
Level: Master Delver
Avatar
Rank Points: 175
Registered: 01-25-2016
IP: Logged
icon Re: "Set player sword Off" and Disarm tokens (0)  
I was not expecting script commands like this to be global. This is very unintuitive, and even more so with weapon tokens.

For example: Set player weapon Pickaxe, player wields Pickaxe, step on Staff token, player wields Staff, leave room, player now wields a Pickaxe.

I was expecting "Set player weapon" to act exactly like tokens.
12-07-2023 at 09:17 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
Dischorran
Level: Smitemaster
Avatar
Rank Points: 3406
Registered: 09-10-2005
IP: Logged
icon Re: "Set player sword Off" and Disarm tokens (+1)  
Generally if we want something that acts exactly like a token, we use a token. Scripting is conventionally for the things that can't be done with normal elements, and it's much more convenient on the architecture end to set global variables to switch weapons for entire levels.

____________________________
Click here to view the secret text

12-07-2023 at 10: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
Xindaris
Level: Smitemaster
Avatar
Rank Points: 1527
Registered: 06-13-2015
IP: Logged
icon Re: "Set player sword Off" and Disarm tokens (+1)  
If you want to use scripting to mimic token behavior (or at least, "local" weapon-swapping), all that's needed is to make sure you reset your variables to the default at the correct times (e.g., as soon as the player enters a new room).

____________________________
109th Skywatcher

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


[Last edited by Xindaris at 12-07-2023 11:16 PM]
12-07-2023 at 11:16 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 : DROD Boards : Bugs : "Set player sword Off" and Disarm tokens (Stepping on token twice does not return sword. Intentional?)
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.