Spawner Sequence?
Hello, I been reading the forum and making a game with all the info I gathered but one thing is frustrating me and if you guys could help me I can move forward
My problem is that I want to spawn actors in a sequence. I have different platforms with different abilities and I would like to spawn them from one actor one after the other in a somewhat random pattern on a fixed Y location. Like first comes the regular one, the then bouncy one and after the deadly one, repeat but random, and same for the 2 (plus the platform) enemies in another generator actor.
If it helps its a sideway endless runner where you jump from platform to platform while making quick decisions of how to approach the next one moving there and you are in a fixed location while the scenario is coming at you, the typical...
Please help me
My problem is that I want to spawn actors in a sequence. I have different platforms with different abilities and I would like to spawn them from one actor one after the other in a somewhat random pattern on a fixed Y location. Like first comes the regular one, the then bouncy one and after the deadly one, repeat but random, and same for the 2 (plus the platform) enemies in another generator actor.
If it helps its a sideway endless runner where you jump from platform to platform while making quick decisions of how to approach the next one moving there and you are in a fixed location while the scenario is coming at you, the typical...
Please help me
Comments
Every X seconds
Change attribute spawnrnd to random(1,3)
If spawnrnd = 1
Spawn 1st enemy
If spawnrnd = 2
Spawn 2nd enemy
If spawnrnd = 3
Spawn 3rd enemy
You could be a bit more fancy and use tables so that you have all the attributes needed for an enemy (size, speed, type etc) and just use a generic actor to read from the tables based on the random number.
Lots of ways to do it really!
QS =D
Rule
timer
change attribute
and here is it doesnt let me add an attribute. Its windows GameSalad if that matters.
How could I do it right?
Attributes are just a way of holding a value. e.g. for counting.
So, if I have one apple, and I make an attribute called 'number of apples' the value of 'number of apples' would be 1.
If I add another apple, the value of the 'number of apples' would = 2 etc etc.
What we're trying to do is change the value of an attribute using the 'change attribute' behaviour.
This means we have to define the attribute (spawnrnd as mentioned in my previous post).
To do this, on a Mac you select a scene, then on the left side are three tabs - actors/attributes/devices
Choose the attributes tab.
This is where we can add attributes to the game. They come in many forms, but we'll just use an integer (full number) type for this.
Find the '+' sign at the bottom of the tab that the attributes are displayed.
It'll ask you for a type of attribute - choose 'integer'.
You should now have a new attribute shown.
Click on it to rename it. Set its initial value to 0.
Now, back in your spawner, using the 'change attribute' behaviour, you should click on the leftmost box - use the '...' symbol and then click on 'game' - your attribute should be located there.
Click on it to choose it.
Then in the right hand box of the 'change attribute' behaviour, type in the value e.g. 1, 2 or 3.
Hope that helps, sorry if you know this stuff already but I have no way of knowing!
QS =D
GameSalad doesnt let me do this:
Timer
Change Attribute
Attribute
Spawn Actor
I have to do this:
Timer
Change Attribute
new Rule -
Attribute
Spawn Actor
Rule-attribute-spawn actor
and so on for the 2 remaining actors.
The game just doesnt let me do that in the order you tell me to and it doesnt work my way... everything else is in place but this.
Thanks a ton by the way, real-integer helped a lot.
Edit: Cant upload a photo?