How do I past a static variable to each peer

0 favourites
  • 1 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • Hi all,

    I need help (again)… I think there is a basic knowledge I don’t understand.

    I’m trying to make simple multiplayer game : 3 sqare (then 3 peers) which have car behavior.

    It works good.

    Now I would like to broadcast an information (player number) to each peer as is it done in tuto 3 “Real Time Game” with the statistic above the peer (health, kills…). So The second peer know which is the 1st, thierd peer..)

    The difference with tuto3 is that my variable to update on each peers is not “real time” variable, I mean the value of this variable is set one time on peer when it is created and not modified after.

    So if I understand the tuto, for this kind of transfer, no need to use sync object as is it done in tuto 3 with health for example. The send/broadcast message must be sufficient.

    Am I right on this point?

    So I’m looking on the tuto2 Chat room, but I can’t do what I want.

    Host block:

    When a peer connect I use broadcat function:

    Broadcast tag “majnum” message variable_num (from Multiplayer.fromID, mode ….)

    Peer block: (I want to affect the variable receive to the right peer)

    On peer message “majnum”  set instance variable from Multiplayer.fromID to variable_num

    Common block:

    Everythick: Set num player above each peer object

    (For each??)

    I think I don’t understand well the multiplayer syntax…

    Sorry for this explanation a little bit complex.

    Thx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)