Jump to content


Photo

Multiplayer Servers... HELP!


  • Please log in to reply
4 replies to this topic

#1 rushlight

rushlight

    GMC Member

  • GMC Member
  • 20 posts
  • Version:GM8

Posted 11 April 2012 - 11:50 PM

I'm to lazy to type my problem out again, so here's the link to the original post: http://gmc.yoyogames...4
Any and ALL help is much appreciated. Posted Image
  • 0

#2 Alibaba994

Alibaba994

    GMC Member

  • New Member
  • 18 posts

Posted 12 April 2012 - 11:13 PM

are you using mplay or 39dll? I suggest using the 39dll, because you can do online. i think that mplay can only do lan... but im not sure.
  • 0

#3 rushlight

rushlight

    GMC Member

  • GMC Member
  • 20 posts
  • Version:GM8

Posted 12 April 2012 - 11:37 PM

Nope, only using normal GM8.0 Please read the thread - link at the top of the page-
i figured out a sort of solution, in semantics at least, i just need help with the code, and plausibility.
  • 0

#4 Alibaba994

Alibaba994

    GMC Member

  • New Member
  • 18 posts

Posted 13 April 2012 - 12:06 AM

ok so for mplay i would do this for player syncing...


sync the host on the clients computer

//the step event for the controller which sends the data to the client

if global.host = false
exit

with(obj_player)
{
if x != xprevious
mplay_data_write(0,x)

if y != yprevious
mplay_data_write(1,y)

mplay_data_write(2,image_angle)

if shooting = true
{
mplay_message_send_guaranteed(0,3,1)
}

}


then the client would receive it.

if global.host = true
exit

with(obj_player)
{

x = mplay_data_read(0)
y = mplay_data_read(1)
image_angle = mplay_data_read(2)

}

  while (mplay_message_receive(0))
  {
    messid = mplay_message_id();
    val = mplay_message_value();
    if (messid == 3)
{
//this is where your shooting code goes..
n.instance_create(obj_player.x,obj_player.y,bullet)
n.direction = obj_player.direction
n.speed = 15
}

if (messid == 4)
{
room_goto(val) // recieve what room to go to
}
  }



to sync the client on the hosts computer would be the same thing just with different message id's and objects in the "with()"

to start the game on the same level and the same time i would do this for the host

if global.host = false
exit

if global.starting = 1
{
mplay_message_send_guaranteed(0,4,room_play)
room_goto(room_play)
}


then the client would receive it, which is already in the code snippet above. im not sure if this works cuz i didnt test it and its been a while since i did mplay, but i believe it will. try it out and good luck. :P
  • 0

#5 rushlight

rushlight

    GMC Member

  • GMC Member
  • 20 posts
  • Version:GM8

Posted 13 April 2012 - 03:49 PM

wow, thanx, thats all i need for now. Hope this works.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users