I have 2 basic projects that only contain objects needed to connect to each other. One project being for the client and the other is the server. The client passes mouse_x and mouse_y location to the server and is then read through an async event. Then finally the mouse coordinates from client are printed out in the server's output window. This all currently works.
Now I want to be able to make instances appear in other windows. I know that instance_create has been deprecated and no longer works at run time so either instance_create_depth() or instance_create_layer() is needed. Though I'm not fully sure what either are fully doing or if i'm even using them correctly.
I figured this code would create a circle on the server window exactly where it was clicked on in the client window. I don't believe I need to pass the client's layer id or anything of that sort through the buffer if they have the same room size. But I could be wrong.
then I tried the same with instance_create_depth()
Any direction is greatly appreciated. Thank you for reading.
Now I want to be able to make instances appear in other windows. I know that instance_create has been deprecated and no longer works at run time so either instance_create_depth() or instance_create_layer() is needed. Though I'm not fully sure what either are fully doing or if i'm even using them correctly.
I figured this code would create a circle on the server window exactly where it was clicked on in the client window. I don't believe I need to pass the client's layer id or anything of that sort through the buffer if they have the same room size. But I could be wrong.
Code:
//create event code
var layer_id = layer_get_id("Background");
//async event code
var m_x = buffer_read(buffer, buffer_u32); // mouse x
var m_y = buffer_read(buffer, buffer_u32); // mouse y
instance_create_layer(m_x, m_y, layer_id, obj_circle);
//the obj_circle has a draw event on the server project that uses draw_circle_color()
Code:
//create event code
var layer_id = layer_get_id("Background");
var layer_dpt = layer_get_depth(layer_id);
//async event code
var m_x = buffer_read(buffer, buffer_u32); // mouse x
var m_y = buffer_read(buffer, buffer_u32); // mouse y
instance_create_depth(m_x, m_y, layer_dpt, obj_circle);