I am doing a mass exodus... Trying to get rid of as many triggers as possible. Currently every player in my moba map has this running for them. I believe it could possibly be a source of lag. Check it out and lend me your thoughts on how to get every allied health bar on the top left screen without using this crazy trigger.
The health bars are setup using dialog items and this trigger runs for Life, Energy, and Shields.
Can I get a yes and amen this is a source of possible lag? And maybe someone sing the hallelujah and point me in the right direction for health bars / hero icons with health bars (WITHOUT TRIGGERS) so every allied player can see each other.
Is this for nameplates or a custom frame (like campaign one?)
Anyway, in both cases, you can simple use UI editor to set it. Also, if I remember right, Unit Property Changes lags more them spect, I changed it to Every 0.2 seconds, it was alright, until I changed completely to UI editor.
It's my experience that using a repeat action creates less lag, than having a trigger like that. I've made a trigger that is run at the start of the map, which repeats forever. The repeat action has an if/then/else action, which checks if a Unit Variable is empty, if not, set a dialog item to the health pf the variable unit.
Then I have a 0.1 wait in the end of the repeat action.
This runs pretty smooth for me.
HeroPanelUpdateEventsGame-MapinitializationLocalVariablesX=0<Integer>ConditionsActionsGeneral-Repeat(Actions)foreverActionsPlayerGroup-Pickeachplayerin(ActivePlayers)anddo(Actions)ActionsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfActiveHero[(Pickedplayer)] != No Unit
Then
Dialog - Set Hero Panel - Shields Bar size to ((Integer((205.0 * ((Active Hero[(Pickedplayer)] Shields (Percent) (Current)) / 100.0)))), 14) for (Player group((Picked player)))
Dialog - Set Hero Panel - Health Bar size to ((Integer((205.0 * ((Active Hero[(Pickedplayer)] Life (Percent) (Current)) / 100.0)))), 24) for (Player group((Picked player)))
Dialog - Set Hero Panel - Energy Bar size to ((Integer((205.0 * ((Active Hero[(Pickedplayer)] Energy (Percent) (Current)) / 100.0)))), 14) for (Player group((Picked player)))
General - If (Conditions) then do (Actions) else do (Actions)
If
(Active Hero[(Pickedplayer)] Shields (Current)) <= 1.0
Then
Dialog - Hide Hero Panel - Shields Bar for (Player group((Picked player)))
Else
Dialog - Show Hero Panel - Shields Bar for (Player group((Picked player)))
General - If (Conditions) then do (Actions) else do (Actions)
If
(Active Hero[(Pickedplayer)] is alive) == False
Then
Dialog - Hide Hero Panel - Shields Bar for (Player group((Picked player)))
Dialog - Hide Hero Panel - Health Bar for (Player group((Picked player)))
Dialog - Hide Hero Panel - Energy Bar for (Player group((Picked player)))
Else
Dialog - Show Hero Panel - Health Bar for (Player group((Picked player)))
Dialog - Show Hero Panel - Energy Bar for (Player group((Picked player)))
Else
General - Wait 0.1 Game Time seconds
My map has a custom healthbar in the top corner like in the campain, thus the adjustment of size.
And if you really wan't to reduce lag, you can use this instead of Pick each player in as it creates less lag than calling a player group and so on.
Great ideas guys! Thanks for the help.... I have been slowly going through my map trying to implement these changes. Yes, using the UI editor is very difficult and not very intuitive at least for me. I like the trigger idea, but also definitely want to keep working on learning how to use the UI.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I am doing a mass exodus... Trying to get rid of as many triggers as possible. Currently every player in my moba map has this running for them. I believe it could possibly be a source of lag. Check it out and lend me your thoughts on how to get every allied health bar on the top left screen without using this crazy trigger.
The health bars are setup using dialog items and this trigger runs for Life, Energy, and Shields.
Can I get a yes and amen this is a source of possible lag? And maybe someone sing the hallelujah and point me in the right direction for health bars / hero icons with health bars (WITHOUT TRIGGERS) so every allied player can see each other.
Short answer for most of your question is: Yes.
Is this for nameplates or a custom frame (like campaign one?)
Anyway, in both cases, you can simple use UI editor to set it. Also, if I remember right, Unit Property Changes lags more them spect, I changed it to Every 0.2 seconds, it was alright, until I changed completely to UI editor.
@onlyleviathan: Go
It's my experience that using a repeat action creates less lag, than having a trigger like that. I've made a trigger that is run at the start of the map, which repeats forever. The repeat action has an if/then/else action, which checks if a Unit Variable is empty, if not, set a dialog item to the health pf the variable unit.
Then I have a 0.1 wait in the end of the repeat action.
This runs pretty smooth for me.
My map has a custom healthbar in the top corner like in the campain, thus the adjustment of size.
And if you really wan't to reduce lag, you can use this instead of Pick each player in as it creates less lag than calling a player group and so on.
EDIT: Attached a demo map.
@onlyleviathan: Go
You can use the heroes of the storm status bar xml layout as an example: http://pastebin.com/2gkFUn2L
@Demtrod: Go
You can avoid all of that by implementing the same status bars as UI layout elements.
@PirateArcade | I make games | Ask me things on Discord
@greythepirate: Go
True. I'm no wizard in the UI editor sadly, and that part of sc2mapster seems to be pretty dead sadly :/ Would love to learn how to create it though.
Anyway, you're completely right :)
@Demtrod: Go
Great ideas guys! Thanks for the help.... I have been slowly going through my map trying to implement these changes. Yes, using the UI editor is very difficult and not very intuitive at least for me. I like the trigger idea, but also definitely want to keep working on learning how to use the UI.