• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

This trigger has a problem.. Help

Status
Not open for further replies.
Level 5
Joined
Mar 17, 2005
Messages
135
Why does this trigger kick all other players from the game. I don't really see anything wrong with it other than leaks.

  • Cinematic
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Cinematic - Turn cinematic mode On for (All players)
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Farmer for (Picked player) at ((Picked player) start location) facing (Center of (Playable map area))
          • Special Effect - Create a special effect at ((Picked player) start location) using Objects\Spawnmodels\NightElf\EntBirthTarget\EntBirthTarget.mdl
          • Special Effect - Destroy (Last created special effect)
          • Selection - Select (Units owned by (Picked player) of type Farmer) for (Picked player)
      • Cinematic - Send transmission to (All players) from a (Picked player) Farmer named Palermo1 at ((Picked player) start location): Play No sound and display |c0000ff33Protect y.... Modify duration: Add 10.00 seconds and Wait
      • Cinematic - Turn cinematic mode Off for (All players)
 
Level 7
Joined
May 3, 2007
Messages
210
The problem is in the Selection line, this works fine:

  • Untitled Trigger 001
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Cinematic - Turn cinematic mode On for (All players) over 0.20 seconds
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Footman for (Picked player) at ((Picked player) start location) facing Default building facing degrees
          • Special Effect - Create a special effect at ((Picked player) start location) using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
          • Special Effect - Destroy (Last created special effect)
      • Cinematic - Send transmission to (All players) from a (Picked player) Footman named Pal at ((Picked player) start location): Play No sound and display Sup. Modify duration: Add 0.00 seconds and Wait
      • Cinematic - Turn cinematic mode Off for (All players) over 0.20 seconds
Throw the selection trigger in there and it all goes to hell.

And here's why:

JASS:
function SelectGroupForPlayerBJ takes group g, player whichPlayer returns nothing
    if (GetLocalPlayer() == whichPlayer) then
        // Use only local code (no net traffic) within this block to avoid desyncs.
        call ClearSelection()
        call ForGroup( g, function SelectGroupBJEnum )
    endif
endfunction

Should be self explanatory, but if you don't understand GetLocalPlayer() + Most Handles = Desync.

Oh btw ignore the slight deviations between your GUI and mine ... I didn't copy yours directly >.>
 
Status
Not open for further replies.
Top