I've been poking around on the forums here, learning how to serialize variables I'll need to use across sessions. I found an example in another thread which seemed to do exactly what I needed, but I get a runtime error trying to duplicate it.
I created this simple alias to play around with and try and get this to work. Here's the current alias and the error I'm getting.
function setvar()
luaenemies = {billy, bob}
require "serialize"
SetVariable("enemylist", serialize('luaenemies'))
end
And the error...
Run-time error
Plugin: LidSys (called from world: Achaea)
Function/Sub: setvar called by alias
Reason: processing alias ""
...\worlds\plugins\MyAchaea\modules\scripts\enemies.lua:26: attempt to call global 'serialize' (a table value)
stack traceback:
...\worlds\plugins\MyAchaea\modules\scripts\enemies.lua:26: in function <...\worlds\plugins\MyAchaea\modules\scripts\enemies.lua:21>
Any ideas why this won't work for me?
I created this simple alias to play around with and try and get this to work. Here's the current alias and the error I'm getting.
function setvar()
luaenemies = {billy, bob}
require "serialize"
SetVariable("enemylist", serialize('luaenemies'))
end
And the error...
Run-time error
Plugin: LidSys (called from world: Achaea)
Function/Sub: setvar called by alias
Reason: processing alias ""
...\worlds\plugins\MyAchaea\modules\scripts\enemies.lua:26: attempt to call global 'serialize' (a table value)
stack traceback:
...\worlds\plugins\MyAchaea\modules\scripts\enemies.lua:26: in function <...\worlds\plugins\MyAchaea\modules\scripts\enemies.lua:21>
Any ideas why this won't work for me?