• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece!🔗 Click here to enter!

What are the desync causes in this script?

Status
Not open for further replies.
Level 12
Joined
Jun 10, 2008
Messages
1,043
Hello Hive! I was wondering what are the desync causes when using this condition?
(Name as many as you can plz)
if GetLocalPlayer() == Player(0) then
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
every further function you call will disconnect every player but the host unless the only effect of it is visual (note: things like "ShowUnit" are not only visual because they also influence pathing and special effects are not shown but created so they will cause disconnect as well)

if you want to show something to a single player only you will always have to create it for all players
example for special effects:

set string = ""
if GetLocalPlayer() == udg_YourPlayer then
set string = "somepath.mdl"
endif
create specialeffect using s

this way you create something for all players but it looks like "" (nothing) for everyone but the specified player

for multiboards:

create an array of 12 multiboards
hide the multiboards for all players
show multiboard x for player x

again you will have to create all multiboards for every player
the only thing you can modify is the visibility

unfortunately in special cases it is possible that a player will be disconnected for no obvious reason
it is said that it might be caused by handle leaks where blizzards wrapper functions did not null them properly and therefore cause a desync but other things might be the matter as well

another thing to be careful with:
if you localy set things they don't sync over time
e.g. if you change a units flying height for local players and then later do something like "if flying height of unit is equal to x do something" it won't work well
 
Status
Not open for further replies.
Top