Trouble spawning 50 actors at once
I would like to spawn 50 actors to the a random location at the bigging of the level. Here is what I have done
Rule - if number of actors is < 50
Timer - 0.001 seconds
Spawn actor
Location = random.
The problem is that they do not all spawn at once. They take time.
Has anybody done this before. I have searched the forums but I didn't really find anything like this.
Thanks in advance
Rule - if number of actors is < 50
Timer - 0.001 seconds
Spawn actor
Location = random.
The problem is that they do not all spawn at once. They take time.
Has anybody done this before. I have searched the forums but I didn't really find anything like this.
Thanks in advance

Comments
If you even menage to do that, it will definitely kill your game at that point, even on an iPhone4.
But if you insist, you could try having 50 different actors and make them spawn 1 actor, triggered at the same time. Maybe than it is possible, but, still I don't think so.
I just created a simple demo to test it out.. works fine for me.
Create game attribute - game.spawn (integer)
Ball Actor (not sure what your actor is)
Change Attribute: game.spawn To: game.spawn+1
Change Velocity: Direction: random(0,360), Speed: random(20,150)
Collide with wall actor
Spawn Actor Button (not sure how you're wanting to spawn)
Rule--- Actor receives Touch
--- Attribute: game.spawn is = or less then 50
Timer:
Every .01 seconds (run to completion)
Spawn Actor: Ball
Wall Actor
just put 4 walls up around scene with moveable unchecked.
If i hold down the spawn button bam.. 50 balls come out..
but again- if your spawn actors have tons of rules in them, etc. it could definitely
be a performance problem i'm thinking like the others have stated.
Just setup at the top of all these objects you plan to spawn a change attribute for the x and y position to be random in a set range and place them in the scene off screen. it will give the same look and save you some memory and frame rate loss. Also depending on what else is in the scene your 50 actors along could cause issues and then adding other actors in with their own rules will bog things down as well.
Good Luck
___________________________________________________________________________________
TEMPLATES AND PROJECT HELP BY TENRDRMER. CLICK HERE!!!
AppSolute Entertainment on Facebook
AppSolute Entertainment on iTunes
1) Make your timer a lot longer. If the actors are spawning out of the camera range then why have them all at once?
2) If you need them all at once on the camera scene, you can do a faux pre-load by making them super small and hide them in the corner. Then change their x/y variable and size when the event is triggered.
3) You can also change the visible variable in spawnedactor.graphics.
Other than that need more info on exactly what you want to make happen in the game.
Instead of making the levels by hand I want to generate them.
This should give the effect you are looking for and still good performance.
Ive been prototyping this idea all day. I decided to do most of the levels by hand. This way load times are easier and it gives a 'levels' vibe. Im debating using this technique for a 'sandbox' mode. Ill probably do it
Thanks for all of your help