Carreau Posted December 19, 2017 Share Posted December 19, 2017 Iâve been racking my brain over how to set up an event to fire when a global is updated (this global is updated infrequently). I havenât found any information regarding variable changes firing events, so I may end up having to poll for a change when compared to a local (not ideal as I prefer interrupt style code). Am I missng something? TIA Link to comment Share on other sites More sharing options...
SKKmods Posted December 19, 2017 Share Posted December 19, 2017 Create a CustomEvent and subscribe to it Custom Papyrus Events Link to comment Share on other sites More sharing options...
Carreau Posted December 20, 2017 Author Share Posted December 20, 2017 Thanks SKK50. My mod is a plugin for another mod's master file (stupid me forgot to mention this as it is a pretty big piece of info). I'm tracking a global it updates, so unless I want to rewrite his code, I don't think I can fire off a custom event when the global is updated. I was hoping there was a method that could fire an event when a passed variable changes value. The good news is I did come up with a hacky work around. The situation I need to monitor the global changing value only occurs when the player is in a terminal menu housed through the pip boy. So registering for a menu open close event, and watching for a terminal close gives me the desired results. Yeah, it'll fire off on every terminal exit, but the script is pretty lightweight (updating array). In my instance, there aren't any downsides. Link to comment Share on other sites More sharing options...
Recommended Posts