Region use

Rawr

  • Posts: 85
I am trying to make a sign that will show text when a player comes into a specific area.

I know you can set a scene behavior "if (actor attribute) is in (region attribute)..." and so on.
But then I need a boolean to determine if the region is drawing, and a draw command to let it draw the text at the selected position.

But as I need more than one sign, this tactic seems incredibly stupid and not efficient.


Anyone know another way how?

coleislazy

  • *
  • Posts: 2607
I would make it an actor behavior and give the sign actor a sensor collision box. Then, when the sensor box detects a collision with the player, draw your text. That way, you can set any number of signs in the same level and they could each have attributes set to show their own text.

Greg

  • *
  • Posts: 1260
I need to create functionality like this for a demo I'm working on - so I will upload it to Forge when it's done.  Unless you want to create one yourself that is. 

Rawr

  • Posts: 85
@coleis: Good idea...but then the actor will collide with the sign and cannot walk past it. And the "kill on collision" command will kill the sign sprite as well...

@greg: Well I might not be able to wait that long, but I'd like to check it out whenever it comes out.

coleislazy

  • *
  • Posts: 2607
That's why I said to use a sensor. Making a collision box a sensor means that it will detect collisions, but not physically respond to them (so you can still walk through it). And you can solve the problem of killing the sign by setting it to a different collision group than your enemies. Then, in your collision detection code, you check the collision group of the colliding object, instead of just assuming it is an enemy and killing it.

Rawr

  • Posts: 85
That's why I said to use a sensor. Making a collision box a sensor means that it will detect collisions, but not physically respond to them (so you can still walk through it). And you can solve the problem of killing the sign by setting it to a different collision group than your enemies. Then, in your collision detection code, you check the collision group of the colliding object, instead of just assuming it is an enemy and killing it.
Whoa...sounds a little complicated. Is there anywhere to find like, an example of this?

chaosoul

  • *
  • Posts: 260
First create a new collision group that only collides with tiles and actors. Then go into the collision tab for the sign and click the collision box and press is a sensor button then make your behavior.
COOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEESS