LarryG on 20/5/2013 at 14:57
Any ideas how to allow Garrett to collect arrows, but not shoot them until he finds a bow? Currently, arrows can be shot without the bow!
R Soul on 20/5/2013 at 15:50
Try NVUnusableUnlessQVar.
LarryG on 20/5/2013 at 18:34
Wow. There's practically everything in NVScript! I never noticed that one before. Thanks.
Quote:
NVUnusableUnlessQVar
An object with this script will be unfrobbable in the player's inventory unless a certain quest variable, defined by NVUnusableUnlessQVar, is set (non-zero).
This script is primarily designed for making the player start without a bow; simply add this script to all arrows and he will not be able to shoot them until you set a quest variable indicating that the bow has been picked up.
Note that this script takes over the Engine Features->FrobInfo property of any objects that have it, so any settings applied to the object itself (rather than to its archetype) will be lost.
As of the complete rewrite of this script in v1.0.8, the arrows will become usable if they are currently selected when the quest variable is changed.
Wait: ". . . certain quest variable, defined by NVUnusableUnlessQVar, is set (non-zero)" But it doesn't say what QVar or how to define it? Do I use an Editor>DesignNote:NVUnusableUnlessQVarQVar="name_of_qvar" type declaration, or is the name hardwired to something?
R Soul on 20/5/2013 at 19:06
The design note, but you don't write "QVar" twice.
Nameless Voice on 20/5/2013 at 19:44
I was going to make a joke about how NVArrowsUselessWithoutABow was actually named NVUnusableUnlessQVar in this case, but it looks like you've already discovered that.
Instead, I'll say that, while it's not explicitly stated anywhere, the NVScript documentation uses a dark blue, bold style for design note parameters. Anything bolded and dark blue is a deisgn note paramter. Green is meant to be for hard-coded QVar names (unsure if that's used consistently), and underline is for script messages.
LarryG on 20/5/2013 at 21:17
What confused me was that the design note params usually are in the form [ScriptName][type_of_param] , so if the script is NVRelayTrap and the type of param is On, the design note would be NVRelayTrapOn="name_of_on_message".
I extrapolated that since the name of the script was NVUnusableUnlessQVar and the type of the param was QVar that the param should be NVUnusableUnlessQVarQVar="name_of_qvar". It might also, reasonably, have been NVUnusableUnlessQVarName="name_of_qvar", or something else similar, as it was not explicitly stated. I had not made the connection about dark blue.
Nameless Voice on 20/5/2013 at 21:55
I wasn't always so enlightened about param naming. Originally, most of the params were rather random (e.g. NVRelayDelay instead of NVRelayTrapDelay); for a lot of the common scripts, I went back and changed the params and the documentation (while still using the old, no longer documented param as a fallback), but I didn't change every script.
Lady Rowena on 21/5/2013 at 12:40
This is exactly what I was planning to have in the 3rd mission of my campaign. I hope that I will able to set it up...:erm:
BTW, I have version 123? of NV scripts, is it the last version?
R Soul on 21/5/2013 at 18:03
It will be easy to set up. I think 1.2.3 is the latest version.
Nameless Voice on 21/5/2013 at 18:18
I think so too.