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
Why do you need a separate trigger to check for energy changes? Shouldn't the bar update by itself?
I set up a health bar.. worked fine.
Then I set up another bar with a different ID and told it to use the unit's energy.
In game, I see two bars. HP and MP.. but the values are both HP. The bars are identical. When I get hurt, both bars update.
I even tried setting MP to a variable that updated whenever the units energy changed, but it still just used the health.
Edit: The reason I used "Triggering player +10" was to ensure no two bars had the same ID. If I had two players, Player 2's HP bar would be "2" and MP bar would be "12".
Edit 2: Figured out setting the bar to the unit overrides everything else and forces it to use HP.
Edit 3: Five drinks later, figured it out. I'm just an idiot. :)
Still wondering why or did you figure it all out? To be honest, I just did it that way to ensure it would work, as I'm not sure if it would or wouldn't work otherwise.
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.
I did the "only show when you have something selected" thing on this map. Feel free to look. As for rearranging parts of it, I'm certain that's possible with layout overrides.
Edit: Actually, the boss bar is a dialog made via triggers (see TriggerLibs/NativeLib.galaxy).
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?
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!
Thanks a lot, this is a great job! :)
@ArakaraLDA: Go
<333 Thanks a lot.
I'm working on my own mission/campaign atm, do you think you could make a conversation or portrait handling tutorial? :)
@Habladabla: Go
As in transmissions? All it is one trigger, where you can change the unit, portrait, duration, and text/sound
just search for "Transmissions" under actions
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
@Feithless: Go
Why do you need a separate trigger to check for energy changes? Shouldn't the bar update by itself? I set up a health bar.. worked fine.
Then I set up another bar with a different ID and told it to use the unit's energy.
In game, I see two bars. HP and MP.. but the values are both HP. The bars are identical. When I get hurt, both bars update.
I even tried setting MP to a variable that updated whenever the units energy changed, but it still just used the health.
Edit: The reason I used "Triggering player +10" was to ensure no two bars had the same ID. If I had two players, Player 2's HP bar would be "2" and MP bar would be "12".
Edit 2: Figured out setting the bar to the unit overrides everything else and forces it to use HP.
Edit 3: Five drinks later, figured it out. I'm just an idiot. :)
@JTG2003: Go
Still wondering why or did you figure it all out? To be honest, I just did it that way to ensure it would work, as I'm not sure if it would or wouldn't work otherwise.
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! :)
thnx again!
Doesn't appear to be working for me. Would someone mind uploading an example?
@Volsky: Go
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.
@kottonmouthx8: Go
I did the "only show when you have something selected" thing on this map. Feel free to look. As for rearranging parts of it, I'm certain that's possible with layout overrides.
Edit: Actually, the boss bar is a dialog made via triggers (see TriggerLibs/NativeLib.galaxy).