• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

my loadingbar

Status
Not open for further replies.
Level 7
Joined
Jun 15, 2010
Messages
218
floatingtext.png

I'm trying to make a loadingbar but as you can see on the picture it doesent work properly the text cffFF0000 is flikkering. For the rest it works fine. can anybody help me with this? here's my triggers: (I only need to get the floatingtext working)

  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Melee Game - Use melee time of day (for all players)
      • Melee Game - Limit Heroes to 1 per Hero-type (for all players)
      • Melee Game - Give trained Heroes a Scroll of Town Portal (for all players)
      • Melee Game - Set starting resources (for all players)
      • Melee Game - Remove creeps and critters from used start locations (for all players)
      • Melee Game - Run melee AI scripts (for computer players)
      • Hashtable - Create a hashtable
      • Set Hashtable_Hero_STATS = (Last created hashtable)
      • Hashtable - Create a hashtable
      • Set Hashtable_loading_Bar = (Last created hashtable)
      • Set Strings[0] = |cffffcc00
      • Set Strings[1] = |cffFF0000
      • Set Strings[2] = ||||||||||||||||||||||||||r
      • Set Chars = 25.00
  • Loading bar start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Flame Strike
    • Actions
      • Animation - Play (Triggering unit)'s spell channel animation
      • Set Loading_Bar_count = (Loading_Bar_count + 1)
      • Trigger - Turn on loadingbar looping <gen>
      • Floating Text - Create floating text that reads <Empty String> above (Triggering unit) with Z offset 0.00, using font size 14.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Set Loading_bar_floatingText = (Last created floating text)
      • Floating Text - Show Loading_bar_floatingText for (All players matching ((Owner of (Triggering unit)) Equal to (Matching player)))
      • Floating Text - Change Loading_bar_floatingText: Disable permanence
      • Floating Text - Set the velocity of Loading_bar_floatingText to 64.00 towards 90.00 degrees
      • Floating Text - Change the lifespan of Loading_bar_floatingText to 5.00 seconds
      • Floating Text - Change the fading age of Loading_bar_floatingText to 4.00 seconds
      • Hashtable - Save 4.00 as 0 of (Key (Triggering unit)) in Hashtable_loading_Bar
      • Unit Group - Add (Triggering unit) to Loading_bar_Units
  • loadingbar looping
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Loading_bar_Units and do (Actions)
        • Loop - Actions
          • Set Loading_bar_remainingTime = (Load 0 of (Key (Picked unit)) from Hashtable_loading_Bar)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Loading_bar_remainingTime Greater than 0.10
            • Then - Actions
              • Game - Display to (All players) the text: ja
              • Hashtable - Save (Loading_bar_remainingTime - 0.10) as 0 of (Key (Picked unit)) in Hashtable_loading_Bar
              • Set r0 = (100.00 / 4.00)
              • Set r1 = (r0 x Loading_bar_remainingTime)
              • Set i1 = (Integer((r1 / (100.00 / Chars))))
              • Set String = (Strings[0] + ((Substring(Strings[2], 1, i1)) + (Strings[1] + (Substring(Strings[2], (i1 + 1), (Integer(Chars)))))))
              • Floating Text - Change text of Loading_bar_floatingText to String using font size 14.00
            • Else - Actions
              • Game - Display to (All players) the text: nee
              • -------- laatste gedeelte --------
              • Set Loading_Bar_count = (Loading_Bar_count - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Loading_Bar_count Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
 

Attachments

  • HET SYSTEEM.w3x
    15.8 KB · Views: 63
Level 7
Joined
Jun 15, 2010
Messages
218
I dident forgot it. The strange thing is that the trigger is good/ bad/ good /bad.
hard to explain mm. every 0.2 secodns of the game the triggers plays 2 times. 1 of that time its going good, and the other it shows the bug like in the picture. so strange

EDIT:

  • Actions
    • Set Strings[0] = |cffffcc00
    • Set Strings[1] = |cffFF0000
    • Set Strings[2] = |||||||||||||||||||||||||
    • Set Strings[3] = |r
    • Set Chars = 25.00
    • Set Loading_bar_remainingTime = (Load 0 of (Key (Picked unit)) from Hashtable_loading_Bar)
    • Hashtable - Save (Loading_bar_remainingTime - 0.10) as 0 of (Key (Picked unit)) in Hashtable_loading_Bar
    • Set r0 = (100.00 / 4.00)
    • Set r1 = (r0 x Loading_bar_remainingTime)
    • Set i1 = (Integer((r1 / (100.00 / Chars))))
    • Set String = (Strings[0] + (((Substring(Strings[2], 1, i1)) + Strings[3]) + (Strings[1] + ((Substring(Strings[2], (i1 + 1), (Integer(Chars)))) + Strings[3]))))

I changed a few things. Now it only keeps showing an r. The "r" switches every 0.1 seconds from the end of the string with a red collour to a yellow colloured "r" at the end of the progress of the bar. (like when the bar is at half time then the r is in the middle of the string)

gele r.png

rooie r.png
 

Attachments

  • HET SYSTEEM.w3x
    16 KB · Views: 58
Last edited:
Status
Not open for further replies.
Top