Someone plz explain this to me.

Discussion and feedback on Construct 2

Post » Mon Jun 19, 2017 10:25 pm

Situation 1. This is obvious not working. I do not need an explanation about this one:

https://www.dropbox.com/s/yz3ux9s33mne4 ... .capx?dl=0


Situation 2. This is working:

https://www.dropbox.com/s/h5s4xq6q5hk5o ... .capx?dl=0

I feel like it should not. So why is it working ? Because this creates possibilities and opens a world of new options. But why ? And can i trust that it will work after the next update ?
B
33
S
18
G
28
Posts: 2,474
Reputation: 20,912

Post » Mon Jun 19, 2017 10:43 pm

Schrodinger's Sprite.
It both exists, and does not exist inside of the box/event/tick.
Keep in mind, objects created are picked, until the next higher tier event.
Last edited by newt on Tue Jun 20, 2017 12:22 am, edited 1 time in total.
Image ImageImage
B
168
S
50
G
164
Posts: 8,236
Reputation: 105,591

Post » Mon Jun 19, 2017 11:43 pm

@99Instances2Go

like newt said, "objects created are picked, until the next higher tier event"

In your first example the destroy line is outside the scope of the event that creates the sprite (and the new sprite does not officially exist until the next top level event - as I think you know). But in your second example, the action is still within the scope because it is part of a sub event under the one that created the sprite. The new sprite will stay Picked until all sub events are finished, or something else changes the picking. like a condition that does not apply to the new sprite, or if you have a sub event that does a system --> pick All Sprite2, (then all other existing instances will be picked except the new one - because it does not officially exist yet).

another useful thing to know is that you can pass the UID of the new sprite into a function. The function can pick the object by its UID and do whatever you want to it even though the next top level event has not happened yet.
B
94
S
33
G
20
Posts: 438
Reputation: 17,615

Post » Tue Jun 20, 2017 4:53 pm

newt wrote:Schrodinger's Sprite.
It both exists, and does not exist inside of the box/event/tick.
Keep in mind, objects created are picked, until the next higher tier event.


Yeah, but you cant peek in the box until the next root. Unless you entangle it with UID.

Yet, that is what happens in the second version.
B
33
S
18
G
28
Posts: 2,474
Reputation: 20,912

Post » Tue Jun 20, 2017 4:59 pm

@AllanR

I know all that. If you ever read my comments, you know i do.

It should not matter that it stays 'picked' as you call it. Or, that it stays in the current picklist.
Because it is 'repicked', and that condition should not work.

As you word it "If ... pick All Sprite2, (then all other existing instances will be picked except the new one - because it does not officially exist yet)."
B
33
S
18
G
28
Posts: 2,474
Reputation: 20,912

Post » Tue Jun 20, 2017 5:36 pm

The second one works because the created object is still picked in sub-events.
B
91
S
31
G
103
Posts: 5,238
Reputation: 67,762

Post » Tue Jun 20, 2017 7:47 pm

So each 'level' (parent-sub-sub-sub ....) has its personal 'level' picklist ?
B
33
S
18
G
28
Posts: 2,474
Reputation: 20,912

Post » Tue Jun 20, 2017 8:05 pm

The concrete problem is this. I was reading the events in the project in this post.
viewtopic.php?f=147&t=192935

I wanted to explain that the logic for the events with parent event 99 is broken because of that "you cant pick a newly created object before the next root event ". But, then it struck me that all the key press events work with no flaws.

So, now, what i used to say "you cant pick a newly created object before the next root event" makes no sense anymore. It does not include 'situation 2' in openings post in a non brain wrecking way.

So what i need is a rephrase of "you cant pick a newly created object before the next root event" so it includes both situations.
B
33
S
18
G
28
Posts: 2,474
Reputation: 20,912

Post » Tue Jun 20, 2017 8:49 pm

Yes, I guess you could say that. If something is picked it stays picked for the rest of that event and following sub-events unless another event unpicks it. Do some tests that change the frame or opacity of the objects to get a visual to understand it better.

In that capx event 99 is a trigger that is called when an object is created, and that object is picked and any parent events are tested first. So it's probably some logic error rather than some quirk of the event system.
B
91
S
31
G
103
Posts: 5,238
Reputation: 67,762

Post » Tue Jun 20, 2017 9:08 pm

Event 99 is a 'on creation' trigger that runs 'in place' (of the creation action) and tries to pick before the next root event. The wait in there tried to fix that in a wrong way. Use opacity and kill the (wrongly placed) wait to understand that event.
B
33
S
18
G
28
Posts: 2,474
Reputation: 20,912

Next

Return to Construct 2 General

Who is online

Users browsing this forum: vegapomme27 and 1 guest