HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

what would happen if only one player set a variable?

05-26-2004, 03:25 AM#1
fugly
what i mean is this

Code:
function test takes nothing returns nothing
  local integer x = 1
  if GetLocalPlayer() == Player(1) then
     set x = 2
  endif
endfunction

would this cause a De-sync when you use x again, or would x have a different meaning for player 1 than to every one else?
05-26-2004, 11:11 AM#2
AIAndy
That depends in what context you will use x since on one computer it will be 2 now, on all others it will be 1. As long as you use x only in unsynced natives like playing the sound udg_my_sound_array[x], that will not matter. But if you try to create x units, then it will inevitable desync.