Picking problem?

Get help using Construct 2

Post » Fri Mar 23, 2012 3:42 pm

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(



"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

The project itself(capx)raptor07232012-03-26 09:38:43
B
12
S
5
G
3
Posts: 14
Reputation: 3,322

Post » Sat Mar 24, 2012 9:52 am

Can anybody help?(
Is there an error or is it a bug?
B
12
S
5
G
3
Posts: 14
Reputation: 3,322

Post » Sun Mar 25, 2012 12:38 pm

up(
B
12
S
5
G
3
Posts: 14
Reputation: 3,322

Post » Sun Mar 25, 2012 1:37 pm

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.

kittiewan2012-03-25 13:47:48
B
29
S
11
G
12
Posts: 281
Reputation: 11,868

Post » Mon Mar 26, 2012 9:39 am

It's in the main post.
Thank you in advance for your time)
B
12
S
5
G
3
Posts: 14
Reputation: 3,322

Post » Mon Mar 26, 2012 3:08 pm

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



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.



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. kittiewan2012-03-26 16:16:10
B
29
S
11
G
12
Posts: 281
Reputation: 11,868

Post » Mon Mar 26, 2012 6:22 pm

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)
B
12
S
5
G
3
Posts: 14
Reputation: 3,322

Post » Tue Mar 27, 2012 2:10 am

Much better!
B
29
S
11
G
12
Posts: 281
Reputation: 11,868


Return to How do I....?

Who is online

Users browsing this forum: imnotspecial, tomi71, totoe, Yahoo [Bot] and 15 guests