- Joined
- Sep 9, 2006
- Messages
- 92
I'm trying to make a GUI floating text display of a bar showing the amount of mana above all units with mana; currently my triggering is messed up somewhere in the arrays/loops and the only thing in-game it does is lag up. Here's the trigger:
Mana bar
Events
-Time - Every 0.04 seconds of game time
Conditions
Actions
-Set ManaInt[1] = 0
-Unit Group - Pick every unit in (Units in (Playable map area)((Max mana of (Matching unit)) Greater than 0.00)) and do (Actions)
--Loop - Actions
---Set ManaInt[1] = (ManaInt[1] + 1)
---Set ManaUnit[ManaInt[1]] = (Picked unit)
---Set ManaTextCount[ManaInt[1]] = 0
-Set ManaGroup = (Last created unit group)
-For each (Integer B) from 1 to ManaInt[1], do (Actions)
--Loop - Actions
---Set ManaPoint[(Integer B)] = ((Position of ManaUnit[(Integer B)]) offset by ((FTSize[2] - (FTSize[2] x 1.50)), 0.00))
---For each (Integer A) from 1 to 100, do (Actions)
----Loop - Actions
-----Floating Text - Destroy FTTESTText[ManaTextCount[(Integer B)]]
-----Set ManaTextCount[(Integer B)] = (ManaTextCount[(Integer B)] + 1)
-----If (All Conditions are True) then do (Then Actions) else do (Else Actions)
------If - Conditions
-------(Integer((Percentage mana of ManaUnit[(Integer B)]))) Greater than or equal to (Integer A)
------Then - Actions
-------Floating Text - Create floating text that reads I at ManaPoint[(Integer B)] with Z offset 192.00, using font size FTSize[1], color (0.00%, 40.00%, 100.00%), and 0.00% transparency
------Else - Actions
-------Floating Text - Create floating text that reads I at ManaPoint[(Integer B)] with Z offset 192.00, using font size FTSize[1], color (10.00%, 10.00%, 10.00%), and 0.00% transparency
-----Set FTTESTText[ManaTextCount[(Integer B)]] = (Last created floating text)
-----Set ManaPoint[(Integer B)] = (ManaPoint[(Integer B)] offset by ((FTSize[2] / 100.00), 0.00))
---Custom script: call RemoveLocation (udg_ManaPoint[GetForLoopIndexB()])
---Custom script: set udg_ManaUnit[GetForLoopIndexB()] = null
-Custom script: call GroupClear( udg_ManaGroup )
-Custom script: call DestroyGroup( udg_ManaGroup )
IDK if u can use spaces at the beginning to make it neater and indented so i went ahead and used dashes
Mana bar
Events
-Time - Every 0.04 seconds of game time
Conditions
Actions
-Set ManaInt[1] = 0
-Unit Group - Pick every unit in (Units in (Playable map area)((Max mana of (Matching unit)) Greater than 0.00)) and do (Actions)
--Loop - Actions
---Set ManaInt[1] = (ManaInt[1] + 1)
---Set ManaUnit[ManaInt[1]] = (Picked unit)
---Set ManaTextCount[ManaInt[1]] = 0
-Set ManaGroup = (Last created unit group)
-For each (Integer B) from 1 to ManaInt[1], do (Actions)
--Loop - Actions
---Set ManaPoint[(Integer B)] = ((Position of ManaUnit[(Integer B)]) offset by ((FTSize[2] - (FTSize[2] x 1.50)), 0.00))
---For each (Integer A) from 1 to 100, do (Actions)
----Loop - Actions
-----Floating Text - Destroy FTTESTText[ManaTextCount[(Integer B)]]
-----Set ManaTextCount[(Integer B)] = (ManaTextCount[(Integer B)] + 1)
-----If (All Conditions are True) then do (Then Actions) else do (Else Actions)
------If - Conditions
-------(Integer((Percentage mana of ManaUnit[(Integer B)]))) Greater than or equal to (Integer A)
------Then - Actions
-------Floating Text - Create floating text that reads I at ManaPoint[(Integer B)] with Z offset 192.00, using font size FTSize[1], color (0.00%, 40.00%, 100.00%), and 0.00% transparency
------Else - Actions
-------Floating Text - Create floating text that reads I at ManaPoint[(Integer B)] with Z offset 192.00, using font size FTSize[1], color (10.00%, 10.00%, 10.00%), and 0.00% transparency
-----Set FTTESTText[ManaTextCount[(Integer B)]] = (Last created floating text)
-----Set ManaPoint[(Integer B)] = (ManaPoint[(Integer B)] offset by ((FTSize[2] / 100.00), 0.00))
---Custom script: call RemoveLocation (udg_ManaPoint[GetForLoopIndexB()])
---Custom script: set udg_ManaUnit[GetForLoopIndexB()] = null
-Custom script: call GroupClear( udg_ManaGroup )
-Custom script: call DestroyGroup( udg_ManaGroup )
IDK if u can use spaces at the beginning to make it neater and indented so i went ahead and used dashes