0 Favourites

Pick All / Create Bug

  • yea, tunepunk is right- on create doesn't include the new objects in any picking.

    in these events for example, nothing gets rotated:

  • yea, tunepunk is right- on create doesn't include the new objects in any picking.

    in these events for example, nothing gets rotated:

    Can confirm. Did exactly the same test. Pick All doesn't pick any picked objects. Removing Pick all and they will rotate.

  • yea, tunepunk is right- on create doesn't include the new objects in any picking.

    in these events for example, nothing gets rotated:

    Might want to recheck that.

    As is, any instance in the layout already will be rotated.

    Pick all negates the on create pick, and picks everything else.

    Remove the pick all, and all instances get rotated when created.

  • > yea, tunepunk is right- on create doesn't include the new objects in any picking.

    > in these events for example, nothing gets rotated:

    >

    >

    Might want to recheck that.

    As is, any instance in the layout already will be rotated.

    Pick all negates the on create pick, and picks everything else.

    Remove the pick all, and all instances get rotated when created.

    So it's a useless trigger if you want to, upon creation pick anything of the same kind, allready on screen and rotate them together with the new one? any workaround?

    Anyway, that does not explain why my function isn't picking the newly created one. The function is clean of any picking at start? and should pick everything right?

  • You have to break picking in the creation event.

    A function should suffice.

    on function, sprite, do fo0

    No pick all.

    Edit:

    Never mind the function, use a global.

  • If i have other sprites on the screen, this example only rotates the ones already on screen on click.

  • Functions are called before the event even finishes, so new objects don't exist yet officially.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • There's apparently a SOL list, a New Object list, and an Instance List.

    When you create an object, the SOL is set to that new object. It also gets added to the New Object List. However the Instance List (which the picking condition uses) will not have the new objects in them until the next Top Level event.

    The function apparently is not a top-level event, so the new objects don't get added to the Instance list.

    The problem we're facing is that we need a way to pick all the objects, including the objects in the New objects List. Apparently there is no way to do this currently, and I'm hoping Ashley can implement a way to do this.

    It seems silly that creating an object will set the SOL to that new object, allowing you to interact with it instantly, however you can't reselect them until next Top-Level event.

    Because we can't reselect everything, It causes issues in the flow of the program and how things get processed- we have to take into account having to wait until another top-level event, which makes things more complicated than they ought to be. And due to this, there's potential to make more errors because things don't appear as they seem.

    edit: also- newt, that doesn't solve all situations. Referencing a global variable will still cause a delay.

  • I'm not seeing the delay.

  • So that means 'on created' is not a top level event either? In my previous example function is called in a new top level event (on created).

    So can anyone explain this image then? 1st example rotates correct sprite as expected. 4th example picks exactly the same sprite but does nothing.

    2nd and 3rd example rotates everything but the created sprite.

    From example 1 it's clearly pickable.

  • tunepunk

    Don't use a function for new objects.

    It used to work that way, but it was changed at some point.

  • I'm not seeing the delay.

    The delay to the intended process happens as soon as you break from the event- other events could run before it checks the global variable, events which can rely on what has or hasn't happened in the process.

    When you develop intricate processes that aren't just simple events like these examples, the order of every single step through the process matters- you can't afford to break away and assume it will work with everything else.

  • tunepunk

    Don't use a function for new objects.

    It used to work that way, but it was changed at some point.

    It doesn't matter if I use functions or not. The design is retarded. On creation - I need to pick everything including the newly created sprite, and sort the Z order otherwize the newly created one will not end up in the correct order, or I will see a glitch (if i use wait 0), or I have to use some strange workaround with variables to pick.

    Pick All, in a sub event does not work, newly created sprite is excluded.

    Pick all, in a new top level event like "on created" still excludes the newly created one.

    Pick all, in a function called in any of those still doesn't include the newly created object.

    There's no logical way to pick after creation which is very annoying. I've spent hours trying to figure out why it doesn't work, and trying to find workarounds. Picking should always pick. I don't care if they are sol, new, instance or whatever, if they have an UID they should be pickable.

    And the reason for using functions is so I don't have to clutter up the code with copies of events doing exactly the same thing.

  • Well there's always the first thing I suggested.

    Set the z on creation.

    Anyway, I'll keep giving workarounds for feature requests, you don't have to use them.

  • Well there's always the first thing I suggested.

    Set the z on creation.

    Anyway, I'll keep giving workarounds for feature requests, you don't have to use them.

    I did try that as well, doesn't always work as expected. The only action to set zOrder is by Move to object behind/infront so in some cases when the arrow doesn't hit anything and is partially behind another object or in between objects i have some sorting problems. If I move infront of the one behind sometimes it would end up infront of the one in front also, or vise versa. Anyway....

    ....But I got it working using the global varaible aporoach. Thanks, but It's not really my first instinct to do it that way. It doesn't really make any sense why 'pick all' doesn't pick all when you expect it to do so. They should change the name to "pick all except new objects" :p

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