How do I trigger an event once every time it becomes true?

Get help using Construct 2

Post » Sat Aug 22, 2015 5:01 am

I've got an event where I want some npcs to run to a safe place every time the player gets near them. IF I use "Trigger once while true," they run away once, but never again. If I don't use it, they don't follow the pathfinding until after the player leaves their proximity. Ideas?
B
6
S
2
Posts: 6
Reputation: 681

Post » Sat Aug 22, 2015 5:05 am

"Trigger once while true" should work fine for what you're needing. Any event you add it to should run once every time it's conditions go from false to true, so there may be something else going on with your events. Care sharing a capx, or at least a screenshot of your events?
Moderator
B
113
S
41
G
20
Posts: 1,586
Reputation: 19,126

Post » Sat Aug 22, 2015 5:14 am

http://imgur.com/iyKIKsv Here's a screen cap.
B
6
S
2
Posts: 6
Reputation: 681

Post » Sat Aug 22, 2015 4:45 pm

In event 18, there's probably some ambiguity about which peasant objects are involved causing the issue. Adding a "for each peasant" loop to the event may help. Here's an example:

Pathfinding Once While True

A Sprite object gets scared every time the mouse gets within 50 pixels, running to the house. They return to their original position after 5 seconds.
Moderator
B
113
S
41
G
20
Posts: 1,586
Reputation: 19,126

Post » Sat Aug 22, 2015 4:50 pm

linkman2004, you are wonderful! Thanks so much, that fixes my problem exactly.
B
6
S
2
Posts: 6
Reputation: 681


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 40 guests