I could use a little help figuring something out.

  • I'm working on something similar to "They Are Billions" and I can't get my soldiers to move correctly.

    What's supposed to happen:

    I draw a selection box around several soldiers. Soldiers are then selected (and highlighted green) and a right click will tell them where on screen to move to.

    What's actually happening:

    I draw a selection box around several soldiers. Soldiers are then selected (and highlighted green). The first right click does nothing. On a second right click, a single, seemingly randomly selected soldier moves to the correct location. The rest do nothing.

    Here's the code:

    Tagged:

  • Move along path is done a little differently. You have find path for soldiers, keep that the same, then in a different event you have soldier on path found > move along path.

  • Made the change, but it's still doing the same thing. It's like only one of them is getting a path. I don't even know how it's choosing which one. The double right-click bug is super weird, too.

  • Correction: That DID fix the right click bug, but oddly, not the pathfinding bug.

  • Logic seems fine, except the for each is kind of redundant. Post a screenshot of the new events.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Not sure on this one, logic seems fine. Right click doesn't seem to interfere with anything. Check that the soldiers are definitely 'selected' I suppose, that the selection box logic has worked. There might also be a small chance the green selection object isn't hooked up correctly, so it's visible but that soldier is not actually selected, you can check the boolean in debug mode for each soldier.

  • Didn't know the debug panel trick. Here's what's happening there:

    I selected 4 soldiers. They all indicate that the Boolean for selected is true.

    I right click to set a path.

    One calculates and has path = true. He goes to where he's supposed to.

    The rest calculate path for a split second, then nothing. Has path remains false.

  • Usually that only triggers if you're trying to find a path with a bunch of obstacles around the location. Although you are finding a path to a very small space, only 20 pixels out either side, it should still move there. It could possibly fail if the soldiers are solid or obstacles themselves..

  • Holy crap, I figured it out. The pathfinding cell size was set to -1 for some reason. Fixed that, and it's working properly. Thanks for your help.

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