Can't make picking work

Get help using Construct 2

Post » Mon Jul 29, 2013 10:21 am

Hey all,

Recently I've been have a hell of a lot of trouble with picking and inverting conditions. I really don't understand as I have been using C2 for a very long time and never had this trouble before. So, not sure if it's the new build (139) or I've just gone off the rails.

capx

vtrix's altered capx

In that capx the lasers don't all disappear when out of range. Then if you toggle off the section 'Resizes laser' (which runs the for each loop to resize the laser), they won't resize correctly even though the 'creates laser when in range' section should be doing the exact same thing. It's like it's ignoring the inverted 'has laser to' condition and also fails to pick the right orb when adjusting width of the laser.

I'm having all sorts of issues like this lately, not just with resizing the laser. So I would really appreciate some help on this!Tobye2013-07-30 00:29:30
B
28
S
8
G
5
Posts: 429
Reputation: 7,007

Post » Mon Jul 29, 2013 1:41 pm

@Tobye I went over it, and there where some problems but works now, best to compare the capx to see whats changed, but there still some problem left, but i think its just the logic, you use two different settings for lineofsight, but the first one will always set the "orb" to "chase" so the second setting will not matter

fix
ImageImage
B
70
S
21
G
7
Posts: 827
Reputation: 10,052

Post » Mon Jul 29, 2013 3:28 pm

@vtrix thanks a lot for your capx! So essentially the thing is you need to run 'for each' loops for LOS, as they don't actually pick the instance? It just seems so strange. All other conditions I can think of pick (like 'on landed', 'on collision', 'is overlapping'). So why is it different for LOS?

EDIT: Also I tried a new event (not in the for each loops) that says 'has line of sight (inverted)' + is chase: destroy orb. Result was that 2 orbs will eventually destroy themselves, but the third would stay around forever. Do you have any idea about why that is?

EDIT 2: I should say I ran the above a number of times and got all sorts of different results, sometimes all destroyed instantly, sometimes none, everything in between. This can't be right.Tobye2013-07-29 15:34:56
B
28
S
8
G
5
Posts: 429
Reputation: 7,007

Post » Mon Jul 29, 2013 8:53 pm

@Tobye im trying to come to a waterproof explaination but i cant :) im in the habit to use alot of for each just because its sometimes unclear and by testing and error come to right usage, not ideal../ but its better now with families

about edit 2: didnt check but could be why,

if you inverted the line of sight, every object that has line of sight will not be destroyed

no line of sight = destroy
line of sight = nothing happens

> also if you didn't use for each to test this some random things can happenvtrix2013-07-29 21:03:47
ImageImage
B
70
S
21
G
7
Posts: 827
Reputation: 10,052

Post » Tue Jul 30, 2013 12:28 am

@vtrix haha, I'm glad I'm not the only one who can't figure it out ^^ I agree that 'for each' is like a panacea for picking issues, but I am looking at developing for phone and want to really cut down on processing. Also, I just really want to know why it's not working from curiosity! xD

Maybe @Ashley can explain? I also updated the original post with an altered version of vtrix's capx that shows the inverted LOS behaving weirdly.
B
28
S
8
G
5
Posts: 429
Reputation: 7,007

Post » Tue Jul 30, 2013 6:19 am

Hi,

Here's your original capx with commentary on the problem events and what they do.
https://dl.dropboxusercontent.com/u/5426011/fixed/tobye_orig_comments.capx

And here it my cleaned up version.
https://dl.dropboxusercontent.com/u/5426011/fixed/Tobye.capx

Finally here's a simple capx that shows a feature of picking that was causing you issues.
https://dl.dropboxusercontent.com/u/5426011/examples18/picking_behavior.capx
B
92
S
32
G
107
Posts: 5,280
Reputation: 69,971

Post » Tue Jul 30, 2013 7:56 am

@R0j0hound - thanks for your time with this! And yeah, spawning usually picks that instance. So still a little unsure of what's up there. Ah well, I best just get on with it using for each loops :)

Thanks guys!
B
28
S
8
G
5
Posts: 429
Reputation: 7,007


Return to How do I....?

Who is online

Users browsing this forum: David181, OBLIVION and 17 guests