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

[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