Tshirtbooth Health bar project question - Change colour?

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

I have successfully added the good old health bar from this video and copied his example and make the colour green and it works a treat!

My question is...

Is there a way to change the colour to different colours at different value as the health bar drops.

I would like it so that it starts purple (Easy -Set on the actor as purple) but as it drops 20 units the colour changes to a different colour.

How could I do this...any clues. Been trying for a few hours now and no joy

Thanks

It takes a Zombie to know a Zombie!!!

Comments

  • ZombiebrainsZombiebrains www.zombiebrains.co.ukMember, PRO Posts: 296
    I'm trying to get the colour to change when the value of the health bar is less than 40...so

    what i've do is a rule

    attribute - game.health <40

    change attribute -game.health / to self.colour.red

    nothing happens when I do this, the bar still shows green when it drops below 40...

    Any clues?

    It takes a Zombie to know a Zombie!!!

  • calvin9403calvin9403 Member Posts: 3,186
    no, change the actor self.color to whatever
  • ZombiebrainsZombiebrains www.zombiebrains.co.ukMember, PRO Posts: 296
    Sorry Calvin, not sure where I do that?

    It takes a Zombie to know a Zombie!!!

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Hey there,

    First off you need to change the self color attributes. Next ,Gamesalad uses rgb color. Which means if you want to change the color, mostly all the time youll have to change all the color attributes, since its a mix of red, green, and blue. So in your case this is what you want to do:

    Go into the actual health bar actor. Make a rule when attribute game.health is < 40
    then put a change attribute behavior. Where u select the attribute in the drop down at the bottom youll see the name of the actor your in, thats where u get self attributes. So click that then go to color, red and change it to 1.

    Next have another change attribute behavior and change attribute self color blue to 0

    then finally have another change attribute behavior and change attribute self color green to 0
  • ZombiebrainsZombiebrains www.zombiebrains.co.ukMember, PRO Posts: 296
    Thanks John, that's superb!

    It takes a Zombie to know a Zombie!!!

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    There is a template somewhere that expresses this very well. I'll see if i can't find it and email it to you.
  • ZombiebrainsZombiebrains www.zombiebrains.co.ukMember, PRO Posts: 296
    Thanks Braydon, that would be superb

    Cheers mate.

    It takes a Zombie to know a Zombie!!!

  • ZombiebrainsZombiebrains www.zombiebrains.co.ukMember, PRO Posts: 296
    John, could you tell me how the last bit would look...

    is it self.color.red=1 or self.color.red.1 asi can't get it to work?

    It takes a Zombie to know a Zombie!!!

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    change attribute self color red, then put a 1 in the 2nd box where u put the value
  • ZombiebrainsZombiebrains www.zombiebrains.co.ukMember, PRO Posts: 296
    ok, i've done that but now when I preview the whole bar turns from green to red?

    What I have is an attribute where the health bar is set at 10, just like in the tshirtbooth video. I've basically copied all the same stuff but changing the 'attribute' of game.health <40 doesn't seem to change anything?>

    Any idea John?

    It takes a Zombie to know a Zombie!!!

  • ZombiebrainsZombiebrains www.zombiebrains.co.ukMember, PRO Posts: 296
    Can I send you a screenshot of what I have and maybe you can see where I've gone wrong?

    It takes a Zombie to know a Zombie!!!

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    yeah post a screenshot
  • ZombiebrainsZombiebrains www.zombiebrains.co.ukMember, PRO Posts: 296
    Sorry, how do I do that? sorry complete newbie dumb head! lol

    It takes a Zombie to know a Zombie!!!

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    http://gamesalad.com/forums/topic.php?id=33

    Look at the second to last post on that thread.
  • ZombiebrainsZombiebrains www.zombiebrains.co.ukMember, PRO Posts: 296
    ok, here goes

    image

    That didn't work...damn

    John can you PM me your email address and i'll email it to you

    It takes a Zombie to know a Zombie!!!

Sign In or Register to comment.