Help with spawning

gunblazegunblaze Member Posts: 6
edited November -1 in Working with GS (Mac)
Hi. I'm really new at this..

Basically, I need help spawning actors after they are being destroyed by another actor on scene after they meet and when a button is pressed.

I have 3 actors,.. mainly actor 1, actor 2, and actor 2 spawn.

actor 2 mainly has behaviours for move, destroyed and change attribute for game monstercount=game monstercount -1 when rule: space key is pressed and attribute=position of actor 1.

actor 2 spawn then has behaviours for spawn actor 2 and change attribute for game monstercount=game monstercount +1 when rule: game monster attribute=0.

Now, the problem is that the game when previewed is only able to produced one actor 2 and once its destroyed, its stops spawning. Don't know why is this happening, any help wil be much appreciated.

Comments

  • OctappusOctappus Member Posts: 68
    Could be the order in which you list the behaviours and/or could be that actor 2 is destroyed before it can change monstercount.

    Perhaps you could put in a small delay before actor 2 is destroyed, so all the other behaviours can take place.

    When I have done something similar, however, I use the actor itself to spawn another actor before the 'destroy actor' behaviour. This means you have one less actor to worry about and fewer attributes to control.

    Hope this helps,

    Simon
    www.octappus.com
  • gunblazegunblaze Member Posts: 6
    Hi octappus, thanks for the reply.

    But i wouldn't be able to do it your way because i want my actor 2 to come out from underneath my actor 2 spawn for now.

    I tried delaying but once i added the timer in to over my rule, my actor 2 suddenly becomes indestructible, which is not what i had planned.

    But from what you mentioned about adding delays, i presume the actors behaviours all react concurrently and they don't loop back whenever there are changes in the game attributes or any movements otherwise. --Pls correct me here if i'm wrong.
  • OctappusOctappus Member Posts: 68
    gunblaze said:
    ... i presume the actors behaviours all react concurrently and they don't loop back whenever there are changes in the game attributes or any movements otherwise. --Pls correct me here if i'm wrong.

    I think behaviours occur consecutively, but sometimes I have an issue that makes me think otherwise.

    Someone more expert than me needs to answer this definitively - sorry.
Sign In or Register to comment.