Trigger Once bug with Group Deactivation?

Bugs will be moved here once resolved.

Post » Sat Nov 23, 2013 10:59 pm

Link to .capx file (required!):
https://dl.dropboxusercontent.com/u/142089028/TriggerOnceExample/TriggerOnceExample.capx

Steps to reproduce:
1. Left click the yellow box
2. Middle click the yellow box
3. Right click the yellow box

Observed result:
The black box flashes after step 3.


Expected result:
The black box should never flash again after the initial left click.


Browsers affected:
Chrome: yes

Operating system & service pack:
Windows 8

Construct 2 version:
150
ImageImageImage
B
38
S
5
G
4
Posts: 79
Reputation: 5,355

Post » Sun Nov 24, 2013 2:08 pm

Closing as by design. The 'trigger once' condition is working correctly; the problem is you were expecting the wrong result.
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,772

Post » Sun Nov 24, 2013 6:54 pm

Thank you for the quick reply, @Ashley. Perhaps that could be added to the manual for Trigger Once and/or Groups? In the manual for Groups, there is a tip that deactivation can be used to pause the game, but if many conditions exist that you wouldn't expect to trigger again when the game is unpaused, there can be some mayhem :)

I was afraid this was by design, so I've already reworked my groups to account for it. Thanks again!
ImageImageImage
B
38
S
5
G
4
Posts: 79
Reputation: 5,355

Post » Sun Nov 24, 2013 7:01 pm

Why would you use 'trigger once' in a group other than with the intent for the event to run once whenever the group was activated? That's what it means and that's what you'd use it for. What were you expecting to happen instead?
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,772

Post » Mon Nov 25, 2013 4:23 am

It's possible we're misusing or at least overusing Trigger Once. We have some state variables and we want to trigger actions when the state changes, but not every tick.

For example, a story book where the user can pop back and forth between a page in the book and the main menu where they can choose different books. Our code had been tracking "inStory" as a state variable and when it was equal to 1 we would note the page number and spawn art assets on the page. inStory was set to 0 when the user was on the main menu, and 1 when in any story. We had this controlled with a Trigger Once which was working fine until we decided to better organize our code into Groups and implement a help system that deactivated certain groups while a pop up was generated.

Naturally, we were surprised to discover that after exiting the help pop up and reactivating groups, we now had twice as many assets on our page :)

So, to directly answer your question, I was operating under the assumption that Trigger Once would only allow the actions to be executed when the trigger variable changed, and under no other circumstances. I'm not saying that's necessarily the right way, but that was the reason behind my bug report.

Since the time of my post we have restructured and are hopefully using better practices now. It's been a wild ride these past 8 months coming from total noob status to somewhat decent C2 user, but we're discovering every couple weeks that some of our practices are not the best way to do things!

Thanks for your time as always @Ashley.clrammer2013-11-25 04:31:23
ImageImageImage
B
38
S
5
G
4
Posts: 79
Reputation: 5,355

Post » Fri May 16, 2014 8:38 pm

Good to know it's by design, was going to post the same thing in in the bug thread =O
but I agree with clrammer. this is not as intuitive and obvious as ashley claims.

the manual should say that the events will reset their events when disable and enabled again.

although, when i think about it, it kinda makes sense. good to know though.
B
43
S
12
G
6
Posts: 446
Reputation: 6,802

Post » Fri May 16, 2014 9:10 pm

Sargas wrote:Good to know it's by design, was going to post the same thing in in the bug thread =O
but I agree with clrammer. this is not as intuitive and obvious as ashley claims.

the manual should say that the events will reset their events when disable and enabled again.

although, when i think about it, it kinda makes sense. good to know though.


I think that for a trigger once to trigger, it must have one of it's conditions before it to be false, then all of them to be true.

A group basically logic-wise works the same way as an "Is Group Active" condition, so when you deactivate it, then reactivate it, the condition chain was broken then relinked so it does this.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Fri May 16, 2014 10:35 pm

yup i got that =P

i actually did change the events that used "trigger once" in events when i found out about this ^^
B
43
S
12
G
6
Posts: 446
Reputation: 6,802


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 2 guests