• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Server splits in a simple series of triggers

Status
Not open for further replies.
Level 6
Joined
Oct 19, 2007
Messages
57
-I deleted all custom models
-I used a custom lumber and food icon ( just black pictures with 1x1 pixels )
-I used a custom gold icon http://www.hiveworkshop.com/forums/icons-541/btnmap-154859/?prev=search=map&d=list&r=20
-I made terrain with standard models and edited the scaling value
This is all of start game trigger

  • Startgame
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Sound - Stop music Immediately
      • Sound - Play SadMystery <gen>
      • Sound - Play Startgame <gen>
      • Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Visibility across (Playable map area)
      • Visibility - Create an initially Enabled visibility modifier for Player 2 (Blue) emitting Visibility across (Playable map area)
      • Visibility - Create an initially Enabled visibility modifier for Player 3 (Teal) emitting Visibility across (Playable map area)
      • Visibility - Create an initially Enabled visibility modifier for Player 4 (Purple) emitting Visibility across (Playable map area)
      • Visibility - Create an initially Enabled visibility modifier for Player 5 (Yellow) emitting Visibility across (Playable map area)
      • Visibility - Create an initially Enabled visibility modifier for Player 6 (Orange) emitting Visibility across (Playable map area)
      • Visibility - Create an initially Enabled visibility modifier for Player 7 (Green) emitting Visibility across (Playable map area)
      • Visibility - Create an initially Enabled visibility modifier for Player 8 (Pink) emitting Visibility across (Playable map area)
      • Visibility - Create an initially Enabled visibility modifier for Player 9 (Gray) emitting Visibility across (Playable map area)
      • Visibility - Create an initially Enabled visibility modifier for Player 10 (Light Blue) emitting Visibility across (Playable map area)
      • Visibility - Create an initially Enabled visibility modifier for Player 11 (Dark Green) emitting Visibility across (Playable map area)
      • Visibility - Create an initially Enabled visibility modifier for Player 12 (Brown) emitting Visibility across (Playable map area)
      • Set People[(Player number of Player 1 (Red))] = People 0212 <gen>
      • Set People[(Player number of Player 2 (Blue))] = People 0213 <gen>
      • Set People[(Player number of Player 3 (Teal))] = People 0214 <gen>
      • Set People[(Player number of Player 4 (Purple))] = People 0215 <gen>
      • Set People[(Player number of Player 5 (Yellow))] = People 0216 <gen>
      • Set People[(Player number of Player 6 (Orange))] = People 0217 <gen>
      • Set People[(Player number of Player 7 (Green))] = People 0218 <gen>
      • Set People[(Player number of Player 8 (Pink))] = People 0219 <gen>
      • Set People[(Player number of Player 9 (Gray))] = People 0220 <gen>
      • Set People[(Player number of Player 10 (Light Blue))] = People 0221 <gen>
      • Set People[(Player number of Player 11 (Dark Green))] = People 0222 <gen>
      • Set People[(Player number of Player 12 (Brown))] = People 0223 <gen>
      • Set UnitGroup = (Units in (Playable map area) matching (((Owner of (Matching unit)) slot status) Equal to Is unused))
      • Unit Group - Pick every unit in UnitGroup and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • Custom script: call DestroyGroup (udg_UnitGroup)
      • Wait 0.50 seconds
      • Set UnitGroup = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to People))
      • Unit Group - Pick every unit in UnitGroup and do (Actions)
        • Loop - Actions
          • Set Allplayer = (Number of units in UnitGroup)
      • Custom script: call DestroyGroup (udg_UnitGroup)
      • Trigger - Run RegisterTimer <gen> (checking conditions)
  • Floating Text
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Set Point = (Center of Region 040 <gen>)
      • Floating Text - Create floating text that reads Register for the ba... at Point with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Set FloatingText[1] = (Last created floating text)
      • Custom script: call RemoveLocation (udg_Point)
      • Set Point = (Center of Region 043 <gen>)
      • Floating Text - Create floating text that reads Choose an units at Point with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Set FloatingText[2] = (Last created floating text)
      • Custom script: call RemoveLocation (udg_Point)
      • Set Point = (Center of Region 056 <gen>)
      • Floating Text - Create floating text that reads Got 100 score to wi... at Point with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Set FloatingText[3] = (Last created floating text)
      • Custom script: call RemoveLocation (udg_Point)
      • Set Point = (Center of Region 062 <gen>)
      • Floating Text - Create floating text that reads Rapidly press B for... at Point with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Set FloatingText[4] = (Last created floating text)
      • Custom script: call RemoveLocation (udg_Point)
      • Set Point = (Center of Region 004 <gen>)
      • Floating Text - Create floating text that reads Waiting for you que... at Point with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Set FloatingText[5] = (Last created floating text)
      • Custom script: call RemoveLocation (udg_Point)
  • Helps
    • Events
      • Time - Elapsed game time is 3.00 seconds
    • Conditions
    • Actions
      • Quest - Create a Required quest titled |cff5AF7FFInformati... with the description |cff5AF7FFMAP TYPE ..., using icon path war3mapPreview.tga
      • Quest - Create a Optional quest titled |cff5AF7FFCredits|r with the description |cff5AF7FFThanks fo..., using icon path ReplaceableTextures\CommandButtons\BTNBansheeMaster.blp
      • Quest - Create a Required quest titled |cff5AF7FFHow to fi... with the description |cff5AF7FFFighting ..., using icon path ReplaceableTextures\WorldEditUI\Editor-Random-Building.blp
  • Leaderboard
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Leaderboard - Create a leaderboard for (All players) titled |cffFFDE19Highest s...
      • Set Leaderboard = (Last created leaderboard)
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player((Integer A))) slot status) Equal to Is playing
            • Then - Actions
              • Leaderboard - Change the display style for Leaderboard to Show the title, Show labels, Show values, and Hide icons
              • Leaderboard - Add (Player((Integer A))) to Leaderboard with label (Name of (Player((Integer A)))) and value ((Player((Integer A))) Current gold)
              • Leaderboard - Show Leaderboard
            • Else - Actions
  • RegisterTimer
    • Events
    • Conditions
    • Actions
      • Trigger - Turn on Register <gen>
      • Unit - Unhide Circle of Power 0012 <gen>
      • Countdown Timer - Start RegTimer as a One-shot timer that will expire in 30.00 seconds
      • Countdown Timer - Create a timer window for RegTimer with title |cffDEFFD6Registeri...
      • Set RegTimerWindow = (Last created timer window)
      • Countdown Timer - Change the color of the time for RegTimerWindow to (0.00%, 50.00%, 25.00%) with 0.00% transparency
      • Countdown Timer - Show RegTimerWindow
      • Set Register = 0
I'm so sad about this :cry:
 
desyncs are hard to correct and to find.

Did you tested with a host-bot ? Did you tested with another host ?

After, i think that you can optimise your trigger :

  • For each (Integer A) from 1 to 12, do (Actions)
    • Loop - Actions
      • Visibility - Create an initially Enabled visibility modifier for (Player((Integer A))) emitting Visibility across (Playable map area)
  • Set People[1] = People 0212 <gen>
  • Set People[2] = People 0213 <gen>
  • Set People[3] = People 0214 <gen>
  • Set People[4] = People 0215 <gen>
  • Set People[5] = People 0216 <gen>
  • Set People[6] = People 0217 <gen>
  • Set People[7] = People 0218 <gen>
  • Set People[8] = People 0219 <gen>
  • Set People[9] = People 0220 <gen>
  • Set People[10] = People 0221 <gen>
  • Set People[11] = People 0222 <gen>
  • Set People[12] = People 0223 <gen>
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
1) Your StartGame Trigger could be improved:

- For Visibility - Pick every player and do: Create Visibility for Picked Player.
- Set All Players = "Counter Player in Player Group -> All Players matching -> Slot status is equal to IsPlaying / User".
- Wait action is not necessary.

2) Floating Text is ok, but you can do it on map map init, same than Startgame

3) Quests are ok too, but can be created on Map Init.

4) For each integer a from 1 to AllPlayers <- This variable already checks the users playing.

- You are showing the leaderboard for each integer A... That's bad, since it shows for everyone. So, do that action outside the loop. The If/Then/Else is not needed.

5) Seems ok, but if you're not going to use the RegisterTimer again, you don't need to turn it on. You can run triggers that are off from other triggers. (As far as I know) You can even destroy it if you're not going to use it anymore.

Try these suggestions and check if it works. I've never used leaderboards, but that "Show Leaderboard" several times inside a loop looks bad to me.

Also, I would prefer to create the units for the players that are Playing rather than removing the pre-placed units for players that aren't playing. In that case, you can do:

  • For each Integer A From 1 to AllPlayers do:
    • Loop
      • Create 1 (Unit-Type-Of-Your-*People*) for Player(Integer A)
      • Set People[Integer A] = Last Created Unit
You can then move them to where you want.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Really...? Then I guess I'll have to create all my currently working quests in Time 0.00 rather than on Map Initialization.

When I say "Map Init" I mean under the event "Map Initialization". And they work, since I do it for about 7 quests, and works, also setting quests and quest requirements to variables.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
You get the name of players when generating your leaderboard. This generates a string. The problem is that the string generated is potentially localized and this might be different depending on the language of WC3 that is in use. This should only be the case for computer slots and you do attempt to filter only actual players for the board.

Do make sure that this part of the script is actually working correctly and not adding non-human players to the leaderboard. All it needs is one non-human player to be added to this leaderboard using its localized name and it could split clients from the game. Strings must be syncrinious at all times, creation of a local string will quickly cause a split.

If this is not the problem you have no choice but to turn off parts of script until you find the cause.
 
Level 9
Joined
Apr 26, 2011
Messages
403
I found another possible reason for desync:

if host have bad/error/wrong setting in their network/firewall, it can cause desync

because this is what happen to me :

Version A:
- most people never get desync, but 2 players keep report desync happen to them, I still can't find out why

Version B: (I turn off code that cause desync, code only turn on with certain command)
- my tester never get desync with command to turn it on
- one day, he have mass desync ... later he found out it only happen to him
- so he reset/restart his network setting...desync GONE !!

so, network setting or firewall can cause desync (if it try block some of important data but unusually data like W3MMD)
 
Does the desync occur every time? Does it occur only at the very start of the map?

If I were you, I would try replacing this:
  • Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Visibility across (Playable map area)
    • Visibility - Create an initially Enabled visibility modifier for Player 2 (Blue) emitting Visibility across (Playable map area)
    • Visibility - Create an initially Enabled visibility modifier for Player 3 (Teal) emitting Visibility across (Playable map area)
    • Visibility - Create an initially Enabled visibility modifier for Player 4 (Purple) emitting Visibility across (Playable map area)
    • Visibility - Create an initially Enabled visibility modifier for Player 5 (Yellow) emitting Visibility across (Playable map area)
    • Visibility - Create an initially Enabled visibility modifier for Player 6 (Orange) emitting Visibility across (Playable map area)
    • Visibility - Create an initially Enabled visibility modifier for Player 7 (Green) emitting Visibility across (Playable map area)
    • Visibility - Create an initially Enabled visibility modifier for Player 8 (Pink) emitting Visibility across (Playable map area)
    • Visibility - Create an initially Enabled visibility modifier for Player 9 (Gray) emitting Visibility across (Playable map area)
    • Visibility - Create an initially Enabled visibility modifier for Player 10 (Light Blue) emitting Visibility across (Playable map area)
    • Visibility - Create an initially Enabled visibility modifier for Player 11 (Dark Green) emitting Visibility across (Playable map area)
    • Visibility - Create an initially Enabled visibility modifier for Player 12 (Brown) emitting Visibility across (Playable map area)
With simply:
  • Actions
    • Visibility - Disable fog of war
    • Visibility - Disable black mask
And then see if the desync persists. Perhaps fog modifiers are not asynchronous, I have not checked.

Also, try removing the 0.50 second wait in your first trigger, and then try it out. Good luck. :)
 
Level 6
Joined
Oct 19, 2007
Messages
57
Thanks everyone!!

I has removed leaderboard and more trigger

Now I'll try with this trigger

  • Start
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Quest - Create a Required quest titled |cff5AF7FFInformati... with the description |cff5AF7FFMAP TYPE ..., using icon path war3mapPreview.tga
      • Quest - Create a Optional quest titled |cff5AF7FFCredits|r with the description |cff5AF7FFThanks fo..., using icon path ReplaceableTextures\CommandButtons\BTNBansheeMaster.blp
      • Quest - Create a Required quest titled |cff5AF7FFHow to fi... with the description |cff5AF7FFFighting ..., using icon path ReplaceableTextures\WorldEditUI\Editor-Random-Building.blp
      • Set Point = (Center of Region 040 <gen>)
      • Floating Text - Create floating text that reads Register for the ba... at Point with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Set FloatingText[1] = (Last created floating text)
      • Custom script: call RemoveLocation (udg_Point)
      • Set Point = (Center of Region 043 <gen>)
      • Floating Text - Create floating text that reads Choose an units at Point with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Set FloatingText[2] = (Last created floating text)
      • Custom script: call RemoveLocation (udg_Point)
      • Set Point = (Center of Region 056 <gen>)
      • Floating Text - Create floating text that reads Got 100 score to wi... at Point with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Set FloatingText[3] = (Last created floating text)
      • Custom script: call RemoveLocation (udg_Point)
      • Set Point = (Center of Region 062 <gen>)
      • Floating Text - Create floating text that reads Rapidly press B for... at Point with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Set FloatingText[4] = (Last created floating text)
      • Custom script: call RemoveLocation (udg_Point)
      • Set Point = (Center of Region 004 <gen>)
      • Floating Text - Create floating text that reads Waiting for you que... at Point with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Set FloatingText[5] = (Last created floating text)
      • Custom script: call RemoveLocation (udg_Point)
      • Visibility - Disable fog of war
      • Visibility - Disable black mask
      • Player Group - Pick every player in (All players matching (((Matching player) controller) Equal to User)) and do (Actions)
        • Loop - Actions
          • Set Allplayer = (Player number of (Picked player))
      • For each (Integer A) from 1 to Allplayer, do (Actions)
        • Loop - Actions
          • Set Point = ((Player((Integer A))) start location)
          • Unit - Create 1 People for (Player((Integer A))) at Point facing Default building facing degrees
          • Set People[(Integer A)] = (Last created unit)
          • Custom script: call RemoveLocation (udg_Point)
      • Trigger - Run RegisterTimer <gen> (checking conditions)
 
Last edited:
Level 20
Joined
Jul 14, 2011
Messages
3,213
I'm not sure, but I think you have to remove the point everytime you give a value to it. Giving another value to the same point variable doesn't necessarily means "overwriting" the past value. The old one is store as trash. AFAIK (As far as I Know)

About the Player Group... your "AllPlayers" is an "Integer" which I guess you're using to know how many players are actually playing. For that just set "AllPlayer = Count Players in (All Players Matching ((Matching Player Slot Status is Equal to Is Playing) and (Matching Player Slot is equal to User) <- Something like that. You don't have to pick every player for that.

The Integer A loop seems ok to me.
 
Status
Not open for further replies.
Top