Picking problem?

0 favourites
  • 8 posts
From the Asset Store
Pick Up Items Sound effects for your game, Take them for a ride right now and you will worry no more.
  • I'm working on some sort of vertical rts project. You spawn npc, they go in the straight line onto the opponents base and shoot targets in its path. Npcs on one lane must hold some distance between each other so i made some events, that solves this...for one side... as all other mechanics like shooting, turning etc., i've just inverted this to make the same thing for other side, and it just wont work! Why? Events are exactly the same as all the sprites and options, just conditions and events where inverted(friends to enemies).

    Please help(

    <img src="http://dl.dropbox.com/u/68649813/r1/help1%28.png" border="0">

    "Movement" works fine, the problem is with "Movement2". And not with all of it, only with the 8 string, the one that must stop npc when there is an ally in front of it.

    Mouse over addition was made to check distances, in "Movement" it shows correct, in "Movement2" - 0.

    Sprite6 spawning was made also for checking, when conditions are true, in "Movement2" they are always true <img src="smileys/smiley5.gif" border="0" align="middle">

    The project itself(capx)

  • Can anybody help?(

    Is there an error or is it a bug?

  • up(

  • Any way you can post a capx with the problem? I'm having to recreate your logic which is partially missing... I'm wondering if it is a problem with how your are nesting (or rather not nesting) your logic. But it is strange that it appears to work in one case but not in the other.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's in the main post.

    Thank you in advance for your time)

  • I am not 100% certain what you are trying to achieve, but I think the picking problem has to do with your already having picked some tactical2 objects in a previous event. For each just uses each of those currently picked objects maybe?

    In order to test all of the tactical2 objects I modified event 8 as shown and tactical2 objects started moving (although I think not the first one I placed but that might be for some other reason.)

    <img src="http://dl.dropbox.com/u/57899112/PickProblemEvent8.PNG" border="0">

    EDIT: This change does seem to break your logic to make tactical2s keep their distance

    apart, since each tactical2 on the same line goes to the exact same

    position as the others on that line. But hopefully it gives you a place to start working from. I think that if you nest your events by creating sub-events instead of putting them in one event things will work better. If you're trying to limit your events to under 100 because you are using the free version, that could eventually create a problem since each sub-event counts as an event.

    For Each has generated confusion for many, including me. Here is a tutorial that Arima posted on using For Each.

    I don't know if it clears up anything, but I do know that changing For Each to Pick All made tactical 2 start moving.

    EDIT 2: You can also eliminate the For Each and Pick Every entirely. The system will test every tactical2 to see if it satisfies the other conditions.

    <img src="http://dl.dropbox.com/u/57899112/PickProblemEvent8V2.PNG" border="0">

    EDIT 3: I also don't think you need the On every tick event in that first Movment 2 event. Anytime the rest of the conditions become true it will trigger.

  • Well, thank you for your time and advice, i've fought with this issue whole day today, but none helped.

    And then i decided to make this a little bit different. I used this marvelous begavior by Pode, pinned with it a half circle sprite in front of each troop and stopping them by UID every time the sprite overlaps an ally.

    That's all)

    <img src="http://dl.dropbox.com/u/68649813/r1/s1.png" border="0">

  • Much better!

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