'Associate Object with Peer' does not work with Families

Bugs will be moved here once resolved.

Post » Wed Aug 06, 2014 5:51 pm

@Ashley Regarding the previous bug I posted (https://www.scirra.com/forum/associate-object-with-peer-does-not-work-with-families_t111829)-- Apologies, I may have written the .capx incorrectly. However, the bug still stands when it's written differently.

Problem Description
The 'Associate Object with Peer' action only works with individual objects, and not with instances of a Family.

Attach a Capx

Description of Capx
The CAPX is exactly the same as the Multiplayer Real-Time Game tutorial, with a few modifications in Game Events. I've removed all of the "Associate Object with Peer" statements, and created a function that does the following (search for the comment "MODIFICATION":

Every 5 Seconds
For Each PeerFamily
Peer - Pick instance with UID PeerFamily.UID
-> Associate PeerFamily with Peer.peerid

This will cause the bug to occur. However, the bug does NOT occur if I swap out the Action for the following:
-> Associate Peer with Peer.peerid
Using this method works completely fine. All I'm doing differently is Associating the Peer instead of PeerFamily.

Steps to Reproduce Bug
  • Step 1 - Run the game from the Login screen as you would normally to create a Host.
  • Step 2 - Open a second game window to create a Peer.
  • Step 3 - Wait for the logs to appear in both windows "Associated <Peer.uid> with ...".
  • Step 4 - Close the Peer window.

Observed Result
In the Host window, the Peer object is not destroyed, indicating that the association did not take place.

Expected Result
Object associated with Peer should be destroyed.

Affected Browsers
[*] Chrome: (YES)
[*] FireFox: (YES)

Operating System and Service Pack
____ Windows 8 64-Bit ____

Construct 2 Version ID
You do not have the required permissions to view the files attached to this post.
(M.A.D. are my initials. I'm not the least bit angry, really!)
Posts: 41
Reputation: 1,671

Post » Wed Aug 13, 2014 5:17 pm

That event is nonsense: why would you want to do that every 5 seconds? That goes against correct usage of the 'Associate object' action: it should only be used in multiplayer events like when peers join, like the tutorials describe. I'm afraid I'm going to close this because the example given does not appear to be a valid use of the action so there's no need to fix anything with it.

Remember families and objects pick their instances separately; I also don't know why you are trying to pick an object by its UID from a family it's also in, when you could just reference the family instead.
Scirra Founder
Posts: 25,082
Reputation: 199,772

Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 6 guests