1
Development / how do you save a number?
« on: March 29, 2020, 11:21:12 am »
I've made a little script/ fishing game where your fish wins you prizes...everything works fine until i save and reopen the file...its basically:
now if i move maps and come back in it all works fine...but if i save the game and return...the value of "win" is set back to nil, how do i get the value of win to save?
or do i need to make save variables for each outcome..ie
and then write out a dialog for each outcome?
Code: [Select]
if size <= 6 then
blah
elseif size >
win = size
size reset to 0
and then theres a seperate npc with a dialog stating the win number:-Code: [Select]
game:start_dialog("fisherman.young.talk.weight.tank", win, function()
now if i move maps and come back in it all works fine...but if i save the game and return...the value of "win" is set back to nil, how do i get the value of win to save?
or do i need to make save variables for each outcome..ie
Code: [Select]
if win = 1 then
game:set_value("win_is_1", true)
else if win 2 then.....
and then write out a dialog for each outcome?