• 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.

[JASS] GetLocalPlayer() problem

Status
Not open for further replies.
Level 6
Joined
Oct 23, 2011
Messages
182
I have problem saving values to variables retrieved from local player functions. Is there any way to get around this problem?
Below code causes disconnections..

JASS:
local integer i = 8
            
loop
    set i = i - 1
                
    if GetLocalPlayer() == Player(i) then
        set sight[i] = GetCameraField(CAMERA_FIELD_TARGET_DISTANCE)
    endif
                
    exitwhen i == 0
endloop
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
unless your synchronizing the array, you dont need to set all the variables. just set sight = GetCameraField and it will be different for all
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
thank you. that wont cause desync right

well of course it will. -_- if you do anything with it.

so if u set i = GetCameraField(whatever)
CreateUnit(i in one of these fields)

it will desync because i isnt the same for all players.

but if u just leave it and dont do anything it wont desync
 
Status
Not open for further replies.
Top