qolelis on 12/12/2014 at 11:37
I just set-up NVUnusableUnlessQVar for a bow and everything works, except if the arrow is selected when the quest variable changes. This is said to have been fixed in the documentation, but I can't get it to work. I added the script to the Projectile archetype, used the default "HasBow" quest variable and NVTrapSetQVar on the bow. It works if I deselect the arrow and then select it again. As far as I know I have the latest version.
Edit:
I wasn't able to find out what I had done wrong, so I tried another approach not using the script in question, but that turned out more complicated then I felt like handling, so I put everything in a new script of my own instead and now everything is working (except that the player can fool it (if s/he really wants to) by frobbing the bow and then quickly try and shoot an arrow, and at the moment I don't know how to solve that, but I'll let that be for now).
Nameless Voice on 19/12/2014 at 18:53
So, how did your script solve the problem?
This one seems strangely unreliable, but all it's doing is changing the FrobInfo on the item.
I was going to suggest having the bow pickup send clear_weapon to unequip any equipped arrows, which would solve the problem.
qolelis on 19/12/2014 at 22:07
What I do is basically the same as you:
Code:
OnQuestChange:
if currently selected weapon == script object
Execute clear_weapon.
Restore the backed up frob-info on the script object.
Re-select the script object.
else
Restore the backed up frob-info on the script object.
If the player is quick s/he can frob the arrow before the frob-info has been updated (after the bow has been frobbed), which will make it seem like the bow isn't working for a split-second, but that can probably be solved by using your idea above, although that will change the behaviour of the script, which I'm not sure I want to do.
Well, my script may also be unreliable, but I haven't noticed anything weird yet. I have noticed similar weirdness for other scripts, though (where messages, which should clearly be handled (sent/received/etc), aren't handled).
R Soul on 19/12/2014 at 22:25
Would it be more reliable if you were to add and remove a blank Scripts property with Don't Inherit checked?
Nameless Voice on 20/12/2014 at 01:33
What if the quest variable changes while the arrow isn't the currently equipped object? Won't it stay unfrobbable forever?
qolelis on 20/12/2014 at 02:53
I split it in two cases to avoid having to deselect and reselect unless I really had to.
Nameless Voice on 27/12/2014 at 14:40
Ah, makes sense.
I've applied the same fix to my script.
fibanocci on 27/12/2014 at 14:46
So this is still NVScipt 1.24
featuring NVUnusableUnlessQVar-bypassed.
qolelis on 27/12/2014 at 23:16
Quote Posted by Nameless Voice
Ah, makes sense.
I've applied the same fix to my script.
Yup, that one works for me too.