• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Localplayer again

Status
Not open for further replies.
Level 5
Joined
Jan 12, 2010
Messages
132
Tested with sfx as u guys show me work,at last for some time.
Tested :
  • ///hand written sry///
  • Unit - Create a unit x at temp_point etc etc
  • Set - Local_player = player 1 red
  • Custom Script: if ( not ( GetLocalPlayer () == udg_Local_player ) ) then
  • Unit - Hide (last created unit)
  • Custom Script: endif
This desync and disconnect 100%.Also tested this code on a blank map with some friends and dont work.
Any sugestion about how to hide a unit for rest of players without creating desync?
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
incorrect.

unit must have locust. if the unit has locust, this will never desync.

also,

not GetLocalPlayer() == udg_Local_Player -> GetLocalPlayer() != udg_Local_Player

if your just being stubborn than this also works

  • Test 1
    • Events
    • Player - Player 1 (Red) types a chat message containing test as An exact match
    • Conditions
    • Actions
    • Set Player = (Triggering player)
    • Set Unit = Peasant 0000 <gen>
    • Set Alpha = 100
    • Custom script: if GetLocalPlayer() == udg_Player then
    • Set Alpha = 0
    • Custom script: endif
    • Animation - Change Unit's vertex coloring to (100%, 100%, 100%) with Alpha transparency
 
Level 5
Joined
Jan 12, 2010
Messages
132
ok tested
this code desync but in time (not instant)
Code:
if ( not ( GetLocalPlayer () == udg_Local_player ) ) then
your code seems not to desync,dont sure in what happens in time
Code:
if GetLocalPlayer() != udg_Local_player then
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
As I have mentioned before, if you apply a global function (outside the GetLocalPlayer block), that function will be applied to all players compared to the function you call insided a GetLocalPlayer block.

NOTE: Just apply the function outside the GetLocalPlayer block - while inside the block, you just set the variable.
 
Level 17
Joined
Apr 27, 2008
Messages
2,455
As I have mentioned before, if you apply a global function (outside the GetLocalPlayer block), that function will be applied to all players compared to the function you call insided a GetLocalPlayer block.

NOTE: Just apply the function outside the GetLocalPlayer block - while inside the block, you just set the variable.

It's just the same here ...
You know even some GUI functions use GetLocalPlayer in this way, there is no need to add overhead with a variable.

But as said hide an unit for a specific player is likely to desync, locust unit or not.
The safe way is to "hide" the unit with color setting :

http://www.hiveworkshop.com/forums/2259413-post22.html
 
Level 5
Joined
Jan 12, 2010
Messages
132
Dummy unit have the moddel of some missiles.So what u suggest me to use?
And another question,as I know so far a hidden unit dont make lagg,what about a unit with 100% transparency?

I guess I`ll use Arhowk method.Hope it works.
 
Status
Not open for further replies.
Top