Can't make picking work

0 favourites
  • 7 posts
  • 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.


    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!

  • 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


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

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

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi,

    Here's your original capx with commentary on the problem events and what they do.

    And here it my cleaned up version.

    Finally here's a simple capx that shows a feature of picking that was causing you issues.

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

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