Random Generator

So imagine that i have 6 random spawners on top of my screen, and i manage to make them randomly spawn, but i want one of the spawners and only one to spawn nothing randomly, how can i do this?

Basically i want 5 of the 6 spawners to spawn something every second , and 1 of them to spawn nothing every time the others spawn something, this one is chosen randomly each 1 second also.

Sorry if I was too confuse, tyvm in advance

Comments

  • HopscotchHopscotch Member, PRO Posts: 2,782

    @Elgondir, rather control all the spawning from one actor.
    In this actor you can then spawn the 5 actors at once, deciding which lane not to use.

    e.g.

    self.EmptyLane = random(1,6)

    rule if self.EmptyLane is not 1 then spawn in lane 1

    rule if self.EmptyLane is not 2 then spawn in lane 2

    ect.

  • SocksSocks London, UK.Member Posts: 12,822
    edited July 2014

    6 actors - and 1 controller actor.

    . . . . .

    The controller changes a game attribute (let's call it X) to a random number between 1 and 6.

    . . . . .

    In the 6 spawners (named 1,2,3,4,5 and 6)

    Rule - if X = name then . . . (left blank - i.e. do nothing)
    Otherwise spawn whatever it is you want them to spawn.

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

    Try my demo that spawns 3 of 4 possible locations.

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

  • ElgondirElgondir Member Posts: 4

    @tatiang said:
    Try my demo that spawns 3 of 4 possible locations.

    wow that is perfect, but 2 other questions if you don't mind.

    1- that demo is great still it starts spawning a little bellow the top of the screen, how can i make it spawn from the top.
    2- u only used 1 obstacle for the 4 spawners, how do i use diferent obstacles for the spawners but getting the same results?

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

    The spawn actor behaviors use table cell values to determine the position of the actors. If you look at the positions table, you'll see that the Y value is the 2nd column. Just change the values in that column.

    Try changing the actor name in the spawn actor behavior to make it spawn different actors.

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

Sign In or Register to comment.