Objects in Container not responding to event lines

Get help using Construct 2

Post » Tue Dec 15, 2015 4:43 pm

Https://www.dropbox.com/s/fmthogfugqtz2 ... 3.jpg?dl=0

My sentry post has an "eye" that will randomly search different spots around its immediate location (event line 89). The Scout object will extend to that coordinate (and and width). In lines 90-92, it tests if the Scout object is overlapping any walls. If yes, calculate new coordinates. If no, use Path Finding to massive the Dot to that spot.

My problem is that it won't even adjust the width/angle of the Scout object and now not even set that values for SentryEyeDot.XTo nor .YTo (previously, it was but inexplicably won't suddenly).

SentryEye, Scout, and SentryEyeDot objects are all in a container. The objects all exist on a separate dump sheet so at least one instance exists in the project. The SentryEye is the object placed in the layout on the level I'm designing (non-dump sheet).

Everything ELSE is working fine.

Any suggestions on what's causing this issue?
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
127
S
21
G
8
Posts: 759
Reputation: 14,327

Post » Tue Dec 15, 2015 5:45 pm

Do you have more than one instance of this? My guess the issue arises from that event with trigger once. It will work fine with one instance but with multiple instances the actions will only run again if all the instances aren't on "move" for a tick. So maybe you could do this instead?

SentryEye: selectOrMove="move"
--- find path
--- set selectOrMove to "thinking"
B
85
S
27
G
86
Posts: 5,077
Reputation: 58,388

Post » Tue Dec 15, 2015 9:34 pm

Curious, because presently I'm testing only one instance and it will not work.
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
127
S
21
G
8
Posts: 759
Reputation: 14,327

Post » Wed Dec 16, 2015 12:42 am

I've tried specifying objects/instances by way of using a variable to store the UID of the mutual object it's contained with, but even that's not helping.
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
127
S
21
G
8
Posts: 759
Reputation: 14,327

Post » Wed Dec 16, 2015 4:31 am

I guess it's time for some debugging. There's probably some logic error somewhere.

You can either look at the variables in the debugger to get an idea what's up or add some events to display the variable values at various points.

Since the events in the photo look fine the problem could be elsewhere. Do those objects start with a value of "move" or "select"? If they do are they all lowercase? If that looks good then do those variables get set anywhere else in your events?
Last edited by R0J0hound on Wed Dec 16, 2015 4:39 am, edited 1 time in total.
B
85
S
27
G
86
Posts: 5,077
Reputation: 58,388

Post » Wed Dec 16, 2015 4:37 am

I've been doing all of that. And the even crazier thing is that I've gotten it to work at one point, barely made a change, of any kind, to make sure it's working as I ultimately intend it to, and then the WHOLE THING just goes haywire...even when I REVERSED any successive change I made.
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
127
S
21
G
8
Posts: 759
Reputation: 14,327

Post » Wed Dec 16, 2015 4:38 am

The problem I don't understand is that if calling on ONE object in a container ALSO calls all other objects in THAT container, then I don't get why nothing works OR everything goes crazy.
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
127
S
21
G
8
Posts: 759
Reputation: 14,327

Post » Wed Dec 16, 2015 8:15 am

Well let's test if the container indeed isn't working. We can do this by temporarily disabling the events. Disable all those events in your photo except for the first one (sentryEye: selectOrMove="select"). Next disable all the actions in that event and then add some simple action to see if the objects are indeed being picked. Something like this will work:

sentryEye: selectOrMove="select"
--- SentryEye: rotate clockwise by 1 degree
--- Scout: set opacity to 50
--- SentryEyeDot: move forward by 1 pixel

or alternatively instead of adding those actions, enable all that event's actions except the one that changes selectOrMove.

With that you should be able to verify if the container is working or not. Ideally you'd have multiple instances.
If it doesn't work at all, then take a look at the value of selectOrMove in the editor. Is it "select"? Beware of case sensitivity.

EDIT:
if all else fails post or pm me the capx and I can find exactly what's amiss. First I'd look at the variables, next I'd look for other events that modify selectOrMove and finally I'd disable most of the events (like above) and enable them a bit at a time and verify they're doing what you intend.
B
85
S
27
G
86
Posts: 5,077
Reputation: 58,388

Post » Wed Dec 16, 2015 9:24 am

I will check on that, too. I've gotten help from a friend who set up a system that I was trying to employ, too, using instance variables and picking by UID. My friend used JUST picking by UID while I was using it WITH what I have presently. But I'll try isolating as you suggested. Thanks for your help and I'll get back to you if I have any further issues.
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
127
S
21
G
8
Posts: 759
Reputation: 14,327


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 9 guests