Randomizing Levels

NMansellNMansell Member Posts: 143
edited May 2012 in Working with GS (Mac)
I want to be able to Random the levels/scenes that load in my game - I have an attibute that sets the maximum number of levels be it a Quick game (5 levels) and a Long Game (20 levels). This attribute works fine but I want to make each game different by having it load random levels and not repeating them - can I do this by using Tables in any way or coding?

I know I could use %2 for 2 different options when using an integar but how do I link this to different unrepeated levels per game?

Any help would be much appreciated.

Thanks.

Answers

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Check this out (you can also download the free template):

    http://gshelper.com/random-scene-generator-gamesalad-video-tutorial/

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • NMansellNMansell Member Posts: 143
    thanks I will check this out and let you know. much appreciated.
  • NMansellNMansell Member Posts: 143
    right i have added this into my game now and it seems to work, so much appreciated.
    but i have one problem - my click to continue is another actor that appears in the midde of the screen afterwards so i cannot set the 'what scene am i'?
    Unless I make this actor multiple times for each scene which I don't really want to do.

    can i set this within the code, so change attribute, would that work?
  • NMansellNMansell Member Posts: 143
    tried that, didn't work as its still linked to theone actor grrrr :(
    maybe there is a workaround such as creating a game attribute which is set per level and then changing the what scene am i attribute based on this game - a bit of extra coding but only needs to be done once :)

    Comments welcome!
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    It's a @tshirtbooth video so he might have some insights for you.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • NMansellNMansell Member Posts: 143
    @tshirtbooth - any suggestions please?
  • NMansellNMansell Member Posts: 143
    right 9.93 is out but what how do I use save tables?

    Also, anyone know how to import now into the Windows version? I can edit better using my windows machine rather than my Mac :) and then save back into the mac :)
  • NMansellNMansell Member Posts: 143
    @tshirtbooth you say writable tables would be better - now they are out in the latest version would it just be a case to write the config to the tables and read from this? Eliminating the need for attributes?
  • EatingMyHatEatingMyHat Member Posts: 1,246
    right 9.93 is out but what how do I use save tables?
    There is a Save Table behavior.
  • NMansellNMansell Member Posts: 143
    @eatingmyhat - thanks i know but would it just be a case to write the config to the tables and then reading from this? Eliminating the need for game attributes?
  • EatingMyHatEatingMyHat Member Posts: 1,246
    I think that there are good use cases for using tables with save/load and using attributes. If you are managing a big set of attributes which need to be loaded and saved together, go with a table. If it is a single item, attribute will be just as good.

    Working with attributes is still not identical to working with tables, as an example, in expression and rules only attributes can be on the left side.
  • NMansellNMansell Member Posts: 143
    i am having probs using load and save attribute - can iut be done in the same session?

    So I set the volume level to say .5 in options, it saves the attribute and when I start the game it loads the vollevel attribute, etc I use it for lives and timer (difficulty) as well.
Sign In or Register to comment.