GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Spawner Sequence?

FrostoloFrostolo Canary IslandsPosts: 21Member
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

Comments

  • quantumsheepquantumsheep Posts: 8,188Member
    In your spawner, have it pick a random variable - let's call it 'spawnrnd'

    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

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: http://www.quantum-sheep.com

  • FrostoloFrostolo Canary IslandsPosts: 21Member
    Thanks a lot. I will try this now :)
  • FrostoloFrostolo Canary IslandsPosts: 21Member
    Thanks, I tried but doesnt let me...

    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?
  • quantumsheepquantumsheep Posts: 8,188Member

    Thanks, I tried but doesnt let me...

    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?

    Not sure - I'm on a Mac! It sounds like you haven't defined an attribute yet. If so, read on!

    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

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: http://www.quantum-sheep.com

  • FrostoloFrostolo Canary IslandsPosts: 21Member
    It helped as I tried with "real" instead of "integer". That was one mistake I made. Now onto the second one:

    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.

  • FrostoloFrostolo Canary IslandsPosts: 21Member
    I got that to work! Needs some work but I think I got it, thanks!
  • FrostoloFrostolo Canary IslandsPosts: 21Member
    Hello, new problem: my character has an ability to accelerate if I press right, and decelerates when I stop pressing right, and I have an actor that is the camera placed way ahead of my hero so he stays on the left side. Thing is the camera doesnt follow the hero when he accelerate, eventually leaving the screen and the camera actor behind. An help?
  • FrostoloFrostolo Canary IslandsPosts: 21Member
    edited November 2013
    I share my endless project, I have another that is the epic one, this is to get used to GameSalad first. Here it is (yet unnamed)

    Edit: Cant upload a photo?
  • FrostoloFrostolo Canary IslandsPosts: 21Member
    edited November 2013
    image
  • FrostoloFrostolo Canary IslandsPosts: 21Member
    edited November 2013
    It is about to die in that screenshot, he likes dying :P
Sign In or Register to comment.