Objects in Container not responding to event lines

0 favourites
  • 9 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • 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?

  • 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"

  • Curious, because presently I'm testing only one instance and it will not work.

  • 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 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?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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.

  • 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.

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)