'Associate Object with Peer' does not work with Families

0 favourites
  • 2 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • 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

    https://www.scirra.com/forum/download/file.php?mode=view&id=4445

    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 r176
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)