Multiplayer Help! lots of Question

Get help using Construct 2

Post » Fri Apr 24, 2015 7:03 pm

Question 1.
How do I remove a peer character after disconnecting?
Info:In my game currently the player stays on the host screen after disconnecting but vanishes on peer screens. The disconnected peer causes Invisible walls to occur for other peers.
Question 2.Is it possible for a peer to have a save file for their character saved locally ?
Info:I need player character data to be saved locally,how do I save certain variables and then reload them upon creation of that peer.
Question 3. how do I host a server instead of players hosting?
Info: I can not find a tutorial on this. I have seen the server for sale in scirra store but not sure if it is what I need to Host a server for an Android MMO from my windows computer. I have bee nable to host a game from an emulation on my computer and have peers from phones join that but I fear this would not work with a large number of players.
Question 4.How to add PvP?
Info:my peers all carry the same object so how do I tell it to collide with other peers object but not its own?

Thank you for taking the time to read this.
B
11
S
1
Posts: 57
Reputation: 664

Post » Fri Apr 24, 2015 7:22 pm

1)
Common
On peer disconnect, Multiplayer.PeerID should reference the object(s)** to be destroyed.
2)
When a game starts and you have your own variables stored locally or from some ajax, you can simply set those values and relay them through the host with the other players. When a new player joins, it should request those values from the host.
3)
The current multiplayer mechanics are geared toward web based hosts and peers.
The signalling server in the store is for a dedicated hosting of server that allows the connections between web hosts and peers, not a game host itself.
For MMOs you could look into Ajax and PHP to centralize a player database.
4)**
As with point 1, you simply need to add references. Though you synch the peer object, with PeerID, you can pass that peer id to anything you create while creating the players assets.

Player.peerid = 01A0
Hitbox.peerid = 01A0
Sword.peerid = 01A0
Helmet.peerid = 01A0


On peer disconnect
Pick objects with peerid = 01A0 (Multiplayer.PeerID) and destroy.

Voor PvP make them enter a room with max 2 players :)
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572

Post » Fri Apr 24, 2015 11:13 pm

question one resolved.Thank you that works simple enough.
Image

Question 2-3:I will start looking into ajax,didn't know where to start this is big help again Thank you.

Question 4"Image

This is not working,maybe because I am setting peer ID on main hand improperly. where Under peer group mainhand on created set variable peerID to Multiplayer.Myid
B
11
S
1
Posts: 57
Reputation: 664

Post » Sat Apr 25, 2015 4:12 am

Add pick all MainHand above the pick by evaluate.

But, the mainhand is already involved in the collision,

Shouldnt it then be:

Mainhand on collision with hitbox
Pick all peer
pick peer where peer.peerid = mainhand.peerid


or

Mainhand on collision with hitbox
Pick all peer
pick peer where peer.peerid = hitbox.peerid


depending on who is doing what
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572

Post » Sun Jul 19, 2015 3:45 am

We need some help with the local storage.

Were attempting to save instance variables for each peer locally. I would rather save an array for each player individually if that's an option. Neither of which work for us.

The webstorage is saving but it seems either it only updates on the host side or it triggers for ALL peers on one screen. I must be missing a command does anyone have an example or tutorial for updating the local storage for only one peer at a time and have the host relay that?
B
15
S
2
Posts: 69
Reputation: 1,270

Post » Sun Jul 19, 2015 4:26 am

Ugh this is killing me this one simple thing.Image



Okay so the collision should trigger the webstorage per peer which should save that data to the player locally and when they login they should be able to load that data for themselves and check for the guns other people have. what am i doing wrong?

This is what i want to achieve:
So when each player touches the gun they pick it up until they die and keep it on log out.
B
15
S
2
Posts: 69
Reputation: 1,270

Post » Mon Aug 29, 2016 9:31 am

best way thx you so much
B
11
S
1
Posts: 28
Reputation: 1,963


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 17 guests