Hey, i have a script that subscribes observers to all of my quests that are in the game, in order to update stuff like the Map etc. Currently they are setup to check on Dialogue end. Problem is, on each dialogue end i get a huge spike because of the Lua code running.
Is there a way around this ?`
https://www.pixelcrushers.com/phpbb/dow ... ew&id=5857
Observer Callback Garbage
Observer Callback Garbage
- Attachments
-
- Screenshot 2025-04-08 160735.png (262.16 KiB) Viewed 256 times
Re: Observer Callback Garbage
Yes, don't use observers.
They're handy, but by necessity they allocate memory when running Lua code.
Instead, if you want to monitor variable values, use Language.Lua.Assignment.VariableChanged as described in Monitor Variable Value Changes.
To monitor quest state changes, use an OnQuestStateChange() method (the easiest solution) or assign an override method to QuestLog.SetQuestStateOverride. In this method, you can call QuestLog.DefaultSetQuestState() and also do your own thing.

Instead, if you want to monitor variable values, use Language.Lua.Assignment.VariableChanged as described in Monitor Variable Value Changes.
To monitor quest state changes, use an OnQuestStateChange() method (the easiest solution) or assign an override method to QuestLog.SetQuestStateOverride. In this method, you can call QuestLog.DefaultSetQuestState() and also do your own thing.