I need to gain a reference for a specific item of the players choice, check for whether it is on the player or not a specific time, and run scripts off of it when it is dropped and picked up.
When using my script, I was able to control everything properly when creating a whole new object. However I want to be able to do all of the above to any lootable item that the player chooses. A helmet, an hourglass, a sword, or even a fork. I'll have to put some restrictions so that consumables can't be used, but that's more for later. The problem is I do not know how I can specifically acquire the reference of the item they choose.
When initially thinking up of how this would work, this was the process I came up with.
I first create a quest alias, that acquires it's reference using "Find Matching Reference From Event: Event Data akRef1". I can fill this reference using "SendStoryEvent(ObjectReference akRef1)"
Player casts a spell at a target. Upon hitting the target, if the target is an object (Not an actor or static object like a wall), it acquires a reference.
This reference is sent to a quest script using something like "QuestName.SendStoryEvent(ObjectReference akRef1Name)".
I now have a referencealias, which I will call RefAlias1, to use within my script. I can detect if the player is holding the item by using Game.GetPlayer().GetItemCount(RefAlias1.GetRef()) == 1. This will check if they are holding any of the objectreference. This is what I need to do. Cool.
Ok so now I need to check when the player drops the reference. Easy, I already have a reference alias that I can attach a script to. I won't go into the code there. Point is, with the reference alias, it's possible.
So, it looks like I can do everything I want to do. However, the biggest problem, is the spell. Spells do not affect objects, only actors.
How can I obtain an objectreference for a specific object?
