Help with NVKeyRing -- Keyring doesn't always auto-select when keys are picked up - by trefoilknot
trefoilknot on 15/3/2020 at 14:51
Hi all,
I'm experiencing an issue that I can't sort out. I have a bunch of keys all with the NVKeyRingKey script (and don't inherit = TRUE). All of them work perfectly in the sense that they get added to a keyring object's stack count, and that keyring is then capable of opening doors with KeyDsts corresponding to the KeySrcs of the acquired keys.
The only issue I'm experiencing is that picking up a key doesn't reliably auto-select the keyring in inventory. The first key I pick up does, but subsequent keys do not. There is still a key pick-up noise, but the player then needs to scroll through the inventory to find the key ring.
Is this by design? Or is there something wrong with how I'm implementing the script? All-in-all, it's perfectly playable, but I'd rather have the keyring auto-select everytime a key is picked up.
trefoilknot on 15/3/2020 at 23:51
Still have the same issue---must be something I did in my hierarchy...
Nameless Voice on 16/3/2020 at 00:29
What exactly are you doing when you test this?
I tried:
1) Pick up first key, switch to compass, pick up second key.
2) Pick up first key, clear inventory, pick up second key.
3) Pick up first key, wait for it to time out, pick up second key.
In all three cases, it worked consistently with the new script module.
trefoilknot on 16/3/2020 at 00:40
This is odd, they do not act the same for me. See below:
Quote Posted by Nameless Voice
What exactly are you doing when you test this?
1) Pick up first key, switch to compass, pick up second key.
This works perfectly. From compass (or anything else in inventory), picking up the next key brings up the keyring in inventory.
Quote Posted by Nameless Voice
What exactly are you doing when you test this?
2) Pick up first key, clear inventory, pick up second key.
Same problem described above. Key pickup sounds play, and the keyring takes the new key (added to stackcount and the list of KeySrcs), but it does not bring up the keyring in inventory.
Quote Posted by Nameless Voice
What exactly are you doing when you test this?
3) Pick up first key, wait for it to time out, pick up second key.
Same problem as (2).
EDIT: The plot thickens---it also works perfectly if I pick up a key, then scroll through inventory, then clear it and pick up a next key. It seems is only breaks when both of the following hold: (a) there is currently nothing selected in inventory; and (b) the keyring was the last item selected in inventory.
john9818a on 16/3/2020 at 12:27
Does this problem happen with non-keyring objects too?
Have you tried to turn auto equip off and back on again?
trefoilknot on 16/3/2020 at 14:27
The problem does not occur for any other object (so far tested). Loot, flashbombs, keys which don't go on a keyring; they all work just fine.
Messing around with auto-select doesn't make a difference. I must have mucked something up on my end...
trefoilknot on 16/3/2020 at 16:09
For now, I'm content to just fake it. Is there a brute force way to call the keyring in inventory? I tried giving each key a the NVItemGiver script, and setting world frob to "Script" instead of "Move." Essentially, frobbing a key gives the key to the player. This works just as well as the current setup, but still fails to select the keyring in certain instances.
Is there a script like NVItemGiver which just forces a particular item to select in inventory?
Nameless Voice on 16/3/2020 at 16:52
You could try NVSelectTrap, which selects the item specified by the NVSelectTrapItem param upon activation.
Also, removing and re-adding the item from your inventory should do it (so long as auto-equip is enabled.)
trefoilknot on 16/3/2020 at 17:29
Having the key select itself doesn't work. Is there a way I can ascertain the object number for the keyring, itself? Does it have an object number?