How do I find out in the multiplayer chat what is the maximum possible number of chat participants?

0 favourites
  • 3 posts
From the Asset Store
Chat with smart animals using the OpenAi Chat GPT 3 API
  • Hi!

    Ashley I really can't find anywhere how I can display the maximum possible number of users in the chat (Max peers).

    I'm using the "multiplayer chat" example and I need to display the maximum possible number of people in the chat there.

    Because max peers can change and I need to know how many max peers this host has in this chat.

    I found something similar in the documentation "Multiplayer.ListRoomMaxPeerCount(index) ", but it is not clear what the index means? I just need to output the max peers of the host.

    Ashley I really hope for your help!

    Tagged:

  • The listroom expressions are used in an "On room list" trigger event.

    To get this event to trigger, you'll need to use the "Request room list" action.

    The index will specify which room's information you want from that list, as the list can contain multiple rooms.

    To get the index number of your current room, you're going to loop through the list until you find the index of the room that matches "CurrentRoom". It will look something like:

    On room list
    Repeat Multiplayer.ListRoomCount times
    Compare two values "Multiplayer.ListRoomName(loopindex)" = "Multiplayer.CurrentRoom"
    
    Set text to "Multiplayer.ListRoomMaxPeerCount(loopindex)"
    Stop loop
    
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you so much!!! I figured it out and everything worked out! Without your detailed instructions, I would never have guessed :) Because the Multiplayer documentation contains only general information without examples. Thanks again!!!

    The listroom expressions are used in an "On room list" trigger event.

    To get this event to trigger, you'll need to use the "Request room list" action.

    The index will specify which room's information you want from that list, as the list can contain multiple rooms.

    To get the index number of your current room, you're going to loop through the list until you find the index of the room that matches "CurrentRoom". It will look something like:

    > On room list
    Repeat Multiplayer.ListRoomCount times
    Compare two values "Multiplayer.ListRoomName(loopindex)" = "Multiplayer.CurrentRoom"
    
    Set text to "Multiplayer.ListRoomMaxPeerCount(loopindex)"
    Stop loop
    
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)