Help? Adding New Respawn Actors..

PangitQuestPangitQuest Member Posts: 12
edited November -1 in Working with GS (Mac)
Hi, I have followed the tutorial at youtube by tshirtbooth, now I have 3 actors respawning w/ no problems, now I want to add a new one like for example at level 2 or at the score of 200, how can I do that or is it possible?..

I did already is

TImer: every 3 sec
Change Attribute: game.random to random (1,3) <- tshirt said if there are 10 it should be (1,10) so if I add 3 more should I put it at (1,6) already at the start?

then below is

Rule: attribute game.howmany < 50 <- so that my spawn will stop at 50
Timer: every 1 sec
Rule: attribute game.random = 1
Spawn Actor: 1
Timer: every 1 sec
Rule: attribute game.random = 2
Spawn Actor: 2
Timer: every 1 sec
Rule: attribute game.random = 3
Spawn Actor: 3

now I added more rules below, but at score 200 green will spawn, but more than 200 it will stop, then orange will spawn at 400 and stop again and so on...

Rule: attribute game.score = 200
Timer: every 1 sec
Rule: attribute game.random = 4
Spawn Actor: 4
Rule: attribute game.score = 400
Timer: every 1 sec
Rule: attribute game.random = 5
Spawn Actor: 5
Rule: attribute game.score = 200
Timer: every 1 sec
Rule: attribute game.random = 6
Spawn Actor: 6

I have tried to look at the example codes, search the forum but I could not find any answers, I also have the same problem with the place holder adding different spawn actors as well, thanks for the help..

Comments

  • entersimonentersimon Member, PRO Posts: 273
    From what I gather, your issue is that you want the new actors to spawn every second after you reach the score of 200, and then a new actor to be available after 400 points is achieved.

    The problem you're running into is that you are limiting your spawning capability to the exact score of 200 and 400. What you need to do is give the range between 200 and everything after 400.

    It's a simple fix.

    Rule (All): attribute game.score "greater than or equal to" 200
    and
    attribute game.score "less than" 400
    Timer: every 1 sec
    Rule: attribute game.random = 4
    Spawn Actor: 4

    Rule: attribute game.score "greater than or equal to" 400
    Timer: every 1 sec
    Rule: attribute game.random = 5
    Spawn Actor: 5

    Rule (All): attribute game.score "greater than or equal to" 200
    and
    attribute game.score "less than" 400
    Timer: every 1 sec
    Rule: attribute game.random = 6
    Spawn Actor: 6

    To make it a little clearer: You will need to add another condition for your "200 points" rule that says any time the score is anything between 200 and 399 will activate the innards of the rule. You also need to change the "400 points" rule so that it isn't "equals" and instead "greater than or equal to." Make sure that "All" is selected for the conditions in the rule.

    Best of luck!
  • PangitQuestPangitQuest Member Posts: 12
    thanks entersimon, I think I got it to work, also another question, if rather by score, should I make like an integer and name it "level" so like if level 2 "4" will spawn, level 3 then "5" will spawn and so on?..

    also if someone can help me with the place holders of that actors, coz I tried the "greater than or equal" but the actors are still invisible..

    the code I found was like this..

    change attribute self.random to random(1,6)

    Rule: Attribute self.random = 1
    Spawn Actor: PH1
    Destroy:

    Rule: Attribute self.random = 2
    Spawn Actor: PH2
    Destroy:

    Rule: Attribute self.random = 3
    Spawn Actor: PH3
    Destroy:

    that is working ok, but if I put the "random(1,6)" the place holder spawn-er will vanish, but "random(1,3)" is perfect, until I add this line..

    Rule: attribute game.score "greater or equal" 200
    Rule: attribute self.random = 4
    Spawn Actor: PH4
    Destroy:

    Rule: attribute game.score "greater or equal" 400
    Rule: attribute self.random = 5
    Spawn Actor: PH5
    Destroy:

    Rule: attribute game.score "greater or equal" 600
    Rule: attribute self.random = 6
    Spawn Actor: PH6
    Destroy:

    thanks for the help :)
  • PangitQuestPangitQuest Member Posts: 12
    Just going to bump my post, I am still having problems with my spawn actors..hehe

    this is they sample that I got and patterned my codes too..

    http://gamesalad.com/game/22255

    so I made it like this..

    Change Attribute: self.random to random(1,4)

    Rule: Attribute self.random = 1
    Spawn Actor: PH1
    Destroy:

    Rule: Attribute self.random = 2
    Spawn Actor: PH2
    Destroy:

    Rule: Attribute self.random = 3
    Spawn Actor: PH3
    Destroy:

    Rule: Attribute self.random = 4
    Spawn Actor: PH4
    Destroy:

    now I want to add more actors to spawn when it hit 200, what should I add so that more actors can spawn?

    at the shape/color actor the codes that I put are..

    Change Attribute self.x to self.Position.X

    Change Attribute self.y to self.Position.y

    Time: 10 sec
    Spawn Actor: PH Spawner
    self.x self.y
    Destroy:

    even when I put like..

    Rule: Attribute game.score "greater or equal to" 200

    Change Attribute: self.random to random(5,6)

    Rule: Attribute self.random = 5
    Spawn Actor: PH5
    Destroy:

    Rule: Attribute self.random = 6
    Spawn Actor: PH6
    Destroy:

    they will spawn but in a seperate spawn, rather than combine with my first spawner, also when they spawn they just stay there and could not be destroyed unlike the first line of codes..

    thanks for the help, I am still learning gamesalad, hope I can really learn hot to use this.. :)
Sign In or Register to comment.