How do I "Trigger once while true" individually

Get help using Construct 2

Post » Tue Feb 18, 2014 2:49 pm

Ok, simple question. There is a Object, lets call it "Box", and I have some instances of this object.
When a boolean variable of the box change, I need there something happen with the box that have his variable changed.

I tryed
"|For each box            |
|Box Variable is true    | ------   Box Y set to 1000
|Trigger once while true |"

dont work, trigger once for the first instance and repeat infinite times for other objects.

"|Box Variable is true    | ------   Box Y set to 1000
|Trigger once while true |
dont work too, same effect above.

I had heard that the order of the conditions changes its effect, but I had tested for a long while and nothing happens. Tnx and sorry my english.
B
4
Posts: 12
Reputation: 655

Post » Tue Feb 18, 2014 2:51 pm

http://www.scirra.com/forum/trigger-once-and-instances_topic86899.html
Trigger once is a system command and it doesn't pick instancesRoccinio2014-02-18 14:52:27
B
15
S
6
G
4
Posts: 277
Reputation: 3,948

Post » Tue Feb 18, 2014 2:58 pm

I would go with Functions to solve this.
There is a place (or multiple places) in your events where you set this boolean to true. Instead of doing that, you should call a function that would set the boolean to true and then do your actions.
Example :capx
B
17
S
8
G
4
Posts: 473
Reputation: 6,221

Post » Tue Feb 18, 2014 3:15 pm

Actually I solve this problem with many ways, but I was curious about why "Trigger Once While True" was not working. Tnx Roccinio, forget about System Cond doesn't pick instances and Yes Guizmus, function solve all problems. Tnx all.
B
4
Posts: 12
Reputation: 655

Post » Tue Jun 02, 2015 11:44 am

The correct way to use "trigger once while true" is to put it as a sub-event :)

(Sorry for being late of 16 months to reply ahahah)
B
11
S
3
G
1
Posts: 91
Reputation: 997


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 5 guests