Niborius on 7/4/2024 at 09:19
[Thief 2] This is a bit of a tough one to explain.
Basically: I know how to make it so that when you read a particular scroll from your inventory, it will give the player a key to his inventory. However, I have a scroll in my mission that is "shot" towards the player using an Emitter (I think they're called?). It spawns in a custom scroll object from the object hierarchy.
However, it appears that this scroll completely ignores the frob script. It reads the scroll just fine, but no key shows up. I tried to debug it and see if the scroll is sending a turnOn signal at all (made it change a quest var), but it does not.
I'm using the NVItemGiver script for this and it's supposed to give a key that is in the game world in an unacccessible room. Again, if I spawn the scroll in manually with the same script it does work.
Is there any workaround I can try? Thanks in advance!
R Soul on 7/4/2024 at 09:55
I recommend posting every single thing you've done for this setup. There are usually several ways of doing a particular thing, so posting exactly what you've tried will make it easier to see if you've missed something, or if a different approach is needed.
Niborius on 7/4/2024 at 13:41
I can't remember exactly all the things I've tried, but it all involved either the NvGiveItem or the TrigInvFrob script. I gave up when I realised it didnt matter what I tried because it appeared that the scripts wouldn't seem to run to begin with, I assume because they were set up in the Object Hierarchy (as in, saved in the .gam), and not in an item that is added as a child instance in the world, like you normally would.
If only I could create an instance of the scroll beforehand and teleport it to the location on a trigger, and make it have an initial speed upon teleporting, to mimic the effect that it's being thrown towards the player, like the emitter does.
I do apologize if I'm not making a lot of sense. Explaining an issue isn't my strongest suit and Dromed frustrations are getting to me :P
R Soul on 7/4/2024 at 15:57
Emitter traps can actually emit object instances, just be sure to assign a unique name, in this case to the scroll, and use that in the Emit What field of the EmitterTrap, along with suitable Velocity numbers.
There are times when it's much more convenient to stick with custom archetypes, so for that scenario you have to find a way to get around the tendency of scripts to only be aware of the concrete instance and the usual expectation that the links are also between concrete instances.
With something like NVItemGiver (and other NV scripts) you can set all sorts of parameters. By default this script needs a TurnOn message to activate it, but you can add this to the Design Note property for it to be turned on by beging frobbed in the inventory:
NVItemGiverOn="FrobInvEnd"
As you will see in the documentation, NVGiveWhat can refer to an archetype or a concrete instance. For any NV script that deals with links by default, you can usually use the design note to refer to a specific (named) object/archetype.
Niborius on 7/4/2024 at 17:23
R Soul, thank you so much.
So first of all one thing I noticed is that the key was linked to a guard with a CulpableFor link. I haven't worked on this mission for over 6 months so I completely forgot I did this back when I had different plans for this section of the mission. I removed the link, then changed the script to use "FrobInvEnd" like you suggested. This actually worked immediately. I was going to try to have it emit an instance of the scroll (I remember not getting that to work) but now that's not even necessary anymore.
Kinda ironic that (one of) my earliest topics in this forum is where I learned about the NVItemGiver script for the first time.
Anyway, thanks again for the help. So happy that the community is still alive. Looking forward to the day that this project of mine sees the light of day :)