Mass MUI Dialog Button - Where is Mistake?

warden13

New Member
Reaction score
32
Hello
I am trying to make a god selection system. But it didn't seem to work. I will post the triggers as well the map. Please help me to fix it ^_^

Trigger:
  • Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set GOD_ButtonNumber = 8
      • Set GOD_Buton_Name[1] = Zeus
      • Set GOD_Buton_Name[2] = Meus
      • Set GOD_Buton_Name[3] = Heus
      • Set GOD_Buton_Name[4] = Feus
      • Set GOD_Buton_Name[5] = Geus
      • Set GOD_Buton_Name[6] = Deyyus
      • Set GOD_Buton_Name[7] = Otuz
      • Set GOD_Buton_Name[8] = Bokuz
      • Set GOD_Ability[1] = God 1
      • Set GOD_Ability[2] = God 2
      • Set GOD_Ability[3] = God 3
      • Set GOD_Ability[4] = God 4
      • Set GOD_Ability[5] = God 5
      • Set GOD_Ability[6] = God 6
      • Set GOD_Ability[7] = God 7
      • Set GOD_Ability[8] = God 8

Trigger:
  • Hero
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • ((Sold unit) is A Hero) Equal to True
    • Actions
      • Set GOD_PlayerNumber = (Player number of (Owner of (Sold unit)))
      • Set GOD_Hero[GOD_PlayerNumber] = (Sold unit)
      • Dialog - Change the title of GOD_Dialog[GOD_PlayerNumber] to Select Your God
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • For each (Integer B) from 1 to GOD_ButtonNumber, do (Actions)
            • Loop - Actions
              • Dialog - Create a dialog button for GOD_Dialog[(Integer A)] labelled GOD_Buton_Name[(Integer B)]
              • Set GOD_DialogButton[((((Integer A) - 1) x (Integer A)) + (Integer B))] = (Last created dialog Button)
              • Game - Display to (All players) the text: (String(((((Integer A) - 1) x (Integer A)) + (Integer B))))
      • Dialog - Show GOD_Dialog[GOD_PlayerNumber] for (Player(GOD_PlayerNumber))

Trigger:
  • Click
    • Events
      • Dialog - A dialog button is clicked for GOD_Dialog[1]
      • Dialog - A dialog button is clicked for GOD_Dialog[2]
      • Dialog - A dialog button is clicked for GOD_Dialog[3]
      • Dialog - A dialog button is clicked for GOD_Dialog[4]
      • Dialog - A dialog button is clicked for GOD_Dialog[5]
      • Dialog - A dialog button is clicked for GOD_Dialog[6]
      • Dialog - A dialog button is clicked for GOD_Dialog[7]
      • Dialog - A dialog button is clicked for GOD_Dialog[8]
      • Dialog - A dialog button is clicked for GOD_Dialog[9]
      • Dialog - A dialog button is clicked for GOD_Dialog[10]
      • Dialog - A dialog button is clicked for GOD_Dialog[11]
      • Dialog - A dialog button is clicked for GOD_Dialog[12]
    • Conditions
    • Actions
      • For each (Integer A) from 1 to (12 x GOD_ButtonNumber), do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Clicked dialog button) Equal to GOD_DialogButton[(Integer A)]
            • Then - Actions
              • Game - Display to (All players) the text: TIK
              • Game - Display to (All players) the text: (You have prayed to + (GOD_Buton_Name[((Integer A) mod GOD_ButtonNumber)] + to become your God.))
              • Unit - Add GOD_Ability[((Integer A) mod GOD_ButtonNumber)] to GOD_Hero[(Player number of (Triggering player))]
            • Else - Actions
 

Attachments

  • HELP PLOX.w3x
    10.8 KB · Views: 89

Trollvottel

never aging title
Reaction score
262
(Integer A) - 1) x (Integer A)

->

(Integer A) - 1) x 12


where you store the things. thats how a simulated 2D array works, multiply with the max array size and not with the storage index.
 

LurkerAspect

Now officially a Super Lurker
Reaction score
118
Can you elaborate on what doesn't work? i.e. do the buttons not appear? Does your hero not create? It's difficult to solve a problem if you don't know what it is.
 

warden13

New Member
Reaction score
32
OK Trollvottel. You spotted the mistake really fast ^_^. One more problem in the last trigger.

You are player 1 and you choose the 8.god. It means you selected the DialogButton[8].
But my triggers calculates it wrong. (Button number mod 8). But 8 mod 8 = 0 so nothing happens. How can I fix it.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top