• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Trigger] Simple trigger error - player desync?

Status
Not open for further replies.
Level 14
Joined
Aug 30, 2004
Messages
909
I have a simple voting system I'm working on at the start of a map. It is handled by one trigger (see below). The players are all shown "ArenaChoiceDialog" dialog with two buttons on it: one is ac_Canyon.

  • Arena Choice
    • Events
      • Dialog - A dialog button is clicked for ArenaChoiceDialog
    • Conditions
    • Actions
      • Dialog - Hide (Clicked dialog) for (Triggering player)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to ac_Canyon
        • Then - Actions
          • Set arenaVoteCanyon = (arenaVoteCanyon + 1)
        • Else - Actions
          • Set arenaVoteValley = (arenaVoteValley + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • NumberOfPlayers Equal to (arenaVoteCanyon + arenaVoteValley)
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Trigger - Run Arena Decision Made <gen> (checking conditions)
        • Else - Actions
The trigger above fires when any player chooses. It is designed so that when all players chose it will fire the next trigger. The problem is, it fires when only one player has made his decision! I've tested the following:

arenaVoteCanyon and arenaVoteValley are integers that are set at 0 by default. I have checked the object editor and these are the only two triggers that these variables appear in. So they both start at zero.

NumberOfPlayers is correctly set at 2 during our playtest. In the next trigger it is used and works appropriately (and works appropriately in earlier triggers too).

Unfortunately, my friend and I can't playtest together very long, so I can't really hash this out. But somehow it seems that 1=2. I'm pretty sure that's not true, so I'm wondering if there isn't some desync problem when I play with more than one player. I don't know how desyncing works, but I'm getting some very strange bugs when I play the map with multiplayers (e.g. somehow I'm selecting a locust unit).
 
Level 11
Joined
Dec 19, 2012
Messages
411
Try to use game message to print the integer of "arenaVoteCanyon", "arenaVoteValley" and "NumberOfPlayers" respectively and see if you did something wrong?

In your trigger it wouldn't cause desync as there is no unsync agent.

About selecting a locust unit, I totally have no idea how could it happen, at least it never happen to me.
 
Level 11
Joined
Oct 9, 2015
Messages
721
What about setting an integer variable to +1 (with the maximum number equal to the number of players) whenever a player votes and when this integeger reaches it's maximum number you check for it ? for example: integer equal to number of players then actions.

Something like this
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • IntegerExample Greater than or equal to (Number of players in (All players controlled by a User player))
    • Then - Actions
    • Else - Actions
 
are you sure you showing dialog for all players you want to?
like this for example
  • Player Group - Pick every player in PlayerGroup and do (Actions)
    • Loop - Actions
      • Dialog - Show Dialog for (Picked player)
  • Dialog - Hide (Clicked dialog) for (Triggering player)
you do not need to do this. Dialog is auto hidden on click by default.

while you showing dialog, multiboards are hidden, be sure to add actions when dialog button is clicked:
  • Multiboard - Show Multiboard
  • Multiboard - Minimize Multiboard
select locust unit?? hmm it is impossible;]
 
Level 14
Joined
Aug 30, 2004
Messages
909
Ah.. I'm so confused.

I put in some debugging triggers to see the counts, and I can't seem to replicate the bug.

The bug with the locust unit was there still...so I put in a trigger to fix it. I suppose I could be missing something, but I'd bet large amounts of my anatomy that I was selecting that locust unit.
 
Status
Not open for further replies.
Top