• 🏆 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!

GetLocalPlayer

Status
Not open for further replies.
Level 17
Joined
Mar 21, 2011
Messages
1,597
Hi,
i got a problem and dont know how to fix it.
I'm using this to show a unit just for one player. It is a light model and my Day/Night models are set to '0'.
  • Set TempPlayer = AnyPlayer
  • Custom script: if GetLocalPlayer() != udg_TempPlayer then
  • Unit - Hide Light[TempInt1]
  • Custom script: endif
well, that works, but as soon as i play it in multiplayer and the light unit(that is attached to a unit i control) comes into the screen of my friend, he Disconnects from game, even if he doesnt see it (because i hide it)

do you know how to fix it? or is there another way to hide units for certain players? i tried with Alpha set to 0 but that didnt work, obviously because the model is a light source
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
It is because it is a unit and visible for one player while hidden for another. Hidden units are fine until they start to be interacted with in which case the client behaviour is no longer deterministic so an out of synchronization error occurs.

Do note that hiding a unit influences units nearby as well. Hidden units will no longer be auto-targeted and are ignored from some searches.

Is a unit really necessary? Surely a special effect could work?
 
Status
Not open for further replies.
Top