A question...

aeroblaster4aeroblaster4 Member Posts: 7
edited November -1 in Working with GS (Mac)
If I wanted to make it so that an actor destroys another actor, but only if the first actor is going a certain speed, how would I go about doing this?

Also, how would I give an object health, such as a block that needs destroying, but requires multiple hits.

Comments

  • blastfactorblastfactor Member Posts: 72
    for the health thing, when your in the actor, add an attribute on the left side, name it Health and make it an Integer. set the number to 2

    then create a rule, say "if oblect collision blah blah, then put "change attribute: self.Health to self.Health -1

    then create another rule that says if attribute self.Health =0 then delete
  • aeroblaster4aeroblaster4 Member Posts: 7
    Thanks, that worked really well.
    Anyone have any ideas about the first bit though?
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    @aero

    Please read through the Rules/Guidelines sticky it will explain why using a titles for topics like, Help, a Question, Please anyone, etc… need to be avoided. That title is probably a good reason why you have not received many replys to your question.

    No for your question number 1
    you can create a game boolean attribute we'll call it destroyspeed

    Lets call the actor getting destroyed Actor 1 and the actor doing the destroying actor 2

    In actor 1 you will need a rule
    When Actor Overlaps or Collides with Actor 2
    AND game.destroyspeed is true
    --Destroy Actor

    Then in actor 2 have a rule
    If self.linear velocity .x > 100
    --Change Attribute game.destroyspeed to true
    Otherwise
    Collide with actor 1

    (That Rule will make actor 2 destroy actor 1 if moving faster than 100 and if below it will bounce off)

    I hope that helps there several ways you could modify that to get different results So hopefully that will get you in the right direction.

    Oh and don't forget to check out the Rules and Guidelines Sticky. There is good stuff in there

    _______________________________________________________________
    AppSolute Entertainment on Facebook
  • calvin9403calvin9403 Member Posts: 3,186
    tenrdrmer said:
    @aero

    Please read through the Rules/Guidelines sticky it will explain why using a titles for topics like, Help, a Question, Please anyone, etc… need to be avoided. That title is probably a good reason why you have not received many replys to your question.

    No for your question number 1
    you can create a game boolean attribute we'll call it destroyspeed

    Lets call the actor getting destroyed Actor 1 and the actor doing the destroying actor 2

    In actor 1 you will need a rule
    When Actor Overlaps or Collides with Actor 2
    AND game.destroyspeed is true
    --Destroy Actor

    Then in actor 2 have a rule
    If self.linear velocity .x > 100
    --Change Attribute game.destroyspeed to true
    Otherwise
    Collide with actor 1

    (That Rule will make actor 2 destroy actor 1 if moving faster than 100 and if below it will bounce off)

    I hope that helps there several ways you could modify that to get different results So hopefully that will get you in the right direction.

    Oh and don't forget to check out the Rules and Guidelines Sticky. There is good stuff in there

    _______________________________________________________________
    AppSolute Entertainment on Facebook

    but if he's actor2 fly up high or is not Horizontal
  • calvin9403calvin9403 Member Posts: 3,186
    calvin9403 said:
    but if his actor2 fly up high or is not Horizontal

Sign In or Register to comment.