[r100] Interesting subevent problem

Bugs will be moved here once resolved.

Post » Fri Aug 24, 2012 6:23 pm

Take a look at this capx.

CAPX HERE.

The logic is very, very simple. The 'nodes' are created, then instantly destroyed.

Run the project, and they are not destroyed.

Same thing happens with a 'for each node - destroy' event.

I think it has something to do with the blank sub-events, as when you make the actions actions of the parent event, the behavior is different.

This impacts my current game significantly, I found this after a project working in r99 failed in r100.sqiddster2012-08-24 18:23:38
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Fri Aug 24, 2012 7:00 pm

Might have something to do with this:
Quote from the r 100 release notes

"Bug Fix
Sprite's 'Spawn an object' spawning the same kind of object could crash the runtime. To work around this, in this case the spawned object is no longer picked if the same type. (Behavior is unaffected if spawning a different kind of object.)"
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Fri Aug 24, 2012 8:24 pm

Still, this seems like a nasty issue to leave in the program. @Ashley, anything to say?
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Fri Aug 24, 2012 8:31 pm

You just need to change your picking. If you move the destroy event underneath the spawn event in the top tier, it works.

Also, we do have an on create event.
That might be a little tricky to use if you need to spawn objects that don't need to be destroyed, but you can filter that via variables.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Fri Aug 24, 2012 8:45 pm

Is it a bug? The behavior was by design in CC:
http://www.scirra.com/forum/picking-problem_topic41776_post257714.html?KW=picking#257714

So is it a bug now or was it in r99, I happy either way as long as it is consistent.
B
79
S
24
G
54
Posts: 4,738
Reputation: 40,739

Post » Fri Aug 24, 2012 8:52 pm

The inconsistency is the real issue, I have to change a lot of my code now.

Also, the fact that it doesn't work even if there's a 'for each node - destroy' is strange to me.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Fri Aug 24, 2012 9:34 pm

@squiddster
Well it's go to be in the sol in order for "for each" to work.
So if those objects aren't picked in the initial condition, or referenced in a sub event to the event that created them then, they don't exist in the sol.
Remember you can filter "for each" to work with only the objects you want.
sprite.value picked = 1
>for each sprite... do stuff.

There any sprite that didn't match the value in the variable, would not be iterated.

As far as I can tell picking is still consistent, as long as you don't use a sub event, or event that's not a sub event to the event that created it. newt2012-08-24 21:35:54
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Fri Aug 24, 2012 9:46 pm

ImageImageImageImageImageImage
B
93
S
19
G
12
Posts: 1,192
Reputation: 18,301

Post » Fri Aug 24, 2012 10:10 pm

@sqiddster

That's indeed really weird, I even try to reset all pick and it still won't destroy all the Nodes:



capx
https://dl.dropbox.com/u/39382262/BUG/DestroyBugPickReset.capx
B
34
S
13
G
8
Posts: 134
Reputation: 8,118

Post » Fri Aug 24, 2012 11:22 pm

@Potato
See that's what you call Pavlov's Sprite. heh

Another "feature" where the objects don't actually exist till the next top level event happens... unless you use on created.

Edit, ok never mind on the on created, blah, blah, blah, one trigger per event branch.newt2012-08-24 23:35:44
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Next

Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest