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 (5)
Last message on 14 Mar 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.
Size43
(Administrator)
on
14 Mar 2021, 16:02:01
Apologies for the delay. Variables you set with gms_self_set are only synced when they change. So for example, if you have a gms_self_set for a level variable in the step event, but the level variable never changes, the variable will only be sent to the server once. It doesn't hurt to put the gms_self_set in an if somewhere, but it might not be necessary.