Hi, since making Campaign-Mirror maps are my specialty, I thought I might as-well contribute to the community on how to do boss bars.
Now this is my first tutorial, so please go easy on me ><
What are boss bars?
A boss bar is basically an interface tool that allows you to constantly see the health of a certain unit, very useful in campaign-mirror maps. Alot of people don't know that you can actually "link" a boss bar to a unit, and make it refresh to the units health every time the health of the unit changes. To do this is very easy, all you need is two simple triggers
Setting the boss bar
The first thing you need to do is create a boss bar. As seen here
Now obviously you need an event - For testing purposes i made it so when i type "Event4" as a chat message, the actions will take place.
Trigger: Display boss bar
BossbarID: This is what you set so other triggers can recognize that this is the boss bar you are referring to, lets make it just "1"
Title: This is just what it says above the boss bar, Just set it to Boss for now.
Portraits: There are 3 portraits for this, one for Terran, Zerg, and Protoss, I'm using the Protoss one.
Max: It doesn't matter what you put here, it will be changed with our next trigger anyways.
Players: Chooses witch player can see the boss bar.
Now for the trigger that "Links" the boss bar to the unit.
Linking The Boss Bar
First off, lets place a random unit on the map. Now lets go into the trigger editor
Trigger:Set Boss bar Boss
BossbarID: If your boss bar you just made was ID 1, then set this to 1.
Boss: This is the unit you link your boss bar to, go into values, and select your unit, for this example, I used the
Xel"naga Colossus for one of my campaign maps
Refresh: Make sure you select do here, all I know about this is that it works.
There you go! You're done!
Now make another unit to attack that unit to try it out!
Sorry if it is a little messy, my first Tut here, hope this helped!
hi, Is there a way to add other elements to this boss bar ? such has an XP bar and power of unit ( mana )
The way I did it for Energy was to take set up a boss bar, change the ID to 2, changed the image to the protoss one (Not sure if it makes a difference, but it turned out blue for me, so it made more sense), and used the UI Boss Bar action Move to give it an offset so it wasn't on top of the HP one, and set the value to the max value of your target's Energy (mana). From there, I made another trigger that detected a change in the energy of said unit, used a conversion to set a variable to the amount of current energy the unit has, and to update the boss bar on that variable's current value using the UI Set Boss Bar action (make sure you set it to 2, not 1. :D)
I'm pretty sure you can do the XP bar based on the same one I explained above.
Here's some pictures in case my explaining is crap. :D
Thanks for the shorty tutorial, I learned how to do this in another tutorial , but its always nice to learn others ways, like how you can make it appear by and event (somethings I just don't think of, but i see many reasons to use this!), and this one was actually an easier set up then the tutorial I was doing for a game mode.
With all the helpful resources and great tutorials by you guys creating/donating tutorials, sc2mapster works like GangBustas! :)
Im wondering if its possible to have (say i was making a custom interface) this boss bar not show until a unit is clicked and applys for any unit i click, move it to the bottom of the screen, and to basically just show everything besides that blue background you got there. and to rearange the order of this boss bar. Like Unit name above the unit icon and thats above the health bar, and change the size of those specific differently.