Announcement: Be excellent to each other.


Caravel Forum : DROD Boards : Bugs : If... Set Player Weapon Off only detects scripting, not disarm tokens
New Topic New Poll Post Reply
Poster Message
Chaco
Level: Smitemaster
Rank Points: 3624
Registered: 10-06-2005
IP: Logged
icon If... Set Player Weapon Off only detects scripting, not disarm tokens (+1)  
This came up in chat today in the context of "having an NPC detect what weapon the player is holding":

The script commands If... Set Player Weapon Staff, Pickaxe, Caber, etc. will return true if the player's weapon has been set to those weapons either by scripting setting that as their default weapon, or if (when the script's processing sequence occurs), the player is holding that weapon (e.g. from a weapon token).

However, If... Set Player Weapon Off only returns true if the player has been disarmed via scripting. It still returns false when the player has a weapon, but has been disarmed either by a disarm token or by oremites. This is inconsistent; I'd expect that condition to return true in those latter two cases.

There's currently no _Weapon variable (which I might draw up a separate feature request for), so this means there's no way to use the "set player weapon" command to detect whether the player is disarmed on any particular turn; the only way to do so is to manually update a variable whenever something hits a disarm token.

____________________________
Quick links to my stuff (in case you forgot where it was):
Click here to view the secret text


[Last edited by Chaco at 02-03-2017 06:55 PM]
02-03-2017 at 06:54 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: 1531
Registered: 06-13-2015
IP: Logged
icon Re: If... Set Player Weapon Off only detects scripting, not disarm tokens (0)  
I agree this is a bug and should be fixed, but I will note the existence of a workaround in the vein of "testing for Player hastedness/invisibility" by having a separate character check for something relevant stepping on a disarm token and setting a variable to "yes" or "no", which the entity that's supposed to be detected armed/disarmed state checks.

____________________________
109th Skywatcher

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


[Last edited by Xindaris at 02-03-2017 10:03 PM]
02-03-2017 at 10:02 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
BenjiBenjamin123
Level: Roachling
Rank Points: 10
Registered: 01-29-2017
IP: Logged
icon Re: If... Set Player Weapon Off only detects scripting, not disarm tokens (0)  
Xindaris wrote:
I agree this is a bug and should be fixed, but I will note the existence of a workaround in the vein of "testing for Player hastedness/invisibility" by having a separate character check for something relevant stepping on a disarm token and setting a variable to "yes" or "no", which the entity that's supposed to be detected armed/disarmed state checks.

I agree with you ;)
02-08-2017 at 02:51 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
skell
Level: Legendary Smitemaster
Avatar
Rank Points: 3734
Registered: 12-28-2004
IP: Logged
icon Re: If... Set Player Weapon Off only detects scripting, not disarm tokens (0)  
And fixed. PR.

____________________________
My website | Facebook | Twitter
10-14-2020 at 08:12 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts High Scores This architect's holds Quote Reply
kieranmillar
Level: Smitemaster
Rank Points: 2670
Registered: 07-11-2014
IP: Logged
icon Re: If... Set Player Weapon Off only detects scripting, not disarm tokens (+1)  
Can confirm that in 5.1.1.alpha.2020-10-16, If... Set Player Weapon Off will return true if the player has been disarmed by a disarm token.

Note that it will still return false if the player is armed but is currently stepping on oremites and so has sheathed their weapon, however I can see the argument that this behaviour is still correct. I'll let you all battle it out as to how it should behave in this case.
10-18-2020 at 10:59 AM
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 : If... Set Player Weapon Off only detects scripting, not disarm tokens
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.