Spawn Random Actor /w table and different frequency
Hello there!
We´re new to Gamesalad and planing to make our first game, I guess we upgrade to the Pro Version soon.
But for now I have the following Problem:
At the moment I work with a "Spawner"-actor and a random number to spawn my actors in the scene. My Problem is
that I have a lot of different actors I want to spawn randomly and I would like to prefere to work with a table (or array?)
insteat of countless if/else conditions.
Another Problem: I would like to spawn some actors more often than other, I realy dont have any good idea for that atm.
Thanks for the help,
GameStock Studio
We´re new to Gamesalad and planing to make our first game, I guess we upgrade to the Pro Version soon.
But for now I have the following Problem:
At the moment I work with a "Spawner"-actor and a random number to spawn my actors in the scene. My Problem is
that I have a lot of different actors I want to spawn randomly and I would like to prefere to work with a table (or array?)
insteat of countless if/else conditions.
Another Problem: I would like to spawn some actors more often than other, I realy dont have any good idea for that atm.
Thanks for the help,
GameStock Studio
Comments
You'll need one rule for each table value that spawns an actor based on the chosen value.
As far as frequency goes, you could consider placing more of some values so that the odds are greater:
1
2
2
2
3
3
4
4
4
4
In the table above, actor 1 has a 10% chance of spawning, actor 2 has a 30% chance, etc.
Im not familar with tables yet but I´ll test it tomorrow and give some feedback - sounds good so far!
I kinda love working with tables, I also use it for other values now - great way to balance the game.
again thanks for the good and quick answer. Problem is solved.