• 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.

Freaking things

Status
Not open for further replies.
Level 5
Joined
Jan 12, 2010
Messages
132
Freaking thing
I have onne trigger that is called by another trigger to change the icons in a multiboard.Problem is:
Dont work:
  • HP2
    • Events
    • Conditions
    • Actions
      • Custom script: if GetLocalPlayer() == udg_Player then
      • For each (Integer A) from 9 to 16, do (Actions)
        • Loop - Actions
          • Set Integer[2] = (Integer A)
          • For each (Integer B) from 0 to 4, do (Actions)
            • Loop - Actions
              • Set Integer[3] = (4 - (Integer B))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Real[6] + (0.25 x (Real(Integer[3])))) Greater than or equal to (Real((Integer[2] - 8)))
                • Then - Actions
                  • Game - Display to (All players) for 1.00 seconds the text: (String(Integer[2]))
                  • Multiboard - Set the icon for M_board item in column Integer[2], row 2 to HP_barr[(Integer[3] + 1)]
                • Else - Actions
          • Set Integer[4] = (Integer A)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer[4] Less than 16
            • Then - Actions
              • For each (Integer B) from (Integer[4] + 1) to 16, do (Actions)
                • Loop - Actions
                  • Multiboard - Set the icon for M_board item in column Integer[2], row 2 to HP_barr[5]
            • Else - Actions
      • Custom script: endif
But if inside "For loop integer B" change integer[2] to any number it will display in multiboard.
Work
  • HP2
    • Events
    • Conditions
    • Actions
      • Custom script: if GetLocalPlayer() == udg_Player then
      • For each (Integer A) from 9 to 16, do (Actions)
        • Loop - Actions
          • Set Integer[2] = (Integer A)
          • For each (Integer B) from 0 to 4, do (Actions)
            • Loop - Actions
              • Set Integer[3] = (4 - (Integer B))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Real[6] + (0.25 x (Real(Integer[3])))) Greater than or equal to (Real((Integer[2] - 8)))
                • Then - Actions
                  • Game - Display to (All players) for 1.00 seconds the text: (String(Integer[2]))
                  • Multiboard - Set the icon for M_board item in column 11, row 2 to HP_barr[(Integer[3] + 1)]
                • Else - Actions
          • Set Integer[4] = (Integer A)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer[4] Less than 16
            • Then - Actions
              • For each (Integer B) from (Integer[4] + 1) to 16, do (Actions)
                • Loop - Actions
                  • Multiboard - Set the icon for M_board item in column 11, row 2 to HP_barr[5]
            • Else - Actions
      • Custom script: endif
How can WE cant take value of that variable? I tried in many way and dont work.
I also have another identic trigger like this that use others variable and do same things and work perfectly fine.
help pls.
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
  • For each (Integer B) from 0 to 4, do (Actions)
    • Loop
      • Set Integer[3] = (4 - (Integer B))
      • --- Some stuff ---
      • Multiboard - Set the icon for M_board item in column 11, row 2 to HP_barr[(Integer[3] + 1)]
So, Integer[3] will be -4, -3, -2, -1 and 0.

And you want to display HP_barr[-3, -2, -1, 0 and 1].

As far as I know, arrays can't hold negative values, so, all of them will return 0 or null.

it's 4 - (Integer B) so that would be 4 - 0, 4 - 1, 4 - 2 and so on, isn't it ?
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
yeah, i wonder why ....

Edit : and what he wanted to ask is

when he set the trigger like this

  • Multiboard - Set the icon for M_board item in column 11, row 2 to HP_barr[5]
it works in game and the multiboard showed the HP_barr[5]

but when he set to this

  • Multiboard - Set the icon for M_board item in column Integer[2], row 2 to HP_barr[5]
it's not working..

Integer[2] = (Integer A) / 9,10,11,12,13,14,15,16

Edit 2 : and i want to know how big exactly your multiboard is
 
Last edited:
Level 20
Joined
Jul 14, 2011
Messages
3,213
I'd like to know if the condition
  • (Real[6] + (0.25 x (Real(Integer[3])))) Greater than or equal to (Real((Integer[2] - 8)))
is True in all cases. You say it works with any number but the condition can't be always true.

Also, I'd like to know what's the value of udg_Player. If you're not the player in the player variable, this will not work for you, because this happens only for the player in that variable, because of the GetLocalPlayer().
 
Level 5
Joined
Jan 12, 2010
Messages
132
  • Algoritm HP2
    • Events
    • Conditions
    • Actions
      • Custom script: if GetLocalPlayer() == udg_Player then
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • Set Integer[2] = ((Integer A) + 8)
          • For each (Integer B) from 0 to 4, do (Actions)
            • Loop - Actions
              • Set Integer[3] = (4 - (Integer B))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Real[6] + 8.00) + (0.25 x (Real(Integer[3])))) Greater than or equal to (Real(Integer[2]))
                • Then - Actions
                  • Multiboard - Set the icon for M_board item in column Integer[2], row 2 to HP_barr[(Integer[3] + 1)]
                • Else - Actions
          • Set Integer[4] = Integer[2]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer[4] Less than 16
            • Then - Actions
              • For each (Integer B) from (Integer[4] + 1) to 16, do (Actions)
                • Loop - Actions
                  • Multiboard - Set the icon for M_board item in column (Integer B), row 2 to HP_barr[5]
            • Else - Actions
      • Custom script: endif
EDIT: Fixed
 
Last edited:
Status
Not open for further replies.
Top