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

Custom Progress Bar w/ Diminishing Returns and Multiboard

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
A not that simple anymore, yet really useful template/system for a Custom Progres Bar including an example Multiboard with an integrated progress bar for Perks.

Fully customizeable!

After the bar is filled, it will have diminishing returns on the next level, needing more actions to be done in order to fill it again. It even takes into account when a level has been over-filled, so that no value is lost upon level-up.

Documentation and explanation inside, simple to import and very easy to extend.

Bar Triggers:
  • Define Progress String
    • Ereignisse
      • Map initialization
    • Bedingungen
    • Aktionen
      • -------- Color Libary --------
      • Set ColorString[0] = |c00A80000
      • Set ColorString[1] = |c00C92901
      • Set ColorString[2] = |c00D82C01
      • Set ColorString[3] = |c00D96C00
      • Set ColorString[4] = |c00D8BD01
      • Set ColorString[5] = |c00DED903
      • Set ColorString[6] = |c00C8EB01
      • Set ColorString[7] = |c0088EB01
      • Set ColorString[8] = |c005FEB01
      • Set ColorString[9] = |c0060BF00
      • Set ColorString[10] = |c0000A400
      • Set ColorString[11] = |cFF444444
      • Set ColorString[12] = |cFF00CCFF
      • -------- ------------------- --------
      • -------- Customize Values here --------
      • -------- ------------------- --------
      • -------- Sets the amount of maximum bars, add more l to increase. Currently 50. --------
      • Set Bar_String = llllllllllllllllllllllllllllllllllllllllllllllllll
      • -------- The number of bars used in the progress bar, maximum is 50. --------
      • Set Bar_Count = 50
      • -------- The percentage value which should be filled. --------
      • Set Bar_PercentageFilled = 0.00
      • -------- The background color covers the whole bar except for the "Percentage" of it. --------
      • Set Bar_BackgroundColor = ColorString[11]
      • -------- The fill color covers the "Percentage" part. --------
      • Set Bar_ForegroundColor = ColorString[12]
      • -------- Define where the Bar should be displayed. Use Offset when placed on Units. --------
      • Set Bar_Location = (Position of Gruftlord 0000 <gen>)
      • -------- Define Offset if needed. --------
      • Set Bar_Offset = 100.00
      • -------- Define the Bar's font size, useful when combined with floating text. --------
      • Set Bar_FontSize = 10.00
      • -------- ------------------- --------
      • -------- The Values below have to be extended modifying the array, when using more than 1 perk. The lower part defines the Default Values, outside of the variable editor --------
      • Set PSBar_PerkLVL[1] = 1
      • -------- Progress per Skill use --------
      • Set Progress_perUse[1] = 10
      • -------- Progress needed for Level Up --------
      • Set Progress_ForLVLUP[1] = 100
      • -------- Define Max Perk Level --------
      • Set Progress_MaxLVL[1] = 11
      • -------- Define diminishing returns --------
      • Set Progress_DimRetFactor[1] = (Progress_MaxLVL[1] - PSBar_PerkLVL[1])
      • -------- Define Perk Basics --------
      • Set Progress_Status[1] = 0
      • Set PerkLVL_Progress[1] = 1
      • Set PSBar[1] = 0
      • Set PSBar_PerkName[1] = Fancy Name
      • -------- ------------------- --------
      • -------- Some Instructions --------
      • Spiel - Display to (All players) the text: Use Impale to see P...
      • Schwebender Text - Create floating text that reads (((Bar_ForegroundColor + (Substring(Bar_String, 1, (Integer((Bar_PercentageFilled x 100.00)))))) + |r) + ((Bar_BackgroundColor + (Substring(Bar_String, ((Integer((Bar_PercentageFilled x 100.00))) + 1), Bar_Count))) + |r)) at Bar_Location with Z offset Bar_Offset, using font size Bar_FontSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Set Progress_Bar[1] = (Last created floating text)
      • Schwebender Text - Create floating text that reads (PSBar_PerkName[PerkNumber] + ( Level + (String(PSBar_PerkLVL[PerkNumber])))) at Bar_Location with Z offset (Bar_Offset + 50.00), using font size Bar_FontSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Set ProgressBar_Text[1] = (Last created floating text)
  • Increase for Perk 1 Bar Update
    • Ereignisse
      • Einheit - A unit Startet den Effekt einer Fähigkeit
    • Bedingungen
      • (Ability being cast) Gleich Aufspießen
    • Aktionen
      • -------- Defines which Perk is being progressed. --------
      • Set PerkNumber = 1
      • -------- Define the Formula for the Progress with diminishing returns here. --------
      • Set PSBar[PerkNumber] = (PSBar[PerkNumber] + Progress_DimRetFactor[PerkNumber])
      • -------- On Perk Level 1 - This returns current value of PS_Bar[1] + 10. --------
      • -------- After the Progress Bar reaches 100, it increases the Perk Level by 1 and resets itself to the next level value. We use -100 because we want it to take progress over 100 into account for the new level. --------
      • -------- So if we have 99 points and get +9, we will have 108. This means 8 / 100 in the next level. --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • PSBar[PerkNumber] Größer gleich 100
        • 'THEN'-Aktionen
          • -------- THEN Function happens, when Progress Bar is filled. --------
          • Set PSBar_PerkLVL[PerkNumber] = (PSBar_PerkLVL[PerkNumber] + 1)
          • Set PSBar[PerkNumber] = (PSBar[PerkNumber] - 100)
          • -------- Calculating how much of the bar will be filled, taking the bar length into account. --------
          • Set Bar_PercentageFilled = (((Real(PSBar[PerkNumber])) / 100.00) / (100.00 / (Real(Bar_Count))))
          • -------- Example: (10 / 100) / (50 / 100) = 0.1 / 2 = 0.05. In the Generation Trigger, we will multiply the percentage with 100. --------
        • 'ELSE'-Aktionen
          • -------- ELSE Function happens, when Progress Bar is not filled. --------
          • Set Bar_PercentageFilled = (((Real(PSBar[PerkNumber])) / 100.00) / (100.00 / (Real(Bar_Count))))
      • -------- Now that we have the Progress, we can change the floating text --------
      • Auslöser - Turn on Bar Loop <gen>
  • Bar Loop
    • Ereignisse
      • Zeit - Every 0.50 seconds of game time
    • Bedingungen
    • Aktionen
      • Schwebender Text - Destroy Progress_Bar[PerkNumber]
      • Schwebender Text - Destroy ProgressBar_Text[PerkNumber]
      • Set Bar_Location = (Position of Gruftlord 0000 <gen>)
      • Schwebender Text - Create floating text that reads (((Bar_ForegroundColor + (Substring(Bar_String, 1, (Integer((Bar_PercentageFilled x 100.00)))))) + |r) + ((Bar_BackgroundColor + (Substring(Bar_String, ((Integer((Bar_PercentageFilled x 100.00))) + 1), Bar_Count))) + |r)) at Bar_Location with Z offset Bar_Offset, using font size Bar_FontSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Set Progress_Bar[PerkNumber] = (Last created floating text)
      • Schwebender Text - Create floating text that reads (PSBar_PerkName[PerkNumber] + ( Level + (String(PSBar_PerkLVL[PerkNumber])))) at Bar_Location with Z offset (Bar_Offset + 50.00), using font size Bar_FontSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Set ProgressBar_Text[PerkNumber] = (Last created floating text)
      • Custom script: call RemoveLocation(udg_Bar_Location)
Example Multiboard Triggers:

  • Example Multiboard
    • Ereignisse
      • Zeit - Elapsed game time is 1.00 seconds
    • Bedingungen
    • Aktionen
      • -------- Defines Player Colors --------
      • Set Player_Colors[1] = |c00ff0000
      • -------- Increase amount of Perks in this Variable, this increases the rows in the Multiboard. --------
      • Set Perk_Count = 1
      • -------- Defines Multiboard Basics --------
      • Set MultiboardRows = (Perk_Count + 1)
      • Multiboard - Create a multiboard with 3 columns and MultiboardRows rows, titled |c00ff9900The Ways ...
      • Set MultiB_General = (Last created multiboard)
      • -------- Defines First Row --------
      • Multiboard - Set the text for MultiB_General item in column 1, row 1 to Perk
      • Multiboard - Set the text for MultiB_General item in column 2, row 1 to Level
      • Multiboard - Set the text for MultiB_General item in column 3, row 1 to Progress
      • -------- Set Display and Size --------
      • -------- Increase second Integer value by 1 for every additional perk / row. --------
      • For each (Integer MultiboardRows) from 1 to 2, do (Actions)
        • Schleifen - Aktionen
          • Multiboard - Set the display style for MultiB_General item in column 1, row MultiboardRows to Zeigen text and Verbergen icons
          • Multiboard - Set the display style for MultiB_General item in column 2, row MultiboardRows to Zeigen text and Verbergen icons
          • Multiboard - Set the display style for MultiB_General item in column 3, row MultiboardRows to Zeigen text and Verbergen icons
          • Multiboard - Set the width for MultiB_General item in column 1, row MultiboardRows to 6.00% of the total screen width
          • Multiboard - Set the width for MultiB_General item in column 2, row MultiboardRows to 4.00% of the total screen width
          • Multiboard - Set the width for MultiB_General item in column 3, row MultiboardRows to 11.00% of the total screen width
      • -------- Define Default Board Text --------
      • -------- Defines Second Row --------
      • Multiboard - Set the text for MultiB_General item in column 1, row 2 to Crafting
      • Multiboard - Set the text for MultiB_General item in column 2, row 2 to (String(PerkLVL_Progress[1]))
      • Multiboard - Set the text for MultiB_General item in column 3, row 2 to (|c00444444 + (Bar_String + |r))
      • -------- Extend for more rows here --------
      • -------- Show Board --------
      • Multiboard - Zeigen MultiB_General
  • Increase for Skill 1 Multiboard Update
    • Ereignisse
      • Einheit - A unit Startet den Effekt einer Fähigkeit
    • Bedingungen
      • (Ability being cast) Gleich Aufspießen
    • Aktionen
      • -------- SkillLVL_Progress[1] = Crafting for example --------
      • -------- SkillLVL_Progress[2] = An other perk, like archery or blunt-skills. --------
      • -------- Same for Progress_Status[1], just change the array, according to what skill/perk it should be. --------
      • -------- Define the Formula for the Progress with diminishing returns here. --------
      • Set Progress_Status[1] = (Progress_Status[1] + (11 - PerkLVL_Progress[1]))
      • -------- On Skill Level 1 - This returns current value of Progress_Status[1] + 10. --------
      • -------- Debug Text --------
      • Spiel - Display to (All players) the text: (String(Progress_Status[1]))
      • -------- After the Progress Bar reaches 100, it increases the Skill/Perk Level by 1 and resets itself to the next level value. We use -100 because we want it to take progress over 100 into account for the new level. --------
      • -------- So if we have 99 points and get +9, we will have 108. This means 8 / 100 in the next level. --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • Progress_Status[1] Größer gleich 100
        • 'THEN'-Aktionen
          • -------- THEN Function happens, when Progress Bar is filled. --------
          • Set PerkLVL_Progress[1] = (PerkLVL_Progress[1] + 1)
          • Set Progress_Status[1] = (Progress_Status[1] - 100)
          • Set Progress_Status_forString[1] = (((Real(Progress_Status[1])) / 100.00) x (Real((Length of Bar_String))))
          • Multiboard - Set the text for MultiB_General item in column 3, row 2 to (((|c0000AAFF + (Substring(Bar_String, 1, (Integer(Progress_Status_forString[1]))))) + |r) + ((|c00444444 + (Substring(Bar_String, (Integer(Progress_Status_forString[1])), (Length of Bar_String)))) + |r))
          • -------- Debug Text --------
          • Spiel - Display to (All players) the text: (String(Progress_Status_forString[1]))
          • -------- After a Perk Level up from flat 100 to 0, the string returns a " o " infront of the string to make clear that it is empty. --------
        • 'ELSE'-Aktionen
          • -------- ELSE Function happens, when Progress Bar is not filled. --------
          • -------- This is the formula to calculate how the distribution on the String will be. --------
          • Set Progress_Status_forString[1] = (((Real(Progress_Status[1])) / 100.00) x (Real((Length of Bar_String))))
          • -------- Debug Text --------
          • Spiel - Display to (All players) the text: (String(Progress_Status_forString[1]))
          • -------- Now that we have the Progress, we can change the text on the Multiboard. --------
          • -------- The calculated value will now be transfered on the StateString Length, using Substrings. The part which is filled, becomes blue. (1st color code). The unfilled part, is grey (2nd color code). --------
          • Multiboard - Set the text for MultiB_General item in column 3, row 2 to (((|c0000AAFF + (Substring(Bar_String, 1, (Integer(Progress_Status_forString[1]))))) + |r) + ((|c00444444 + (Substring(Bar_String, (Integer(Progress_Status_forString[1])), (Length of Bar_String)))) + |r))
Keywords:
Multiboard, Progress Bar, Perk, Progress, Animated Bar, Bar, Diminishing Returns, Custom, Custom Bars
Contents

Custom Progress Bars with Multiboard (Map)

Reviews
12th Dec 2015 IcemanBo: Too long as NeedsFix. Rejected. 15:20, 22nd Jun 2013 PurgeandFire: Review here: http://www.hiveworkshop.com/forums/2365400-post13.html

Moderator

M

Moderator

12th Dec 2015
IcemanBo: Too long as NeedsFix. Rejected.

15:20, 22nd Jun 2013
PurgeandFire: Review here:
http://www.hiveworkshop.com/forums/2365400-post13.html
 
I have an awesome idea to make your system more extensible.

Instead of making it specific to mulitboards, you can pull off something that allows the user to do this:

  • -------- The number of bars used in the progress bar --------
  • Set ProgressBar_BarCount = 20
  • -------- The percentage value for the bar --------
  • Set ProgressBar_Percentage = 0.40
  • -------- The background color covers the whole bar except for the "Percentage" of it. --------
  • Set ProgressBar_BackgroundColor = |cffffc000
  • -------- The fill color covers the "Percentage" part. --------
  • Set ProgressBar_FillColor = |cffff0000
  • -------- Generate the bar --------
  • Trigger - Run GenerateProgressBar (ignoring conditions)
  • -------- You would have a variable called ProgressBar_Result in which you would store the resulting bar and the user can do WHATEVER he wants with it ;) --------
Doesn't that approach sound way better? :D
You can use this and have the multiboard bar as an example inside the resource map.

People would then be able to use these bars for inventory systems, casting/channeling progress indicators, custom mana indicators, custom XP indicators, multiboards, gametext, quest progress indicators, you name it!

(The above snippet of code should yield |||||||||||||||||||| in the ProgressBar_Result string variable.)
 
Level 6
Joined
Jun 24, 2011
Messages
176
I have an awesome idea to make your system more extensible.

Instead of making it specific to mulitboards, you can pull off something that allows the user to do this:

  • -------- The number of bars used in the progress bar --------
  • Set ProgressBar_BarCount = 20
  • -------- The percentage value for the bar --------
  • Set ProgressBar_Percentage = 0.40
  • -------- The background color covers the whole bar except for the "Percentage" of it. --------
  • Set ProgressBar_BackgroundColor = |cffffc000
  • -------- The fill color covers the "Percentage" part. --------
  • Set ProgressBar_FillColor = |cffff0000
  • -------- Generate the bar --------
  • Trigger - Run GenerateProgressBar (ignoring conditions)
  • -------- You would have a variable called ProgressBar_Result in which you would store the resulting bar and the user can do WHATEVER he wants with it ;) --------
Doesn't that approach sound way better? :D
You can use this and have the multiboard bar as an example inside the resource map.

People would then be able to use these bars for inventory systems, casting/channeling progress indicators, custom mana indicators, custom XP indicators, multiboards, gametext, quest progress indicators, you name it!

(The above snippet of code should yield |||||||||||||||||||| in the ProgressBar_Result string variable.)

Holy mother of ... Yeah that sounds absolutely fantastic! :goblin_jawdrop:

Using it like this, we'd have a template for Progress Bars, fully customizeable. Amazing!

I'm ... I'm gonna implement this and update the resource.

Thank you so much for suggesting this!! (+rep)
Hades
 
Right now this works, but I feel like it could be improved to fit Mag's suggestion a bit more. At the moment, this feels more like a sample rather than a system. Samples are nice, but systems are awesome in that other users have a better time of implementing it. :)

Right now, you still have to do some nasty |cffffcc00 + substring(text, 0, 7) + |cffAA00CC + substring(text, 7, end) things. That works, but it is pretty ugly. Plus, if someone just wants to increase it by one tick, then it would be a bit of a hassle to do all the conversions . In which case, the sample might not be too useful. You should try to frame it around Mag's idea a bit more. You are close--you let the user specify how many bars to have and all that, but what if the user wants different bar lengths for different things?

In Mag's trigger, basically you would input all those values and then the trigger "GenerateProgressBar" would spit out the string that already did the color coding + substrings for you. That way the user won't have to do anything, they can just input that string that you returned (ProgressBar_Result, or w/e). That would be the best way to have it. :)

If any of this is mistaken, then let me know. I was unable to check the actual map's triggers (I tested the map though, and btw the level value on the multiboard doesn't seem to increase), so I just referred to the triggers in the description. If those are the wrong triggers, then update the description and let me know--I'll take a look at it.
 
Top