| 04-03-2003, 04:53 PM | #1 |
UMSWE has an new function called 'Local Player' - What does it do ? It must be quite usefull because someone wanted it to be implemented in the standard GUI at the TFT WE Wishlist. BTW - Please don't reply: It returns the local player. What I mean is who it the 'local player'?? |
| 04-03-2003, 05:28 PM | #2 |
The scripts are running on every computer in the game. GetLocalPlayer returns the player that is used by the computer the script is running on. That means when you use local player the script is not run the same way on every computer. This is one of the main reasons for desyncs because if you e.g. create a unit using local player the unit is not created on every computer in the same way. To avoid that only use local player with input or output. The things you can do with it are e.g. select units only for a specific player, ping the minimap for a player, ... . |
| 04-03-2003, 06:10 PM | #3 |
Local player is extremely useful for selections. By using GetLocalPlayer, you can select a unit for a single player. For example, Code:
if GetLocalPlayer() == ConvertedPlayer(2) then
call SelectUnitSingle( gg_hcas_0001 )
endif
call SyncSelections()AFAIK, you need to add SyncSelections() whenever you use GetLocalPlayer(), if you want to avoid a desync. |
