Whats wrong with my Messaging behaviors? [SOLVED]

Yielmo

  • Posts: 5
Okay, so I'm trying to make it so that when you press space, it sends a message that makes a certain something hide. I don't know whats wrong with it though...

Here are the Behaviors:

Brodcaster:

Always
if <[Space] is [down]>
tell this scene to [Start] for all behaviors
Stop (Stops behavior)

Receiver:

when this hears [Start]
[hide] sprite for [self]


Thanks :)

« Last Edit: June 20, 2011, 06:24:41 pm by Yielmo »

Greg

  • *
  • Posts: 1259
Can you show us a screenshot of the behavior?  Press the camera icon in the bottom right corner.  I'm having a hard time visualizing one part that you mentioned (the stop behavior part).

Edit: Actually it sounds like you're telling all Scene behaviors stop -- yet you're trying to make an Actor hide itself (implying an Actor behavior).  When you tell all Scene behaviors to do something, this doesn't include Actor level behaviors. 

Yielmo

  • Posts: 5
Oh. Then what do I do with the "when this hears [___]"? Or do I take it out?

Screen Shots:
http://imgur.com/scCdE

http://imgur.com/24gtW

Edit: Does BBCode Apply here?

Greg

  • *
  • Posts: 1259
Can you describe what kind of gameplay element you're trying to create? 

Can you just add logic to the Actor behavior to check for the space key being pressed, and then hide the Actor? 

edit: I just looked at your image.  Even it the messaging part worked - this wouldn't work, because in the "always" wrapper you have it showing the image for the Actor.  So even if your messaging block gets invoked, it's only going to happen for a split second before the Actor is shown again, most likely not even noticeable. 

I would just cut out the messaging and have the Actor check for the space key.  You'll also have to keep a boolean attribute so you'll know when the Actor is hiding versus visible, that way you won't "show" it when it should be hiding.

Yielmo

  • Posts: 5
Hmm. Thanks. Just tried it, it worked :D Thanks :DD