theCapypara / GMnet-ENGINE

A multiplayer/networking engine for Game Maker Studio

Home Page:https://gmnet-engine.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't get variable to sync

Caboosie opened this issue · comments

I am trying to sync a variable self.character between two clients and can't seem to get it to work.

under the create step I have the following:
mp_sync();
mp_add("char","character",buffer_u8,10);
mp_setType("char",mp_type.IMPORTANT);

then in the begin step:
mp_map_syncIn("char",self.character);

then in the end step
self.character = mp_map_syncOut("char",self.character);

it is important to note i do have a value being set before the initial syncIn for char and with the debug menu I have confirmed that value it being registered so I am not sure where the error may be.

As my own attempt to debug I also have an event under a key press which changes the value of self. character and then sends it out

if (htme_isLocal())
{
self.character +=1
mp_map_syncIn("char",self.character);
}

I can view my value for "char" changing in the debug menu but my other instance (who updates position just fine) refuses to update its self.character value.