ruffle icon indicating copy to clipboard operation
ruffle copied to clipboard

A Small Favor - Duplicate Cigars

Open TomFulp opened this issue 5 years ago • 2 comments

https://www.newgrounds.com/portal/view/495164/format/flash?emulate=flash

At the start of the game, collect the gun and cigar at the bottom left of the screen. Exit the room through the door at the top. Come back into the room. The gun and cigar are on the table again. If you pick up the cigar again you will get a second (and then a third) in your inventory.

In the Flash player version, the gun and cigar are gone after you've collected them the first time.

TomFulp avatar Dec 02 '20 22:12 TomFulp

I've added some traces in function onLoad() located in \__Packages\item:

trace("this.id: " + this.id);
trace("this.collectable: " + this.collectable);

In Ruffle, this.id will always be undefined and this.collectable always false. Flash seems to change the values if these properties are declared as variables or properties inside a DefineSprite (eg. \DefineSprite (611: item_gun)\frame 1\DoAction for the gun).

Also worth noting that wrapping the onLoad() function inside a setTimeout fixes the issue - with a little delay of course.

Toad06 avatar Dec 04 '20 16:12 Toad06

In this case, the onLoad should run after the frame 1 actions, but Ruffle runs it in the wrong order. Some quick testing makes it seem like if there are no onClipEvents placed on a timeline sprite, then the frame actions should run first; otherwise, for example if you add onClipEvent(load), the load events run first. Need to do a little more investigation.

Herschel avatar Dec 24 '20 10:12 Herschel