I wish to show my hero's progress to the next level using a bar similar to how the Diablo games show it. I assume it will involve a boss bar but not 100% sure.
In addition, I would like to show a tooltip with the exp required to the next level if the players hovers over their exp bar.
I wish to show my hero's progress to the next level using a bar similar to how the Diablo games show it. I assume it will involve a boss bar but not 100% sure.
In addition, I would like to show a tooltip with the exp required to the next level if the players hovers over their exp bar.
Why not use the built in one? The one that is displayed automatically for units with the veterancy behaviour. You can probably move, resize and retexture it by modifying the UI.
My apologies for replying without providing an actual answer, but it sounds like your question might fit better in the UI forum. It is indeed possible to create this function using custom dialogs, and if that's your wish, I can help you set up triggers to do that. However, a diablo-style exp bar wouldn't fit all that well in with the default SC2 UI, which leads me to think you might end up wanting to do a lot of layout editing. My experience with custom layout files is limited to editing the inventory, but I bet if you search through the UI forum, you will find some relevant information for modifying the EXP bar as well as moving / resizing / removing other UI elements.
I wish to show my hero's progress to the next level using a bar similar to how the Diablo games show it. I assume it will involve a boss bar but not 100% sure.
In addition, I would like to show a tooltip with the exp required to the next level if the players hovers over their exp bar.
Why not use the built in one? The one that is displayed automatically for units with the veterancy behaviour. You can probably move, resize and retexture it by modifying the UI.
I'm hiding the UI, so I can't use that one.
I made a diablo 3 esque dialog that fits 8 buttons in a row to use my abilities, and would like the exp bar to be placed just above it.
Ah, it sounds like you already know how to use dialogs then. Soooo, if you intend to do the exp bar via dialog, you'll need to do the following:
Create the dialog. If you are going to have more than 1 player in the map, you don't need to create duplicate dialogs for each player -- just create the 1 dialog. Save as variable.
Create dialog items.
Dialog border [Dialog Item (Image)] for the outline of the EXP bar. It's not ideal for this purpose, but feel free to download my portrait viewer map to view all borders and get their required settings. You don't need to save this as a variable.
EXP Bar [Dialog Item (Image)]. You'll probably want to create your own. I used GIMP with the free DDS plugin to create a simple square of the desired color, export it as DDS, and import into SC2. I have had varying degrees of success with exporting DDS - if I remember right, DDS 2 has most reliably worked for importing to SC2 for me. Again, you'll only need 1 of these as you can increase the bar for each individual player. Set the height to whatever you need (save height as variable) and set width to 1 (0 might work, I don't know). However, make sure you create a constant integer variable for the full size of the EXP bar, when filled. Place EXP bar at the left of the EXP bar border. Save dialog item as variable.
Current EXP dialog label (if you want the numbers always showing). Save as variable.
Current Level dialog label (if desired). Save as variable.
Set up the trigger to increase the EXP bar. If you have a trigger that checks for level-up, this can be done in that trigger or a completely separate trigger. Trigger event will probably be "Unit Gains Experience". To "increase" the experience bar, this should do the trick:
Variables:
filledSize [constant integer] - the variable you created earlier
currentExp [integer] - exp of the unit/player
requiredExp [integer] - exp required for next level
expBar [dialog item] - exp bar image (actual bar that will increase)
expBar_width [integer] - current size of the exp bar
expBar_height [integer] - height of exp bar
Trigger Actions (to increase EXP bar):
Variable - Set expBar_width = (Round(((currentExp * filledSize) / requiredExp)))
Dialog - Set (expBar) tooltip to (blah blah blah) for (Player group((Triggering player)))
If you've set up a dialog label to always display current exp / required exp, change that here
You should place the above triggers into an if/else statement that checks to see if the player leveled up. If they leveled up, do the above triggers except set the size to 1 (or 0) and whatever else. Additionally, I used the "Triggering player" function multiple times, so it's best practice to go ahead and save the triggering player as another variable so you aren't making unnecessary function calls. I've got to go, but I will check back here later tonight in case this wasn't what you needed or you need additional help. Good luck!
Hello all,
I wish to show my hero's progress to the next level using a bar similar to how the Diablo games show it. I assume it will involve a boss bar but not 100% sure.
In addition, I would like to show a tooltip with the exp required to the next level if the players hovers over their exp bar.
Hey coffeeclubbr,
My apologies for replying without providing an actual answer, but it sounds like your question might fit better in the UI forum. It is indeed possible to create this function using custom dialogs, and if that's your wish, I can help you set up triggers to do that. However, a diablo-style exp bar wouldn't fit all that well in with the default SC2 UI, which leads me to think you might end up wanting to do a lot of layout editing. My experience with custom layout files is limited to editing the inventory, but I bet if you search through the UI forum, you will find some relevant information for modifying the EXP bar as well as moving / resizing / removing other UI elements.
Ah, it sounds like you already know how to use dialogs then. Soooo, if you intend to do the exp bar via dialog, you'll need to do the following:
You should place the above triggers into an if/else statement that checks to see if the player leveled up. If they leveled up, do the above triggers except set the size to 1 (or 0) and whatever else. Additionally, I used the "Triggering player" function multiple times, so it's best practice to go ahead and save the triggering player as another variable so you aren't making unnecessary function calls. I've got to go, but I will check back here later tonight in case this wasn't what you needed or you need additional help. Good luck!
Tried anchoring the standard EXP bar to another frame?
Just did was MacMagnus suggested, seems to work perfectly :)For anybody else doing this: using custom script "" as your image is substitute for making an image yourself.