Need a bit of help with Load/Save
TouchTiltGames
Member Posts: 1,162
Banging my head over this one!
I've got 3 Worlds with 10 levels in each. The player can play any level but must play all 10 in order to unlock World 2, World 3.
I've got the Load/Save attribute setup properly so that each level is checked off if you beat it. But I can't seem to get the 2nd and 3rd World to unlock properly. Sometimes it works and sometimes it doesn't...I think I'm missing something. Here's what I have:
WORLD 1 LEVEL 1 (hidden actor on level screen)
game.level1 to 1 (to check the level was beat and place a graphic over the completed level in the menu)
game.world1 to game.world1 +1
Save: game.level1 key: level1ok
Save: game.world1 key: world1ok
WORLD SELECT SCREEN
WORLD 2 (button)
if game.world1 = 10
change scene - levelselect 2
Load key: world1ok - Attribute game.world1
---------
That's it really. Another question is where must one place the load and save attributes to work properly? I read that the load must be placed on the very first screen? I did try that and the above still didnt work for unlocking the other Worlds.
Appreciate the help.
I've got 3 Worlds with 10 levels in each. The player can play any level but must play all 10 in order to unlock World 2, World 3.
I've got the Load/Save attribute setup properly so that each level is checked off if you beat it. But I can't seem to get the 2nd and 3rd World to unlock properly. Sometimes it works and sometimes it doesn't...I think I'm missing something. Here's what I have:
WORLD 1 LEVEL 1 (hidden actor on level screen)
game.level1 to 1 (to check the level was beat and place a graphic over the completed level in the menu)
game.world1 to game.world1 +1
Save: game.level1 key: level1ok
Save: game.world1 key: world1ok
WORLD SELECT SCREEN
WORLD 2 (button)
if game.world1 = 10
change scene - levelselect 2
Load key: world1ok - Attribute game.world1
---------
That's it really. Another question is where must one place the load and save attributes to work properly? I read that the load must be placed on the very first screen? I did try that and the above still didnt work for unlocking the other Worlds.
Appreciate the help.
Comments
Nah I don't have anything stopping it yet or nothing from keeping it from continually adding...could that be why sometimes it works?
When using display text, do you just throw that in with the load attribute?
For level 1
if game.world1 is less than 1
game.world1+1
That way playing level 1 over and over doesn't unlock what you want to be locked and then when they get to level 10 it wont add any more to game.world1 so world 2 should stay unlocked.
Then if you want to be safe set world 2 to be unlocked as long as game.world1 is greater than 10
You should just be able to put display text in your invisible actor and then click on the little e and select the attribute your wanting. I've never used it for that but it has an expression builder and i have seen others use it for that purpose.
I had it working before where I tested it so as to beat two levels in World 1, it would unlock World 2, then I'd go play more or navigate to other screens and then the World would be locked again.
So this could be because of what you described above....
Perhaps I don't have the load attribute in the right place? I have it on the World Select Screen, which isn't the first screen you see when you start the game and isn't the first screen you see if you change levels from the level you are on...Could that affect it?
Frustrating cause this is it before I publish my first game
if game.world1 is less than 1
game.world1+1
in addition to:
game.world1 to game.world1 +1 that lives in the other Rule?
if game.level1=0
then game.world1+1
It's a little different then what i was thinking because you have all levels available in any order. They way i said the first time would be if you are unlocking levels as you go.
if game.level1=0
then game.world1+1
then it unlocks the world but doesn't place a check graphic over the level.
If I use
if game.level1=1
then game.world1+1
then it locks the world and keeps the check graphic lol.
How does game.level1 get changed to 1. I'm assuming you start each level at 0 then when its beat it changes to 1 when you do that you will also have to run a check at each level to make sure that doesn't go above 1
I would say theres a combination of all of it you will need to implement.
They will all have to be setup on the correct actors too.
When the level is complete
if game.level=0
and game.world=0
then game.level+1
and game.world+1
Bumps is setup with world that unlock as you go so it's definitely doable.
It's just gonna take some tweaking. Also if any of your actor instances are unlocked throughout the game the rules wont update when you change the prototypes. That may also be a very tedious thing you need to check
Tshirtbooth - Your simplified method works and even doesn't allow the player to play a level 10 times in order to unlock World 2 so that's great. ONLY problem I'm having now is that when I unlock World 2 and start navigating around the different menu screens and go back to the World Select screen, World 2 is locked again So somehow it's forgetting that I unlocked it.
I've got the load for checking that a level is complete (and places a checkmark) on each level itself and the save for this on each level's instance actor.
Just having troubles saving the World state. I've got the Load World on the first screen...but where to put the Save?
I've got your constrain attribute on the World screen...I guess it doesnt matter where that goes...
constrain game.world1total to game.level1+game.level2+game.level3+game.level4 and so on
save if I use:
game.World1 Key: game.World1ok
and
load: game.World1ok to game.World1
?
Hey did you do the graphics for the game yourself?
If so and you have any interest in helping me with a few graphics email me
tenrdrmer(at)yahoo.com
Ive done most of my graphics but a couple i just cant get to look good and cant seem to find anyone with even any ideas of what it needs.