Please help me, I’m going to crazy. I found a lot of post regarding random placement of the same object, instead I need to do the opposite.
In the same place every 10 second I need to create a random enemy chosing it from a group of 1o different enemies.
What I would do is:
Name each enemy the same with a different number at the end:
enemy1
enemy2
enemy3
…etc
Add each enemy to the same group.
Every 10 second, create an enemy object from it name and for number at the end use a random number like so:
“enemy” + ToString(Random(10))
This way you can pick a random object from the group and create it.
Just want to add another option, in case you don’t want to name every enemy as “enemyX”. You can create a structure as:
Enemies
0: "Skeleton"
1: "Orc"
2: "Witch"
Then you can: generate random number >> access the child from the random number >> create object from name, with the name from the child, as:
Create object named VariableString(Enemies[ToString(Random(2))]) at X;Y
Where
VariableString( Enemies[ ToString(Random(2)) ] )
returns a random enemy name.
This way the structure is like a map, maybe a bit overcomplex, but as I said, just want to add another option