Randomly placing Actors

Hello!

I have 4 groups of 4 different kinds of actors to place. Every group has to have 1 actor of each kind o actors. For example:
Group 1: Green, Red, Yellow and Blue.
Group 2: Red, Yello, Blue and Green.
... so on

I want to start a Scene placing these actors together in a random order.

Any ideas to do this?

I first thought about using a Table. But how to pick and place this actor?

Thank you!

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    The way you pick random selections without repeating is to place possible values in rows:

    Green
    Red
    Yellow
    Blue

    And then choose a random row:
    Change attribute self.row (integer) to random(1,tableRowCount(tableName))

    Delete the table row at index self.row

    Use self.row in a rule that spawns an actor depending on the value of that attribute.

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

  • henriquesvhenriquesv Member Posts: 18

    Thanks!
    I will try and let you know!

  • henriquesvhenriquesv Member Posts: 18

    Working fine!

Sign In or Register to comment.