start of layout bug???

Post your own tutorials, guides and demos.

Post » Fri Sep 26, 2008 4:52 pm

http://www.mediafire.com/file/g2vnwythv ... layout.cap

I recreated this after finding some weirdness in my game.

I destroy an object at start of layout, but it doesnt get destroyed until its registered a collision.

While this is a simple demo of what I found, It's causing me some issues in my game and am wondering if that's how it's meant to be or if its a bug whereby the start of layout isn't doing as it should.
B
4
S
2
G
5
Posts: 149
Reputation: 2,025

Post » Sun Sep 28, 2008 9:33 am

The
[code:3225ty31]Start of Layout -> Destroy an Object[/code:3225ty31]
Works for me without collision detection.
B
4
S
2
G
4
Posts: 719
Reputation: 2,938

Post » Sun Sep 28, 2008 9:42 am

On my machine it does detect overlapping once.
Looks like for the time being you'll have to use Private Variable (for example variable named "Destroyed"). When destroying object you should set this PV to "1" and call Sprite->Destroy as well. Since object is deleted from collection at the end of loop, this PV would control "if this object should be included in coll detection".

Edit:
This "delayed destroying" also was in Fast Loop Object in TGF.
B
6
S
3
G
6
Posts: 219
Reputation: 3,013

Post » Sun Sep 28, 2008 10:01 am

[quote="BROO":5wof7umg]On my machine it does detect overlapping once.[/quote:5wof7umg]
Oooooooh its about Detecting overlapping (facepalm), well it detects on my machine too.

BUT check it out:
1.) Set "Start of layout" event as last
2.) Set "Always event" as second
3.) Set "Overlaps" event as first
4.) ???????????
5.) Fixed
B
4
S
2
G
4
Posts: 719
Reputation: 2,938

Post » Sun Sep 28, 2008 2:32 pm

This .cap may not act like you want but it is not a bug. The 'Destroy' action simply sets a flag and continues to work exactly like normal. At the end of the event list, objects marked 'destroyed' are then really destroyed. It has to work like this unfortunately - the runtime needs to know that objects exist until one point. It also needs to be like this to give plugins a chance to remove references to the object that is being destroyed - otherwise these plugins would crash and there would be no way to fix it!
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Sun Sep 28, 2008 4:21 pm

if you tick the destroy on start up attribute instead does it still happen?
B
2
S
2
G
5
Posts: 236
Reputation: 2,122

Post » Mon Oct 06, 2008 8:19 pm

will have to try it.

thanks for the suggestion
B
4
S
2
G
5
Posts: 149
Reputation: 2,025


Return to Your tutorials & example files

Who is online

Users browsing this forum: Megavolt and 0 guests