spawn an actor

How do I get an actor to spawn from my character selection screen to the first level?

Comments

  • UtopianGamesUtopianGames Member Posts: 5,692
    edited February 2013
    If you mean how do i select a character and have that character appear on the level you could have say 3 actors with heroes 1, 2 and 3 then simply have a game.integer and if they select hero 1 change the integer to 1 and so on then on your level scene you can delete the unused heroes by checking what number the integer is set to.

    Darren.
  • integr96integr96 Member Posts: 8
    So if I have character "A" and "B" to choose from on my character selection scene, I choose character "A". I go to level scene 1, which rule would I use so the correct character spawns?
  • UtopianGamesUtopianGames Member Posts: 5,692
    Made a quick demo for you.

    Darren.
  • integr96integr96 Member Posts: 8
    darren ... i am a newbie with this. is there any way you could do a detailed step by step of what to do with just 2 characters. i can provide my email address if that would make it easier.
  • UtopianGamesUtopianGames Member Posts: 5,692
    edited February 2013
    Simply delete the actors you don't want in the scenes.

    It was a quick demo so I reused one actor (which is good practise tbh), see the rules by double clicking the actors in the scene.

    Darren.
  • integr96integr96 Member Posts: 8
    i tried opening the .gsproj file you sent and there was no project in it. all i could see were the screenshots in the zip file.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    @integr96 If you're working in Windows Creator, you won't be able to open the file (unless you use this method: http://gshelper.com/?p=1655). But it's a very simple set up. On each hero actor on the selection screen, have the rule:

    When Touch is Pressed --> Change Attribute game.hero to 1 [or 2, or 3, or self.myNumber if you want to use an attribute].

    On the first level (or any level), in the hero actor, have the behavior (no rule) listed at the top of the rules area:

    When [attribute] game.hero=1 --> Change Image [and whatever other rules you want]
    When [attribute] game.hero=2 --> Change Image [and whatever other rules you want]
    When [attribute] game.hero=3 --> Change Image [and whatever other rules you want]

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

Sign In or Register to comment.