I have a good amount of programming experience outside of Papyrus so I have a decent idea of what I want to do, just not how I want to do it: I'm looking to create a script/program/series of scripts that periodically increments a counter and causes the player to cast a spell upon reaching a threshold, resetting the counter to zero, and continuing. Certain basic items in player inventory will cause the counter to increment faster. What I have working so far: While it's not super pretty and I'm sure breaks a lot of modding convention, I set up a quest to start the script on a new game. It calls RegisterForSingleUpdate, and on the OnUpdate Event, It increments the counter and then calls for another update. What I haven't been able to get working: From what I can tell, I can't have this particular script check for items or cast spells because the script would have to extend ObjectReference for the former or something else I haven't researched for the latter. It currently extends Quest in order to run on game creation. Basically my code looks like this right now:
ScriptName Blah extends Quest
ObjectReference Property MountainFlower01Blue auto
Event OnInit()
RegisterForSingleUpdate(10)
EndEvent
Event OnUpdate()
Debug.Notification(Game.GetPlayer().GetItemCount(MountainFlower01Blue))
RegisterForSingleUpdate(10)
EndEvent
If I can do this, what am I doing wrong? Any solutions/tips would be appreciated. Will I need several scripts managing these things somehow? Is this possible in Papyrus? Have I just missed something glaringly obvious since it's 2am? :mellow: