How Can I Make A Building Get More Damaged Ever Time It Gets Hits

777ideas.com777ideas.com Member, PRO Posts: 895
edited November -1 in Working with GS (Mac)
How Can I Make A Building Get More Damaged Ever Time It Gets Hits.

Thanks

Comments

  • TheBoss_123TheBoss_123 Member Posts: 60
    A series of rules:
    If Building hit = 1
    Change image: 1

    If Building hit = 2
    Change image: 2

    ect ect

    If Building hit <= x
    Destroy Actor

    Thats how I did it in a box breaking game
  • GamersRejoiceGamersRejoice Member Posts: 817
    I would do it like this.

    Make a self attribute on the building actor named damage (integer)

    Then set that attribute to say 3, and every time actor collides with the actor that damages the building subtract 1 from damage.

    Now a new rule that changes the image based on which damage attribute it's on.

    I hope that helps.
  • TheBoss_123TheBoss_123 Member Posts: 60
    Yes got there first
    TheBoss_123 - 1
    GamersRejoice - 0
  • 777ideas.com777ideas.com Member, PRO Posts: 895
    I'll try that thanks guys
  • GamersRejoiceGamersRejoice Member Posts: 817
    TheBoss_123 said:
    Yes got there first
    TheBoss_123 - 1
    GamersRejoice - 0

    Haha! "I'll get you next time Inspector Gadget!"
  • 777ideas.com777ideas.com Member, PRO Posts: 895
    TheBoss_123 said:
    A series of rules:
    If Building hit = 1
    Change image: 1

    If Building hit = 2
    Change image: 2

    ect ect

    If Building hit <= x
    Destroy Actor

    Thats how I did it in a box breaking game

    But How do I set it to when it collides to enemy fireing
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    Kirk,

    check out these videos, i think you've missed some of the game salad fundamentals, which is going to make your life more difficult. I think if you spend an hour or two and watch all of them, you'll be in much better shape.

    http://www.youtube.com/user/GameSaladCookbook/
  • TheBoss_123TheBoss_123 Member Posts: 60
    Create a rule
    If collision with actor
    change attribute: building health - 1
    if building health is 4 : Change image
    if building health is 3 : Change image
    ect
    ...but like jon said, tutorials are the best way
  • 777ideas.com777ideas.com Member, PRO Posts: 895
    jonmulcahy said:
    Kirk,

    check out these videos, i think you've missed some of the game salad fundamentals, which is going to make your life more difficult. I think if you spend an hour or two and watch all of them, you'll be in much better shape.

    http://www.youtube.com/user/GameSaladCookbook/

    Thanks For The Link But I Have Watched Those Video in the past and I'm very good at game salad, I also created many games , but all of my games never really used this style of gaming, I think I mis-worded my last post, I know how to do when an enemy collides with another object, I just dont know how to incorporate that rule with this method stated above.

    Thanks
  • 777ideas.com777ideas.com Member, PRO Posts: 895
    TheBoss_123 said:
    Create a rule
    If collision with actor
    change attribute: building health - 1
    if building health is 4 : Change image
    if building health is 3 : Change image
    ect
    ...but like jon said, tutorials are the best way

    TheBoss_123, Thanks Very Much!
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    put this on each building, where buildingHitPoints is a self attribute. then based on the hit points, change the image

    if actor overlaps or collides with actor bullet (or whatever)
    set buildingHitPoints = buildingHitPoints - 1
  • 777ideas.com777ideas.com Member, PRO Posts: 895
    jonmulcahy said:
    put this on each building, where buildingHitPoints is a self attribute. then based on the hit points, change the image

    if actor overlaps or collides with actor bullet (or whatever)
    set buildingHitPoints = buildingHitPoints - 1

    Thank-You too
  • 777ideas.com777ideas.com Member, PRO Posts: 895
    idk, But Im Still not getting it to work, Its goes crazy the images change in different order
  • 777ideas.com777ideas.com Member, PRO Posts: 895
    bump :)
  • TheBoss_123TheBoss_123 Member Posts: 60
    Create a self attribute for the building actor. Call it Bulding Hitpoints and make it a real attribute and set it to the amount of images you have.
    Create a rule:

    If Actor recieves event - Collision of overlaps with actor of name - Bullet
    Change attribute - Self.BuildingHitpoints to Self.BuildingHitpoints - 1

    Create another rule:
    If attribute Self.BuildingHitpoints = 5
    Change Image Frame 5

    Create another rule:
    If attribute Self.BuildingHitpoints = 4
    Change Image Frame 4

    Create another rule:
    If attribute Self.BuildingHitpoints = 3
    Change Image Frame 3

    Create another rule:
    If attribute Self.BuildingHitpoints = 2
    Change Image Frame 2

    Create another rule:
    If attribute Self.BuildingHitpoints = 1
    Change Image Frame 1

    Create another rule:
    If attribute Self.BuildingHitpoints <= 0
    Destroy this actor.

    If you want 10 bullets to hit it before it changes frame instead of doing -1 do -0.1.

    And thats the easiest i can put it.
    Cheers
    TheBoss_123
  • 777ideas.com777ideas.com Member, PRO Posts: 895
    TheBoss_123 said:
    Create a self attribute for the building actor. Call it Bulding Hitpoints and make it a real attribute and set it to the amount of images you have.
    Create a rule:

    If Actor recieves event - Collision of overlaps with actor of name - Bullet
    Change attribute - Self.BuildingHitpoints to Self.BuildingHitpoints - 1

    Create another rule:
    If attribute Self.BuildingHitpoints = 5
    Change Image Frame 5

    Create another rule:
    If attribute Self.BuildingHitpoints = 4
    Change Image Frame 4

    Create another rule:
    If attribute Self.BuildingHitpoints = 3
    Change Image Frame 3

    Create another rule:
    If attribute Self.BuildingHitpoints = 2
    Change Image Frame 2

    Create another rule:
    If attribute Self.BuildingHitpoints = 1
    Change Image Frame 1

    Create another rule:
    If attribute Self.BuildingHitpoints <= 0
    Destroy this actor.

    If you want 10 bullets to hit it before it changes frame instead of doing -1 do -0.1.

    And thats the easiest i can put it.
    Cheers
    TheBoss_123

    Thank-You So much IT Worked!!!!
Sign In or Register to comment.