Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mensajes - Iros

676
Preguntas y respuestas / Re: [AYUDA] Unir dos engine
Febrero 08, 2010, 03:55:13 AM
Cita de: Wadk en Febrero 08, 2010, 01:59:34 AM
Si quer?s unir un juego de GM7 o anterior, vas a tener que abrirlo y guardarlo con GM8 primero.
Mi juego lo tengo en GM8. Por eso el icono del mensaje

brunoxzx: Osea que primero abro mi juego en GM8 y lo exporto y despues abro el otro y lo importo??

Solucionado, gracias por aclararme las dudas ^^
677
Preguntas y respuestas / [SOLUCIONADO] Unir dos engine
Febrero 08, 2010, 01:15:38 AM
Bueno, tengo un problema, estoy creando un juego, hasta hay todo bien, pero ahora estoy haciendo un editor de niveles y bueno, como todos los objetos tienen que ser los mismos que el juego, quer?a exportar el engine de mi juego al editor, pero no encontr? la opci?n de Marge Game que ten?a GM6 y GM7. ?Alguien tiene alguna soluci?n que no sea copiar todo manualmente?

Desde ya, muchas gracias.
678
Cita de: knd144 en Enero 20, 2010, 10:58:39 PM
Bueno, el GM tiene una herramienta propia para crear juegos online pero hasta donde s? esta es muy latosa, para ello est? la 38Dll que ya te han recomendado...
Se baj? un  poco la DLL esa xD.

En fin, yo estoy trabajando en un PLATAFORMAS ONLINE (ese es el nombre, no plagios xD) y te puedo decir que si no tenes experiencia en GML, no te pongas con el ONLINE (eduardo960 me lo dice siempre que le pregunto algo xD). Actualmente mi juego funciona, pero est? bugueado largando un error por llegar a PING m?ximo. Por eso te soy ese consejo, aprend? un poco mas de GML y como se usa esta DLL y despu?s empeza con tu juego ^^
679
Bueno, como dice el t?tulo, cuando trato de conectarme al cliente (basado en el ejemplo del kirby) me sale ese cartelito al llegar a Ping: 80ms.

?Cual puede ser la causa de ese error?

Lo mas extra?o es que no he modificado casi nada del ejemplo, solo un par de cosas (Twister sabe bien, ya lo llegu? a marear con mis problemas T_T).
Diganme que codes poner para ver cual puede ser el error.

Desde ya, muchas gracias ^^.
680
Lo mas extra?o es que el cliente que estoy haciendo tiene exactamente lo mismo que el del ejemplo, tiene los mismos script y todo :S. Este es el c?digo del step del cliente por si puede ser de hay el error:


/* ==================== */
/*       -START-        */
/* ==================== */
/*  Receiving Messages  */
/* ==================== */

//Create the variables to be used
var messagesize, messageid;

//Check for messages
while(1)
{
//Receive the message using TCP
messagesize = receivemessage(global.clienttcp);
//If no message was received, break
if (messagesize <= 0) break;
//If a message was received, get the message ID...
messageid = readbyte();
//Set the ping to 0 because we got a message
ping = 0;
//...and then use it to check what message it was
switch(messageid)
{
    //If the message ID is 1
    case 1:
    //Store the message as our player ID
    global.myid = readbyte();
    obj_player_self.alarm[0] = 1;
    //And then break from the loop. If you forget this part then you might get errors.
    break;

    case 2:
    //Server is full message
    closesocket(global.clienttcp);
    closesocket(global.clientudp);
    dllfree();
    show_message("Sorry! The server is full.");
    game_end();
    break;
   
    case 3:
    //New Player (create)
    var userid, name, user;
    userid = readbyte();
    user = instance_create(obj_personaje.xstart,obj_personaje.ystart,obj_personaje_other);
    user.pid = userid;
    name = readstring();
    user.username = name;
    players[userid] = user;
    script_addline(name + " has joined.",c_black);
    break;
   
    case 4:
    //New Player (chat message)
    var name, userid;
    userid = readbyte();
    name = readstring();
    user = players[userid];
    user.username = name;
    script_addline(name + " has joined.",c_black);
    break;
   
    case 5:
    //Update other players' positions
    value = readbyte();
    player = players[value];
    player.x = readshort();
    player.y = readshort();
    player.sprite_index = readshort();
    player.image_speed = readshort();
    player.image_index = readshort();
    break;
   
    case 6:
    //Player left
    var playerid, username;
    playerid = readbyte();
    username = readstring();
    script_addline(username + " has left.",c_black);
    with(players[playerid])
    {
    instance_destroy();
    }
    players[playerid] = -1;
    break;
   
    case 7:
    //The server has shut down
    show_message("The server has shut down.");
    game_end();
    break;
   
    case 8:
    //Chat message
    script_addline(readstring(),c_black);
    break;
   
    case 9:
    //Server message
    script_addline("Server: " + readstring(),c_red);
    break;
}
}

//If we didn't get anything, we add the time to our ping
ping += current_time - deltatime;
deltatime = current_time;
//Check to see if we timed out
if(ping > timeout)
{
show_message("You have timed out.");
game_end();
}
681
Eso ya lo intent?, ahora sale "0 as joined" y desde el cliente sale un cartel diciendo que no se pudo conectar :S
682
Bueno, como dice el t?tulo, cuando trato de ejecutar el servidor y me conecto como cliente, sale un error:



Y en step tengo esto:


//Message handling - See Message IDs.txt for more info.

/* ==================== */
/*       -START-        */
/* ==================== */
/* New Connection Stuff */
/* ==================== */

//Create the variables to be used
var clientsocket, player;

//First, accept any new connections
clientsocket = tcpaccept(servertcp,true);
//If no one is there, exit
if (clientsocket <=0) exit;

//Blocking mode
setsync(clientsocket,0);

//Receive the client's username
receivemessage(clientsocket);
name = readstring();

//Check for a free space
if (instance_number(obj_client) = 20)
{
//If there isn't a free space, we tell the client
clearbuffer();
writebyte(2);
sendmessage(clientsocket);
exit;
}
//Now we search through the player list to get the player's id. If a place in the list is -1 then that means that it's a free space
for(i=0; i < 20; i+=1)
{
//So when we find a -1 we break from the loop
if (global.players[i]==-1) break;
}
//Now, we send the player id to the client using message ID 1...
clearbuffer();
writebyte(1);
writebyte(i);
sendmessage(clientsocket);
//We create the player
player = instance_create(0,0,obj_client);
//Store their player id in the object
player.pid = i;
//Store the socket that they used to connect to the server with. NOTE: This will not be the same as the port specified in the tcpconnect() in the client.
player.tcp = clientsocket;
//Store their username
player.username = name;
//Then we store the player id in the player id list.
global.players[i] = player;

//...and then we send the player id and username to everyone else...
clearbuffer();
writebyte(3);
writebyte(i);
writestring(name,true);
with(obj_client)
{
if (id!=player)
{
sendmessage(tcp);
}
}

//...and then make all the clientz who are already on the server tell the new player that they're here.
with(obj_client)
{
if (id!=player)
{
clearbuffer();
writebyte(3);
writebyte(pid);
writestring(username,true);
sendmessage(clientsocket);
}
}

//None
setsync(clientsocket,1);

//Add "this player has joined" message
script_addline(name + " has joined.",c_black);
/* ==================== */
/*        -END-         */
/* ==================== */
/* New Connection Stuff */
/* ==================== */


Aclaro que no lo hice yo, es un ejemplo que solo lo estoy adaptando.

Desde ya, muchas gracias ^^