Behaviors not functioning

Ok. So, I have these rules, and behaviors in them. But, they do not work. I've had a debug state log whenever the action is supposed to happen, and the statement is printed, but the actions do not happen. Any ideas? Or is it just a bug?

Comments

  • SocksSocks London, UK.Member Posts: 12,822
    edited March 2015

    It's definitely a bug.

  • richardlordthesecondrichardlordthesecond Member Posts: 19

    Ok, thanks. :/ Hope they will fix it soon. It only started happening since the 13. versions came out.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    When you post a question, you need to supply as much detail as possible. Just stating that something doesn't work gives no insight into how you set it up or what might be wrong.

    http://forums.gamesalad.com/discussion/66768/forum-faq#posting

    A screenshot of your rules is especially helpful. You can upload it to a file-sharing service and then embed or post the link here.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • richardlordthesecondrichardlordthesecond Member Posts: 19
    edited March 2015
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Are you using a Display Text behavior to watch the value of self.health? If so, does it change? If not, did you type in self.health in the expression editor or select it from the Attribute Browser (it has to be selected)?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SocksSocks London, UK.Member Posts: 12,822
    edited March 2015

    ...

  • richardlordthesecondrichardlordthesecond Member Posts: 19

    @tatiang said:
    Are you using a Display Text behavior to watch the value of self.health? If so, does it change? If not, did you type in self.health in the expression editor or select it from the Attribute Browser (it has to be selected)?

    No I am not, but I have a health bar that works impeccably.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited March 2015

    ...then you might want to try it.

    What about my other question?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SocksSocks London, UK.Member Posts: 12,822
    edited March 2015

    @richardlordthesecond said:
    Ok, thanks. :/ Hope they will fix it soon. It only started happening since the 13. versions came out.

    I wasn't being serious when I said 'It's definitely a bug' ! :wink: How on earth would I know, all you've said is that you have some rules and they are not working.

  • SocksSocks London, UK.Member Posts: 12,822
    edited March 2015

    @richardlordthesecond said:
    No I am not, but I have a health bar that works impeccably.

    Then what is the problem you are having ?

    So far all we know is that you are having some sort of issue (quite what it is still remains a mystery :smiley: ), the code you posted looks fine and your health bar works impeccably . . . so are you able to say what the actual problem is ?

  • richardlordthesecondrichardlordthesecond Member Posts: 19

    Well. Let me try to be specific as I can.

    I have a rule in my ship object, "When actor overlaps or collides with blah" "self.hp = self.hp - 5" This works for bullet one. I have the exact same rule for bullets two and three, but they do not set the health down. They are definitely colliding, because when they collide with the ship, they get destroyed like they are supposed to. However, they do not set the health down. I have the ship log a statement "hit" and am printing the hp with "print text" when it collides with them, and it does log it, meaning the event is firing, but the text showing the hp does not change, and the health bar does not decrease.

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    If the bullets are different actors you need to make the HP Attribute a Game Level Attribute and not an Actor Attribute for more than one actor to access it.

  • richardlordthesecondrichardlordthesecond Member Posts: 19

    @jamie_c said:
    If the bullets are different actors you need to make the HP Attribute a Game Level Attribute and not an Actor Attribute for more than one actor to access it.

    You don't understand. I have the code, for setting the hp down, in the SHIP actor, NOT the BULLETS actor. So when the SHIP collides, in the SHIP actor, there is the behavior for getting damaged. And like I said, one of them works, the others don't.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Try putting the Destroy Actor behavior in the bullet inside of an after 0.1 seconds timer:

    When actor collides with ship actor
         Timer after 0.1 seconds
              Destroy Actor

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • richardlordthesecondrichardlordthesecond Member Posts: 19

    Ok, I'll try that. Let you know if it works.

Sign In or Register to comment.