Syncing global value.

Posted by Uhaszysz
hi, i dont understand how syncronising objects works, could you explain little bit more?
i have global var which is global.hpCurrent and i want to share it over players and subtract some val if player will damage boss.

it could be damage number updated every second (count on client how much dmg have u done and send every second to other players. )

Replies (4)

Last message on 16 Feb 2021

Uhaszysz (Topicstarter) on 13 Feb 2021, 19:23:03
ok i have managed to do this by sending damaghe done by players and subtracting it from max hp but i have next problem.

How to make select players to render, like you have room_play and i want 2 or more teams in same room but playing diffrent games and dont see each others
Size43 (Administrator) on 14 Feb 2021, 15:34:50
It sounds like what you're looking for are sessions -- sessions allow you to separate players into different "sessions". They won't see each other, so if you put each team in a separate session you can let them play in the same room without seeing each other.
Uhaszysz (Topicstarter) on 16 Feb 2021, 00:57:30
Hi, i dont want to create new topic so i ask here. My game is rpg and there is many stats and i dont want to send them every frame with gms_self_set(); and same with getting. i want to sync these variables only once while obj_player_other is created.
Uhaszysz (Topicstarter) on 16 Feb 2021, 01:03:24
ohh i guess you just need to put these variables in right events or ifs. i was trying the onetime thing. this engine is epic.