[HELP] Multiboard Icons

Status
Not open for further replies.
Level 9
Joined
Aug 7, 2009
Messages
380
Well... I'm using a multiboard, there're: Icons, Name and Kills. It works fine, but i just wondering how to change icon when player reach one number of kill (just like modern warfare ranking). Help plz. Do i have to create for each player a trigger? then, each change icon a trigger? (I'm working that way @@)
 
  • Trigger
  • Events
    • Unit - A unit dies
  • Conditions
  • Actions
    • Set Kills[Player number of (Owner of (Killing unit))] = (Kills[Player number of (Owner of (Killing unit))] + 1)
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • (Kills[Player number of (Owner of (Killing unit))]) Equal to X
      • Then - Actions
        • Multiboard - Set the icon for (Multiboard) item in column 1, row ((Player number of (Owner of (Killing unit)) + 1) to UI\Feedback\Resources\ResourceGold.blp
      • Else - Actions
Well, I guess your second row belongs to Player 1 (Red).
Anyway, change the "row" to the value your multiboard has.

Kills[] is an integer variable, with array ticked.
https://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/variables-5896/
 
Well, you can do this:
  • Trigger1
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Set Icons[1] = Path1.blp
    • Set Icons[2] = Path2.blp
    • Set Icons[3] = Path3.blp
Icons[] is a String variable, with array.
  • Trigger
  • Events
    • Unit - A unit dies
  • Conditions
  • Actions
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • (Kills[Player number of (Owner of (Killing unit))]) Equal to X
      • Then - Actions
        • Set Kills[Player number of (Owner of (Killing unit))] = 0
        • Set Integer[Player number of (Owner of (Killing unit)) = (Integer[Player number of (Owner of (Killing unit))] + 1)
        • Multiboard - Set the icon for (Multiboard) item in column 1, row ((Player number of (Owner of (Killing unit)) + 1) to Icons[Integer[Player number of (Owner of (Killing unit))]]
      • Else - Actions
        • Set Kills[Player number of (Owner of (Killing unit))] = (Kills[Player number of (Owner of (Killing unit))] + 1)
There is a possibility that your paths will need two "\" instead of one, e.g. Units\\Druid\\Druid.blp. Check it.
 
The Kill Count works until the day killing unit reach that kill. It don't even change the icon :(

My triggers:

  • Set Icon Variables
  • Events:
    • Map initialization
  • Actions:
    • Set Icons[1] = BTNclass_3.blp
    • Set Icons[2] = BTNclass_4.blp
    • Set Icons[3] = BTNclass_5.blp
And Kill Update:
  • Kill Update:
  • Actions:
    • If (All Conditions are True)... blah blah
      • If - Conditions
        • Kill[(Player number of Owner of Killing unit)] Equal to 5
      • Then - Actions
        • Set Integer[Player number of Owner of Killing unit = Integer[Player number of Owner of Killing unit)] +1
        • Multiboard - Set the text for Last created multiboard item in column 1 row Player number of Owner of killing unit +1 to Icons ... just like yours
      • Else - Actions
        • Set Kill[Player number of owner of killing unit = Kill[Player number of Owner of killing unit] +1
        • Multiboard - Set the text for Last Created multiboard item in column 3 row Player number of Owner of Killing unit +1 to String(Kill(Player number of Owner of Killing unit)))
Sorry for my lazy
 
Last created multiboard: When you create the multiboard of yours, store it into a variable and change this last created multiboard with the variable.
Finally, since you want the kills displayed, you use two variables, Kills1[] and Kills2[]. The first one will be displayed and the second will become 0, when it reaches 5:
  • Trigger
  • Events
    • Unit - A unit dies
  • Conditions
  • Actions
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • (Kills2[Player number of (Owner of (Killing unit))]) Equal to 5
      • Then - Actions
        • Set Kills2[Player number of (Owner of (Killing unit))] = 0
        • Set Integer[Player number of (Owner of (Killing unit)) = (Integer[Player number of (Owner of (Killing unit))] + 1)
        • Multiboard - Set the icon for (Multiboard) item in column 1, row ((Player number of (Owner of (Killing unit)) + 1) to Icons[Integer[Player number of (Owner of (Killing unit))]]
      • Else - Actions
        • Set Kills1[Player number of (Owner of (Killing unit))] = (Kills1[Player number of (Owner of (Killing unit))] + 1)
        • Set Kills2[Player number of (Owner of (Killing unit))] = (Kills2[Player number of (Owner of (Killing unit))] + 1)
        • Multiboard - Set the text for (Multiboard) item in column 3, row ((Player number of (Owner of (Killing unit)) + 1) to String(Kills1[Player number of (Owner of (Killing unit))])
 
Status
Not open for further replies.
Back
Top