Pick All / Create Bug

Bugs will be moved here once resolved.

Post » Mon Jun 27, 2016 6:30 pm

Image

If i have other sprites on the screen, this example only rotates the ones already on screen on click.
Follow my progress on Twitter
or in this thread Archer Devlog
B
40
S
17
G
17
Posts: 977
Reputation: 12,626

Post » Mon Jun 27, 2016 6:37 pm

Image

Functions are called before the event even finishes, so new objects don't exist yet officially.
Last edited by newt on Mon Jun 27, 2016 6:40 pm, edited 1 time in total.
Image ImageImage
B
169
S
50
G
173
Posts: 8,313
Reputation: 110,270

Post » Mon Jun 27, 2016 6:39 pm

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.
B
45
S
20
G
65
Posts: 1,115
Reputation: 38,121

Post » Mon Jun 27, 2016 6:53 pm

I'm not seeing the delay.
Image ImageImage
B
169
S
50
G
173
Posts: 8,313
Reputation: 110,270

Post » Mon Jun 27, 2016 7:01 pm

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

Image

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.
Last edited by tunepunk on Mon Jun 27, 2016 7:09 pm, edited 1 time in total.
Follow my progress on Twitter
or in this thread Archer Devlog
B
40
S
17
G
17
Posts: 977
Reputation: 12,626

Post » Mon Jun 27, 2016 7:09 pm

@tunepunk

Don't use a function for new objects.
It used to work that way, but it was changed at some point.
Image ImageImage
B
169
S
50
G
173
Posts: 8,313
Reputation: 110,270

Post » Mon Jun 27, 2016 7:21 pm

newt wrote: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.
B
45
S
20
G
65
Posts: 1,115
Reputation: 38,121

Post » Mon Jun 27, 2016 7:38 pm

newt wrote:@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.
Follow my progress on Twitter
or in this thread Archer Devlog
B
40
S
17
G
17
Posts: 977
Reputation: 12,626

Post » Mon Jun 27, 2016 8:10 pm

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.
Image ImageImage
B
169
S
50
G
173
Posts: 8,313
Reputation: 110,270

Post » Mon Jun 27, 2016 9:03 pm

newt wrote: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
Follow my progress on Twitter
or in this thread Archer Devlog
B
40
S
17
G
17
Posts: 977
Reputation: 12,626

PreviousNext

Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 5 guests