How do you spawn same actor in multiple locations, at various times...
JesusMyLove
Member Posts: 13
Hi everyone.
I've watched several videos and have done my research on spawning actors.
Over the past couple of weeks, I figured out how to spawn an actor exactly where I want him, move him, tap or
click him, have him explode with animation, destroy itself and add points to the score for doing so.
I'm now working on spawning the same actor in a different location at a different time, also
moving in a different direction. But I if I spawn the same actor using a different spawner it only
behaves the same as it's using the same behaviors.
All I've come up with so far is to create a new spawner and spawn a new actor with a different name, but with the SAME image.
But this of course would mean many spawners and actors using the same image as I intend on using
about 5 actors in a scene, that appear about 20 times each.
Does anyone know a more efficient way to spawn multiple instances of the same actor
with it's own behaviors?
Thanks everyone. And I'm very happy to be working with GameSalad
- Daniel
I've watched several videos and have done my research on spawning actors.
Over the past couple of weeks, I figured out how to spawn an actor exactly where I want him, move him, tap or
click him, have him explode with animation, destroy itself and add points to the score for doing so.
I'm now working on spawning the same actor in a different location at a different time, also
moving in a different direction. But I if I spawn the same actor using a different spawner it only
behaves the same as it's using the same behaviors.
All I've come up with so far is to create a new spawner and spawn a new actor with a different name, but with the SAME image.
But this of course would mean many spawners and actors using the same image as I intend on using
about 5 actors in a scene, that appear about 20 times each.
Does anyone know a more efficient way to spawn multiple instances of the same actor
with it's own behaviors?
Thanks everyone. And I'm very happy to be working with GameSalad
- Daniel
Best Answers
-
gyroscope I am here.Posts: 6,598
@JesusMyLove Hi Daniel
Welcome to the Forums and GSC. :-)
One way that I can think of (although not tested but I don't see why it shouldn't work) t spawn the same actor but each time this spawned actor has its own behaviours:
Make an integer attribute, let's call it SpawnCount. The following example is for different rules for 5 spawned, obviously change the numbers accordingly for more or less.
In the rules of the actor to be spawned:
Rule: When Spawncount < 5
Change Attribute SpawnCount to SpawnCount + 1
Otherwise
Change Attribute SpawnCount to 1
Rule: When SpawnCount = 1
---your particular behaviours
Rule: When SpawnCount = 2
---your particular behaviours
Rule: When SpawnCount = 3
---your particular behaviours
Rule: When SpawnCount = 4
---your particular behaviours
Rule: When SpawnCount = 5
---your particular behaviours
This spawns using the different sets of Rules in rotation, as you see. For specific orders, you'd need to involve a Table.""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
-
Socks London, UK.Posts: 12,822
I'm now working on spawning the same actor in a different location at a different time, also moving in a different direction.
Spawner . . . .
Every X seconds spawn Actor 1, X = random(0,1024), Y = random(0,768)
Actor 1 . . . .
Accelerate, direction random(0,360).
Answers
Thank you both for your quick responses