Loading, and Families, spawned extra instance

Report Construct 2 bugs here.

Post » Sat Jul 16, 2016 5:24 am

Problem Description
____ A concise description of your problem here ____
(Family) On created - spawn sprite2
Save game. Change layout
Load game.
Two (family spawned) sprites (sprite2) exist where only one is expected.

When a Family uses the spawn action and a layout is saved and then loaded, that action somehow is creating two instances of the object.


The capx makes it very clear.

Attach a Capx
____ Upload a Capx to this post ____
https://drive.google.com/open?id=0B0rmj ... mtvNm9ZeW8

Description of Capx
____ Concise description of what this CapX does ____
User spawns an instance from a family, family instance spawns an object (sprite2), save layout, go to new layout, load save and return to the first, now the family instance has created two sprite2s. Expected only one.

Steps to Reproduce Bug
  • Step 1 run in debug (or don't I added a textbox that shows object count)
  • Step 2 click create menu button
  • Step 3 click save button
  • Step 4 click next layout button
  • Step 5 click go back to first layout button

Observed Result
____ What happens? ____
There are two instances of sprite2

Expected Result
____ What do you expect to happen? ____
Only one instance of sprite2 should exist

Affected Browsers
[list]
[*] Chrome: YES
[*] FireFox: YES
[*] Internet explorer: YES

Operating System and Service Pack
____ Your operating system and service pack ____
windows 10

Construct 2 Version ID
____ Exact version ID of Construct 2 you're using ____
Construct 2 - 233 (64 bit)
B
10
S
2
Posts: 80
Reputation: 995

Post » Wed Aug 10, 2016 5:06 am

Also it looks like sprite mirroring doesn't save and load properly
B
10
S
2
Posts: 80
Reputation: 995

Post » Sun Aug 14, 2016 6:12 pm

Updated to include the mirror bug example


Description:
When loading from a save, mirrored objects do not hold their mirroring. This could be a symptom of the family spawning an extra instance if you observe the sprites in the bottom right, the arrows should always face the same direction. When loading from a save an extra instance of the 'head' will appear and maintain the correct mirror while the actual head (pinned to the body) will mirror incorrectly upon hitting a bounding edge (green line)

Download:
https://drive.google.com/open?id=0B0rmjtd4YynXc0NjTVBYUmdJRUE

Construct 2 Version: r233 (64 bit)
B
10
S
2
Posts: 80
Reputation: 995

Post » Fri Aug 26, 2016 10:04 am

Also experiencing this bug on double instances of families. Thought I was going nuts for a minute but then I figured it must be a bug. Ended up deleting the family but that didn't fix the issue. Still experiencing doubling of sprites.

Video of the Bug
B
56
S
15
G
13
Posts: 826
Reputation: 17,675

Post » Fri Aug 26, 2016 11:01 am

Dont think 'the creating' is a bug. (1st post)

When you go to next layout, menu is destroyed for memory reasons.
When you return to previous layout, menu gets recreated, triggering the 'on create' (event 2). The first one was there because of loading gameslot. You have to code that a little differend.

Move the actions under the 'on created' to the 'createmenu clicked' event block. Created problem solved.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Fri Aug 26, 2016 12:33 pm

second CapX, fixed as it should be

https://drive.google.com/open?id=0B1SSu ... nBUMzFPVVk
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950


Return to Bugs

Who is online

Users browsing this forum: No registered users and 0 guests