I haven't looked over your game yet to determine if this solution will work for you.
And guessing you have no variable holding the score.
Go on your text actor for the score, Add a "Draw Actor" event, then select script editor.
Now go on the button named "Variables" and not "Variables/functions", click Add, enter a name for this variable (Like
"ScoreHold", it cannot be the same as a function or an actor), and type in a save group (Like "Scores"). Now your variable is made and ready to hold a value!
- variable
Now you want it to keep track of your score... So in that script (That I suppose, and hopefully, you haven't closed) window, type in this:
- Code: Select all
ScoreHold=textNumber;
(Replace ScoreHold by whatever you have named your variable)
and click Add>Immediate action.
--
Now your variable is holding a value! yay!
but let's not celebrate yet.
You still haven't saved this poor little critter to be loaded in your next game.
Simply add a timer, that is about 1-4 seconds and make it infinite loop. Now whenever this timer will trigger, do this script
- Code: Select all
saveVars("score.scr", "Scores");
(Replace Scores by whatever you have named the variable group)
This will save your score to an external file. The usage of the timer is to simply crunch down the CPU needing in a general time-lime of the game.
--
Now this is pretty and all... but we need to load this variable into your world 2!
Create this same variable (Make sure everything is the same, save group and all)
and on the event "Create Actor", do this script:
- Code: Select all
loadVars("score.scr", "Scores");
textNumber=ScoreHold;
(Replace ScoreHold by whatever you have named your variable and replace Scores by whatever variable group you named)
--
That should be a quick and dirty way to save/load your variable and transfer your score to one game to another. Hope this helped!