Level Lock tutorial video?

THRSTNTHRSTN Member Posts: 178
edited November -1 in Working with GS (Mac)
Hi all I'm having some trouble getting the levels locking in the game I'm working on.I've followed a couple of the tutorials that I've found on here and still cant seem to get it to work. I was wondering if anyone has done a video tutorial on this yet?I've also Downloaded a couple of demos but for some reason still cant get the darn thing to unlock once the player has gone thru the level.

1.I have two attributes declared LastLevelPlayed and HighestLevelPlayed both integers set to 1

2.I have Two actors "TrackLevel" and "LoadLevel"

3.inside the track actor i have
Change Attribute to game.LastLevelPlayed to scene.Name
Save attibute game.LastLevelPlayed to Key:lastplayed
then a rule
When All
attribute game.LastLevelPlayed > game.HighestLevelPlayed

Change Attribute game.HighestLevelPlayed to game.LastLevelPlayed

Save Attribute game.HighestLevelPlayed to key: currentlevel

4.Inside the LoadLevels actor i have

Load Attribute
key:highestlevel Attribute game.HighesdtLevelPlayed

5.I have LoadLevels inside of my scene selection scene

and tracklevel inside of my levels

6.i have one blank actor as the Levels themselves and use the show text to label them individually
inside of them i have (example of Level 2)

Rule
When All conditions are valid
attribute game.HighestLevelPlayed >2
then Rule
Actor Receives touch Change scene to level 2

otherwise

Spawn Actor
actor Locked in front of actor

ive gotta be missing something and if someone knows of a video tutorial (maybe tshirt booth if you've got some spare time) that would be awesome.

Thanks
THRSTN

Comments

  • peachpellenpeachpellen Member Posts: 977
    I plan on doing level unlocks too in the future and while I'm fairly confident I can do it without any help, I'd love it if a tutorial were available in case I too run into issues.

    /bump ;)
  • THRSTNTHRSTN Member Posts: 178
    CAN I GET AN AMEN

    (amen)
  • UtopianGamesUtopianGames Member Posts: 5,692
    To open up level 2 after you complete level 1...

    Make a global boolean attribute called level2 (or whatever you want).

    When you complete level 1change level2 to true and save the boolean as level2unlocked.

    Have a controller on your level select screen that loads the level2unlocked.

    On the level select screen on the level 2 actor do if touch is pressed and level2unlocked=true change scene to level 2 and so on and so on.

    If you have awards or medals you will have to use an integer but it's the same method as above.

    One thing to remember if you doing medals, gold silver bronze for eg is to only save if they get a better medal as you don't want to earn a silver one time then go back replay level and end up with bronze.

    Darren.
  • THRSTNTHRSTN Member Posts: 178
    awesome man cant wait to get home and try this out thanks so much
  • RHRH Member Posts: 1,079
    UtopianGames method is great, but if you want to use minimal attributes I'd recommend using an integer and greater than or = to rules.

    I rustled this up quickly if you're interested. http://gamesalad.com/game/play/82738

    P.S. I know it's not a video, but it's really simple.
  • UtopianGamesUtopianGames Member Posts: 5,692
    Nice one RH :)

    Darren.
  • RHRH Member Posts: 1,079
    Ta! :)
  • THRSTNTHRSTN Member Posts: 178
    thanks for the demo but im not sure what im doing wrong ive tried it both ways now and still cant get it to work for me.the locks are on but wont go away after i clear the level.just frustrated and stepping away to try and clear my mind and come back and try again later.
  • RHRH Member Posts: 1,079
    What determines the end of a level? Is it a certain amount of coins being collected or a finish line (for example)?

    Either way, if it is something that the character (I'm assuming you have a character or something similar) interacts with to complete the level you could use a simple rule (the values would have to be changed in the instance on each level scene).

    `
    When actor overlaps or collides with actor of type character
    + When attribute game.levels complete is < (value of current level, i.e. 6)

    - change attribute game.levelsunlocked to (value of current level)
    `
    If the character doesn't interact with anything you could just create a game settings actor (or put the rule on a common actor). For example if you need to collect a certain amount of coins you could use a rule like:

    `
    When attribute game.coins >= 10
    + When attribute game.levels complete is < (value of current level, i.e. 6)

    - change attribute game.levelsunlocked to (value of current level)
    `
    Hope you get it sorted.
  • THRSTNTHRSTN Member Posts: 178
    THAT DID IT!! thanks so much for your help guys ive been racking my brain all day on this . Thanks so much.

    THRSTN
  • RHRH Member Posts: 1,079
    Glad it worked out!
Sign In or Register to comment.