C
Carcophan
Guest
Hello Everyone.
I was able to get the player to update their location on the map, but not the 'mouse click' they do on screen.
I figured I could just duplicate the movement portion of the object/scripts, but it doesn't seem to be working right.
Tried updating the above code, with this below:
(This is in a client_Receive packet script)
This is also from a 'Key Pressed' script:
I am getting an error because mouse_x and y are READ ONLY, while the X and Y of the movements are non-read only. How do I have to change the logic around to accommodate for this?
I was able to get the player to update their location on the map, but not the 'mouse click' they do on screen.
I figured I could just duplicate the movement portion of the object/scripts, but it doesn't seem to be working right.
Code:
case KEY_RELEASE: //movement
name = buffer_read(buffer,buffer_string);
key = buffer_read(buffer,buffer_u32);
xx = buffer_read(buffer,buffer_u32);
yy = buffer_read(buffer,buffer_u32);
if instance_exists(obj_slave)
{
with(obj_slave)
{
if playerName = other.name
{
x = other.xx;
y = other.yy;
key[other.key] = false;
}
}
}
break;
case KEY_PRESSED:
//same as Release code basically
break;
Code:
case CLICK_LEFT: //action click
name = buffer_read(buffer,buffer_string);
key = buffer_read(buffer,buffer_u32);
xxx = buffer_read(buffer,buffer_u32);
yyy = buffer_read(buffer,buffer_u32);
if instance_exists(obj_slave)
{
with(obj_slave)
{
if playerName = other.name
{
mouse_x = other.xxx; //not allowed
mouse_y = other.yyy; //not allowed
}
}
}
break;
This is also from a 'Key Pressed' script:
Code:
buffer_seek(CLIENT.client_buffer,buffer_seek_start,0);
buffer_write(CLIENT.client_buffer,buffer_u8, argument0);
buffer_write(CLIENT.client_buffer,buffer_u32, argument1);
buffer_write(CLIENT.client_buffer,buffer_u32, x);
buffer_write(CLIENT.client_buffer,buffer_u32, y);
buffer_write(CLIENT.client_buffer,buffer_u32, mouse_x);//added this here, because it felt right
buffer_write(CLIENT.client_buffer,buffer_u32, mouse_y);//added this here, because it felt right
I am getting an error because mouse_x and y are READ ONLY, while the X and Y of the movements are non-read only. How do I have to change the logic around to accommodate for this?
Last edited by a moderator: