Spawn Set Up, random system.

GuaveMediaGuaveMedia Member, PRO Posts: 1,262
Hey guys,

I am working on a couple of new things and I've got a question. What I am trying to do is spawning actors under conditions.
So I want actors to be spawned from all sides of the scene. Then I'd like to have a certain amount spawned, I want to change that in game also afterwards. What would be the best way to make that work? Like, let's say 20 actors, 4 from each side in certain time distances.

Thanks so much for the help :)

Comments

  • beefy_clyrobeefy_clyro Member Posts: 5,394
    You'll need to setup some attributes to count whats going on. Theres 2 ways, 1 spawner spawning all 4 corners or have a spawner in each corner (simplest way and wont make much difference on performance).

    I would have 4 game attributes;

    TopLeftCount
    BottomLeftCount
    TopRightCount
    BottomRightCount

    Create TopLeft spawner and have following rules;

    If topleftcount < 6
    every random(5,15) adjust numbers to suit.
    spawn .... (set x and y co-ordinates to suit)

    I would then do this for each of the 4 spawners.

    You then need to have a change attribute in the actors you are spawning to tell it to increase the relevant game attribute.

    When that actor is about to be destroyed, before you do this, make sure that you change attribute to take 1 away from the relevant game attribute.

    IF you want to change these values during gameplay then you need to pretty much duplicate these rules but add more conditions.

    i.e. If topleftcount < 6 and score > 100
    every random(3,10) adjust numbers to suit.
    spawn .... (set x and y co-ordinates to suit)

    etc etc

    Hopefully that gives you 1 idea as to how you could approach it.
Sign In or Register to comment.