• Content count

  • Joined

  • Last visited

  1. Are Persistent Variables Possible?

    Thank you both so much, this is exactly what I had needed. Originally, I wasn't sure why my global variables weren't behaving that way, but later discovered that's because of a design error that was resetting those variables. I've since fixed that. Extra kudos to nater for bringing ModData to my attention, as I didn't know doing that was a possibility and I do need these values to persist across save/load.
  2. Are Persistent Variables Possible?

    Is it possible to declare variables in a lua script that will persistent beyond the lifetime of the function and into further instances? In other words, if I have a script that's called by Events.OnPlayerUpdate.Add(), can I declare a variable that will retain it's value and be used in future instances of that script being triggered by Events.OnPlayerUpdate.Add()? What I want in the end is the ability to store a value that will increment each time that function runs, but the problem I'm having is that the variable appears to get dropped and thus never actually increments. I'm not sure if what I'm looking for is possible or not though