Multi-Object Sequence Works For One, Not Others

Get help using Construct 2

Post » Wed Dec 23, 2015 9:00 am

First, thank you to everyone who has reached out to help me in the past.
And if you're one of those people, you know my requests for help are probably on the complicated side (at least when I try to explain my issues clearly). So, please bear with me... THIS time, I've included pictures!

SCENARIO:
FINN: Mobility Run is a stealth game for the mobile platform. During each stage, FINN must activate switches to open doors, etc. The Switch objects, using their own UID, are associated with multiple instances of Conduits (two types - straight and angle put into a Family) and with a Door or other object if the Conduits do not come to a dead-end.

Image

On the main screen during gameplay, there is a touchscreen button - Interact - which will turn fully opaque when FINN is on or near something he can interact with or activate.

Image
Image

Pressing Interact while overlapping a Switch instance will set off a chain-reaction of Conduit instances, each with a manually-entered sequence number, thus creating the appearance of segment after segment "charging up" as it proceeds to the end of its line.

Image

Once the counter for the Switch reaches the maximum number of Conduits in its associated chain (zero-based), it either stops right there or it activates whatever object is connected to it (ie: Door).

This is where I have problems...
If I activate a Switch, it will work just fine, with or without an ending piece like a Door. But as soon as I activate a second Switch, it doesn't appear to do anything. It might initiation the first Conduit instance in its chain, but no more. I cannot determine where the problem is coming from.
In Bug Test preview, all Switches register that they can be activated when the conditions are met but I do not see where the other two are being prevented from being activated.

Thank you again for your help!
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
142
S
24
G
8
Posts: 793
Reputation: 15,157

Post » Wed Dec 23, 2015 7:18 pm

The main properties of Construct that hang me up at the inherent asynchronicity of JavaScript and the fact that all root global events (even if they are sub-grouped) are automatically executed "per tick".

Check and make sure you don't have conflicting conditions executing simultaneously or in quick sequence (like a toggle). With toggle switches, you must have a toggle variable and alter this parameter and change the object state based on the parameter's value, not based on simultaneously executing conditions.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,857

Post » Wed Dec 23, 2015 9:16 pm

@gumshoe2029 - Well, I don't have any toggling of variables going on. What I've got pictured above is all that's involved with this particular case. There are no other event lines in action. But, based on what you said, are there any other conditions that you see that might line up with what you are thinking?
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
142
S
24
G
8
Posts: 793
Reputation: 15,157

Post » Wed Dec 23, 2015 10:15 pm

one thing I see immediately is the impossibility for event 194 to be true..
It's topevent limits the selection of switches to the ones that are not activated, so it's impossible to pick one that is activated in a subevent..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Dec 24, 2015 4:00 am

@LittleStain - Thank you. :) I do believe I caught that shortly after my last comment. I did, actually, get it working by adding a For Each to event line 194. Go figure... I hate that I can't always tell when a For Each is needed. It has been my understanding that a condition like 194 automatically checks FOR EACH instance that meets the criteria and then equally does FOR EACH instance of any other related object that relates to those initially-selected instances as it goes down the sub-events. Ah well. I've got it worked out.
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
142
S
24
G
8
Posts: 793
Reputation: 15,157

Post » Thu Dec 24, 2015 10:33 am

Rhindon wrote:@LittleStain - Thank you. :) I do believe I caught that shortly after my last comment. I did, actually, get it working by adding a For Each to event line 194. Go figure... I hate that I can't always tell when a For Each is needed. It has been my understanding that a condition like 194 automatically checks FOR EACH instance that meets the criteria and then equally does FOR EACH instance of any other related object that relates to those initially-selected instances as it goes down the sub-events. Ah well. I've got it worked out.


It's pretty easy and described in the manual "how events work" and "subevents"

subevents continue with the objects picked in the events above..
if you want to pick another instance in a subevent you should first pick all instances and start reducing by conditions again..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Dec 24, 2015 7:14 pm

@LittleStain - I actually started doing that on line 199. And even for line 200 at one point. That didn't fix the issue. I've read the manual regarding how events work but it doesn't always seem to work 100% for absolutely every case. Meaning, there seems to be exceptions when the event line assumes "all instances that meet these conditions".
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
142
S
24
G
8
Posts: 793
Reputation: 15,157

Post » Thu Dec 24, 2015 8:08 pm

Rhindon wrote:There seems to be exceptions when the event line assumes "all instances that meet these conditions".


There shouldn't be..
If you use events that don't pick, like the system compare expression, things might get messy, but picking objects is picking objects and subevents will reference only the already picked objects..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Jan 05, 2016 4:52 pm

Rhindon wrote:@gumshoe2029 - Well, I don't have any toggling of variables going on. What I've got pictured above is all that's involved with this particular case. There are no other event lines in action. But, based on what you said, are there any other conditions that you see that might line up with what you are thinking?


What is your "Switch" for?

For example, in your second image you have (what looks to me at least) like two global events:

1) When Switch is InteractButtonActive
2) When Switch is not InteractButtonActive

Both of those (if they are indeed global events) will execute on every tick, so if you do not control the flow of actions very carefully, you will end up toggling the switch back and forth nearly instantly, effectively making it appear that it doesn't work, while in reality it is working instantly.

Obviously, I cannot know if this is what is happening, but this is my suspicion.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,857


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 28 guests