Multiplayer- host catching variables from peer?

  • I am making a multiplayer strategy war game and still struggling to make each player can choose his troops.

    Before connecting to the server or the host, a player enters an 'army selection' layout. There, one can choose the amount of each different unit he is going to use and their weapons/armor. Their stats are then stored as variables and its skins as animations/frames (I could make some sprites as layers and change effects if sync animations produces lag, doesn't matter, troops are not even animated at all).

    The point is when choosing his army, player is still offline. So I cannot send message or sync. I want the host catches those variables stored on peer's side, so it can create the right troops and set their right skins.

    Every tutorial I have seen takes a standard character for both players, so it is not explained. And the posts on the forum that talk about it just have links to capx explaining it, but none are still available for downloading.

    It must be something pretty basic, for many games allow for character/army/team customization offline, but I have no experience with multiplayer and cannot find any examples.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Store the variables in global variables

    Then, once the player has gone online, send messages to the host containing the variables

  • Thanks a lot. I misunderstood what 'send message' stands for. I thought it was like sync variable, but for strings. Now I see it's just that. One-time sending any given value as a string, not updating it automatically.

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