help for level count
Hi everybody,
I'm almost done with a new game that has several levels, and i'm ok with unlock levels from the lock icon to Level number while going on with levels. I've followed the cookbook templates about levels made by T-shirtBooth, but now I can't figure out how to keep records of levels. that's because I put a Change Attribute behavior into an Actor of every Scene that sets its own Level Number (example, while you're playing Level 3, that Actor sets game.LevelNr to 3, and so on). The problem is that if I am playing Level 14 (as an example) and I go back playing Level 1, game.LevelNr is being set to 1, and I won't be able to play any other level besides Level 1, because all the other levels will be Locked...
Hope my explanation is clear, I don't know what function I may apply to my game to keep records of Level numbers and be free to play any previous level without losing the new ones I just played.
thanks in advance for your help!
I'm almost done with a new game that has several levels, and i'm ok with unlock levels from the lock icon to Level number while going on with levels. I've followed the cookbook templates about levels made by T-shirtBooth, but now I can't figure out how to keep records of levels. that's because I put a Change Attribute behavior into an Actor of every Scene that sets its own Level Number (example, while you're playing Level 3, that Actor sets game.LevelNr to 3, and so on). The problem is that if I am playing Level 14 (as an example) and I go back playing Level 1, game.LevelNr is being set to 1, and I won't be able to play any other level besides Level 1, because all the other levels will be Locked...
Hope my explanation is clear, I don't know what function I may apply to my game to keep records of Level numbers and be free to play any previous level without losing the new ones I just played.
thanks in advance for your help!
Best Answers
-
simo103 Posts: 1,331
@francyfranchini ... you will need to put an extra rule in each level ... if Game.LevelNr is < the level number then change game.LevelNr to 1 or 2 etc -
MotherHoose Posts: 2,456
conflict/problem is in using the game.LevelNr to store two different states of gamePlay:
… levelUnlocked and currentLevel
need two gameAttributes to store those separate values
gameAttribute: index type … LevelNr (currentLevel)
gameAttribute: index type … unlockLevel (last/highest level unlocked)
on your controlActor: (name them with number of level … 1; 2; 3; etc.)
changeAttribute: game.LevelNr to self.name
when level is completed:
Rule: when
Attribute: game.unlockLevel = game.LevelNr
-changeAttribute: game.unlockLevel To: game.unlockLevel+1MH
-
MotherHoose Posts: 2,456
sorry … @francyfranchini
for when level is completed … rule in above should be
Rule: when
Attribute: game.unlockLevel = game.LevelNr
--changeAttribute: game.unlockLevel To: game.unlockLevel+1
so a level only unlocks when the player completes the current LevelNrMH
Answers
There an Actor into every scene that has a Change Attribute "game.LevelNr to 1, or 2 or 3", etc, it obviously depends by the level the Actor is in. This Actor shows the level number you're at. Then I put that Rule you told me into that Actor, but if I got back to Level 1 from level 3 or above and then i go to the Main Menu, this one shows me Level 1 unlocked and all the other levels locked again. This Main Menu is like T-ShirtBooth's Zombie Drop level menu, just to explain what I'm talking about.
Where am I wrong?
and how do I change "unlockLevel" value too?