Hit Points problem!

FungoEntertainmentFungoEntertainment Member Posts: 36
edited November -1 in Working with GS (Mac)
Hey!

I was working on my brand new game when I felt the need to make a boss monster. Unlike other enemies, boss actors require more shots to be taken down. That's when my problem appeared: "How do I make a "Boss" actor have more hit points?"

-Thanks!

Comments

  • butterbeanbutterbean Member Posts: 4,315
    Create an attribute (integer) : Boss Health

    If you want the boss to say, have 40 hits before he dies, then change the number on that attribute to 40

    Then create a rule within the boss when it overlaps with the player's weapon or bullet or whatever it is attacking him: Change attribute self.Bosshealth to self.bosshealth -1

    You can tweak the number of health points taken away depending on what weapon attacked him as well

    Hope this helps!
  • FungoEntertainmentFungoEntertainment Member Posts: 36
    Thanks a lot! It worked just as planned! But now I have another slight request. I need to have the boss destroyed when the hit points are all down. Do you think you could help me out a little more?
  • butterbeanbutterbean Member Posts: 4,315
    Yes :)

    Rule: When self.Bosshealth = 0
    Destroy this actor
    Animate: however you want him destroyed

    Also forgot to add: In the rule where boss health is taken away, you might want to add:

    Rule: When Boss overlaps or collides with : Player weapon (whatever it is that's attacking the boss)
    ADD THIS: When self.bosshealth is > 0 : change attribute self.bosshealth to self.bosshealth-1

    That tells the program not to keep counting down below zero when the boss is hit

    Hope all this helps!
  • FungoEntertainmentFungoEntertainment Member Posts: 36
    I'm really sorry for bugging you, but I am new to GameSalad. I tried to input all of those attributes you told me to, but when I look for the Bosshealth attribute in the new rule I create in the boss actor, I just can't find it. Did I do something wrong? Please help me out. I'm really thankful!
  • butterbeanbutterbean Member Posts: 4,315
    Yea, so when you create an attribute, you can create either a global game attribute which is listed under the main pane of attributes OR you can click on the boss itself, and hit the plus sign creating another attribute. In this case, we're creating an attribute that only the boss can see.

    So click on the boss actor itself, and you'll see a list of attributes

    From there you click on the + sign to add an attribute. It will ask you what kind, you say "integer"

    Then you will see the attribute you added and it's called "new attribute"

    you want to rename that to "boss health" and also click on the number next to it and change it to however many hit points you want the boss to have

    If you want the boss to have 40, just click on it, and type in 40

    Then when you create a rule that says the boss health is minus 1 when he gets hit, you go into the rule: When boss overlaps or collides with player weapon

    Change attribute: click on the box, it will open up the attribute browser

    Then click on the name that should be on the bottom that says "boss" or whatever the name of your boss is

    Then you find the attribute that you created "boss health"

    So the rule becomes: Change attribute: self.bosshealth to self.bosshealth -1

    Also: Here's a link to a picture from one of gamesalad's template shooters:

    http://img534.imageshack.us/img534/7861/screenshot20100405at120.png

    There is a perfect example in there of Boss hit points or boss health, check out the rules within that shooter template to learn how to take boss health away k :)
Sign In or Register to comment.