Tables, and spawning - need help
Hi!
I have 6 different actors - I want them to spawn inside a level, based on the numbers inside a table.
I have a table called "Elements", it contains 10 columns - one for each level, and 6 rows - one for each actor.
All of values are Integers, and numbers inside each cell are numbers - how many actors of this type I want inside each level.
So it looks like this:
Level1
Actor1 0
Actor2 2
Actor3 1
Actor4 0
Actor5 5
Actor6 1
So inside the first level I want 0 Actor1, 2 Actors2, etc. Now how to make a rule which would spawn the right number of each actor inside scene?
Just to be clear - I make all levels inside one scene, so this is why I use tables.
Thank you!
I have 6 different actors - I want them to spawn inside a level, based on the numbers inside a table.
I have a table called "Elements", it contains 10 columns - one for each level, and 6 rows - one for each actor.
All of values are Integers, and numbers inside each cell are numbers - how many actors of this type I want inside each level.
So it looks like this:
Level1
Actor1 0
Actor2 2
Actor3 1
Actor4 0
Actor5 5
Actor6 1
So inside the first level I want 0 Actor1, 2 Actors2, etc. Now how to make a rule which would spawn the right number of each actor inside scene?
Just to be clear - I make all levels inside one scene, so this is why I use tables.
Thank you!
Best Answer
-
NovicaStudio Posts: 174
This would be so much easier if they had in spawn actor the amount you wanted to spawn.
Answers
It doesn't have to be Spawn behavior, it can be any way, to make actors appear, based on the numbers in tables.
If anyone needs something like this, here it is:
I have a new actor - I called it Spawner. It has 6 integer attributes inside him (each for each row in a table). At the beginning of the scene it changes each of these attributes to the appropriate value from a table.
Then there's a rule (for each attribute):
If self.1 is bigger than 0
Timer, every 1 sec
Spawn actor 1
Change attribute self.1 to self.1-1