Extra life prompter

ZombiebrainsZombiebrains www.zombiebrains.co.ukMember, PRO Posts: 296
edited November -1 in Working with GS (Mac)
Hiya folks

How do you do a extra life spawner so that its intelligent enough to release an extra life actor when a players life is getting low.

I've set up the spawner at off the top of the screen and I have my extra life actor.

I have a health bar like the one T-shirtbotth used in the shoot em up template (Works in steps of 20).

I would like it so when the health gets close to death, say 40 and below..to trigger the extra life spawner (I have called this actor - Sacred Orb Spawner) and the actor is called 'Spirit Orb'.

I could possibly do it so it spawns one if the life gets below 40 but this would always happen.

How do i add a bit of randomness to this so it doesn't always spawn one out.

Any clues?

It takes a Zombie to know a Zombie!!!

Comments

  • zombieaddictzombieaddict Member Posts: 213
    create an interger attribute named HealthRandom (or something) and make sure its set to 0 at the beginning of your levels

    Rule if attribute game.health = <41

    change attribute game.HealthRandom to [Insertfuction] Random (0,1)

    Rule if attribute game.HealthRandom = 1

    Spawn actor : Spirit Orb

    change attribute game.HealthRandom to 0

    tell me if that works or not. it might need an extra attribute to stop it from checking the rule constantly.
  • ZombiebrainsZombiebrains www.zombiebrains.co.ukMember, PRO Posts: 296
    Thanks Zombieaddict

    I'll implement that now and will let you know if it works ok.

    Thanks for you help!

    It takes a Zombie to know a Zombie!!!

  • ZombiebrainsZombiebrains www.zombiebrains.co.ukMember, PRO Posts: 296
    Hi Zombieaddict

    I managed to get that working a treat now...thanks for the input

    I have set it so when the health bar get to <4 (as 10 is the maximum) spawn the spirit orb

    If the player can touch the orb as it falls then they get to replenish the health bar to full (Set to 10)

    Works great is totally random which is good

    Thank you so much

    It takes a Zombie to know a Zombie!!!

  • zombieaddictzombieaddict Member Posts: 213
    thats good that it works :)
Sign In or Register to comment.