populating scene

Hello World,

I am trying to create a "pick your character" and "pick your scene" function. Its easy enough to make certain actors trigger certain scenes, but what I want to do is have game salad remember both the scene and the actor and then populate said scene. Does anyone know how to do this?

thanks a bunch!
-Kamille

Answers

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited November 2013
    Sure. Create two game attributes called game.character and game.scene (although I'd be tempted to call it game.level since "scene" is already a built-in GameSalad term). These can be integers or text but for the sake of simplicity let's make them integers in this example.

    When your player chooses an actor and a level, change those game attributes to whatever values they should be (e.g. character 3 and level 1). Save both attributes to separate keys using the Save Attribute behavior. Then make a "Populate Scene" actor that sits off scene or is invisible (self.color.alpha=0) and give it the following rules:

    When [condition for when you want to load the character and level]
         Load attribute [character key] --> game.character
         Load attribute [level key] --> game.level
         
    When attribute game.level=1
         Timer after 0.1 seconds*
              Change Scene [level 1]

    Do this for each possible value of game.level

    In your character actor, add the following rule:

    When attribute game.character=1
         Change Image [image name]*
         etc.

    Do this for each possible value of game.character

    *The timer is there so that the change scene doesn't occur until the attributes have had a chance to load.
    **If your character actor is on the same scene as the Populate Scene actor, you will need a short timer here as well.

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

  • kamille88kamille88 Member Posts: 1
    thank you so much I will give it a try!
Sign In or Register to comment.