| 02-16-2010, 04:14 PM | #1 |
I have a problem: If the host is minimized in warcraft, and then the map call a periodic timer wich call a function that assigns each player a SetCameraField works for a while but after about 2 or 3 seconds all are disconnected. Why?? Is there any way to detect when the host or a player has minimized the warcraft? |
| 02-16-2010, 08:39 PM | #2 |
You could try moving the players' camera individually first to check. |
| 02-16-2010, 09:04 PM | #3 |
Yeah, but it would not be the same? Nor would create desyncs at init? In any case, how I could check if the player is minimized by moving the camera??? |
| 02-19-2010, 03:43 PM | #4 |
Pan cameras aren't applied when wc3 is minimized, so don't use the X/Y value of a camera in a way you can make a desycn, for example creating handles if the camera X/Y == <value> http://www.thehelper.net/forums/showthread.php?t=140251 More, unless the player can't change by itself the camera (camera locked) theses values are naturally local for each player, since each player can change the coordinates of the camera, with arrow keys, the mouse , double click on a an unit, pressing space bar, and maybe i forgot some other ones. EDIT : My previous code worked, i haven't tested the new one, but if i haven't make errors it still should work. The drawback list is not up-to-date in the main post, but the cons are still to huge to officially post "the system" as a resource imho, unless you really want it. |
| 02-19-2010, 08:18 PM | #5 |
Ok, I'll review your system. |
| 02-20-2010, 08:11 AM | #6 |
Provide a demo map or at least your triggers, i'm fairly sure you don't need a such detection. |
| 02-20-2010, 06:43 PM | #7 |
| 02-20-2010, 07:15 PM | #8 |
Well, now plz highlight me the code that cause a desync. |
| 02-22-2010, 01:55 AM | #9 | |
Quote:
JASS:function GamePostUpdate takes nothing returns nothing local integer i = 0 loop exitwhen i>11 if( GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING ) then //Here calls a function with several SetCameraField por GetLocalPlayer() if(IsCameraToPlayer[i])then if GameCamera.ApplyCameraForPlayer(Player(i), false) then call DGUIUpdate(true, true, true) endif endif endif set i = i + 1 endloop endfunction |
| 02-27-2010, 05:30 PM | #10 |
Hmm i don't see why it would desycn. |
