How do I detect behavior state?

Just started using Construct 2? Post your questions here

Post » Fri Aug 01, 2014 7:21 am

Hello all,
Im building my first game where a guard tries to track the player. The guard implements bullet and pathfinding and switces between the two depending on game conditions. Is there a way to detect the behavior state (enabled or disabled), like through some system expression, in order to log it for debugging reasons?
Posts: 1
Reputation: 150

Post » Fri Aug 01, 2014 10:50 am

Well, enabled/disabled no.

But in the case of the bullet behavior, there is a condition that allows to compare its speed. If instead of disabling the bullet you just go to set its movement speed to 0, you can then have conditions that if Bullet speed = 0 then the bullet is "not active", or if Bullet speed > 0 the bullet is "active".

Same order of idea for the Pathfinding, the condition "Is moving along path" allows you to know that the behavior is active and moving the instance along a calculated path.

Finally, if you really want to, you can add two instance booleans that will allow you to check for the behaviors states when you enable/disable them.
Something like "BulletEnabled" and "PathFindingEnabled" that are either true or false.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Posts: 7,432
Reputation: 75,388

Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 2 guests