Dialog won't show up!

Status
Not open for further replies.
Level 12
Joined
Apr 16, 2010
Messages
584
Hello! So i have few triggers that call 4 different dialogs, not in same time. One for modes, second for frags, third for Order System, and fourth for Bank System.
I have no problems with first and second dialogs but other ones make me crazy, i don't even know what is the problem, so the thing is that they won't show up. But i noticed that when i copy those triggers to another map everything forks fine, i can assure you that no other trigger using actions that prevent dialogs from showing.

If anyone wants to look at triggers no problem:
  • BS Send Gold
    • Events
      • Player - Player 1 (Red) types a chat message containing -send gold as A substring
      • Player - Player 2 (Blue) types a chat message containing -send gold as A substring
      • Player - Player 3 (Teal) types a chat message containing -send gold as A substring
      • Player - Player 4 (Purple) types a chat message containing -send gold as A substring
      • Player - Player 5 (Yellow) types a chat message containing -send gold as A substring
      • Player - Player 6 (Orange) types a chat message containing -send gold as A substring
      • Player - Player 7 (Green) types a chat message containing -send gold as A substring
      • Player - Player 8 (Pink) types a chat message containing -send gold as A substring
      • Player - Player 9 (Gray) types a chat message containing -send gold as A substring
      • Player - Player 10 (Light Blue) types a chat message containing -send gold as A substring
      • Player - Player 11 (Dark Green) types a chat message containing -send gold as A substring
      • Player - Player 12 (Brown) types a chat message containing -send gold as A substring
    • Conditions
    • Actions
      • -------- Setting amount of gold that we want to send --------
      • Set BS_Send_Amount[(Player number of (Triggering player))] = (Integer((Substring((Entered chat string), 12, (Length of (Entered chat string))))))
      • -------- Cheking if sender has enough gold --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) Current gold) Greater than or equal to BS_Send_Amount[(Player number of (Triggering player))]
        • Then - Actions
          • -------- Creating the dialog to sender with names of available recivers --------
          • Dialog - Change the title of BS_Dialog_1[(Player number of (Triggering player))] to Chose Reciver
          • 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
                  • ((Player((Integer A))) controller) Equal to User
                • Then - Actions
                  • Dialog - Create a dialog button for BS_Dialog_1[(Player number of (Triggering player))] labelled (Name of (Player((Integer A))))
                  • Set BS_DialogButton[(Integer A)] = (Last created dialog Button)
                • Else - Actions
          • Dialog - Show BS_Dialog_1[(Player number of (Triggering player))] for (Triggering player)
        • Else - Actions
          • Game - Display to (Player group((Triggering player))) the text: |Cfffed312You don't...
I'm not showing triggers from Order System because i kinda messed up with the system) Totally made it neither MUI nor MPI... Forgot so save the map))
So if anyone has any idea what is wrong, I'd be glad to here them...

Reminder: Triggers work in other maps!!!
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,285
If the trigger works in another map, then clearly nothing is wrong with it.

The error you are describing can be caused by a collision of this trigger with another trigger in the same map causing this one to break. Without the map, no one can help you solve this.

I can tell you how to solve it yourself though.

Check what parts of the trigger runs by displaying messages (like you do for the lack of gold error) to check if there is a logic failure. Remember to remove them once map is working. If messages do not display that you expect to then you know a logic error occoured between two points.

Try isolating the trigger and seeing if it works, this means a complete new set of variables for it to use. If it does then the fault is caused by the values the variables contain. In that case you can display them onto the screen to check if they are correct. If one is not right, then you will have to find the trigger that caused the value error and debug that.
 
Level 12
Joined
Apr 16, 2010
Messages
584
Check what parts of the trigger runs by displaying messages
Every action works properly... But still no dialog(
Try isolating the trigger and seeing if it works, this means a complete new set of variables for it to use. If it does then the fault is caused by the values the variables contain.
Funny happened, made new variables still doesn't show, but when i removed the arrays - worked; but it means that i need to create each trigger for each player and that sucks, means not MPI...
  • BS Send Gold 2
    • Events
      • Player - Player 1 (Red) types a chat message containing -send gold as A substring
      • Player - Player 2 (Blue) types a chat message containing -send gold as A substring
      • Player - Player 3 (Teal) types a chat message containing -send gold as A substring
      • Player - Player 4 (Purple) types a chat message containing -send gold as A substring
      • Player - Player 5 (Yellow) types a chat message containing -send gold as A substring
      • Player - Player 6 (Orange) types a chat message containing -send gold as A substring
      • Player - Player 7 (Green) types a chat message containing -send gold as A substring
      • Player - Player 8 (Pink) types a chat message containing -send gold as A substring
      • Player - Player 9 (Gray) types a chat message containing -send gold as A substring
      • Player - Player 10 (Light Blue) types a chat message containing -send gold as A substring
      • Player - Player 11 (Dark Green) types a chat message containing -send gold as A substring
      • Player - Player 12 (Brown) types a chat message containing -send gold as A substring
    • Conditions
    • Actions
      • -------- Setting amount of gold that we want to send --------
      • Set AA_SEND_AMOUNT = (Integer((Substring((Entered chat string), 12, (Length of (Entered chat string))))))
      • -------- Cheking if sender has enough gold --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) Current gold) Greater than or equal to BS_SendAmount[(Player number of (Triggering player))]
        • Then - Actions
          • -------- Creating the dialog to sender with names of available recivers --------
          • Dialog - Change the title of AA_DIALOG to Chose Reciver
          • 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
                  • ((Player((Integer A))) controller) Equal to User
                • Then - Actions
                  • Dialog - Create a dialog button for AA_DIALOG labelled (Name of (Player((Integer A))))
                  • Set AA_DIALOGBUTTON = (Last created dialog Button)
                • Else - Actions
          • Dialog - Show AA_DIALOG for (Triggering player)
        • Else - Actions
          • Game - Display to (Player group((Triggering player))) the text: |Cfffed312You don't...
Any other suggestions?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,285
Thats the problem with GUI, it isolates you from the fact that you actually need to create a dialog object otherwise the array is full of null pointers (well not exactly null but no value). In GUI, you modify an existing dialog wherease in JASS it is extreemly clear that you must first create a dialog to modify.

GUI initializes the variables automatically with a blank object where appropiate, which is why they do have a size field for arrays. However the array system in WC3 is without a size field and thus it is perfectly valid to use indicies as you please (but this does bug GUI for the reason I describe as you are now aware to).
 
Status
Not open for further replies.
Top