HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Auto Healthbar Sucks

02-12-2009, 02:28 AM#1
Joker
the
Collapse JASS:
call UnitAddAbility( a, 'Aloc' )
call ShowUnit( GetEnumUnit(), false )
call UnitRemoveAbility( a, 'Aloc' )
doesn't work with it on.
02-12-2009, 08:31 AM#2
Captain Griffen
Selection size -1?
02-12-2009, 08:43 AM#3
DioD
selection size -1 will bug selection rings under unit's feet.
02-12-2009, 12:28 PM#4
emjlr3
what exactly is it your attempting to accomplish with that script?
02-12-2009, 12:38 PM#5
Belphegor666
Quote:
Aloc (Locust): A unit that is given locust becomes unselectable, untargetable and ignores any pathing limitations. This means it can only be controlled and ordered with triggers. It won't show a life bar over its head too. Now to get rid of locust UnitRemoveAbility(u, 'Aloc') won't work therefore you'll need to chaos transform the unit into a different temporary unit type and immediately transform it back. However if the unit had been transformed with a chaos ability before then adding locust will make it unselectable but still targetable and it will also obey pathing rules. Another option to get rid of locust is the following hiding the unit, removing the ability and unhiding it again.


Collapse JASS:
function UnitRemoveLocust takes unit u returns nothing
    local boolean backup = not IsUnitHidden(u)
    call ShowUnit(u, false)
    call UnitRemoveAbility(u, 'Aloc')
    call ShowUnit(u, backup)
endfunction

This solution has some side effects. The health bar above the unit as well as the player name when you move your mouse over the unit will not be shown any more. So this would also be a trick to get rid of those tooltips and health bars.
He is trying this. Wasn't there a catch that Aloc can't be removed once added or something?

I would suggest giving all units Locust in WE and using UnitRemoveLocust to remove it.
02-12-2009, 01:45 PM#6
emjlr3
groovy....
02-12-2009, 04:55 PM#7
Captain Griffen
If that's the thing, he's doing it the wrong way around.
02-12-2009, 05:07 PM#8
Belphegor666
How so? He seems to be hiding the unit, removing locust and then revealing it which seems same like the code I quoted.
02-12-2009, 05:41 PM#9
Captain Griffen
*should think before posting, even when in a hurry*
02-12-2009, 06:43 PM#10
Opossum
You should probably either use GetEnumUnit() or "a".
I doubt they're the same.
Collapse JASS:
call UnitAddAbility( a, 'Aloc' )
call ShowUnit( >>>GetEnumUnit()<<<, false )
call UnitRemoveAbility( a, 'Aloc' )
02-13-2009, 04:42 AM#11
Bobo_The_Kodo
You just need to do:

Collapse JASS:
call UnitAddAbility( u, 'Aloc' )
call ShowUnit( u, false )
call ShowUnit( u, true )
02-13-2009, 05:47 AM#12
Belphegor666
Quote:
Originally Posted by Bobo_The_Kodo
You just need to do:

Collapse JASS:
call UnitAddAbility( u, 'Aloc' )
call ShowUnit( u, false )
call ShowUnit( u, true )
Shouldn't he remove the Aloc afterwards?
02-13-2009, 10:56 AM#13
Bobo_The_Kodo
Unhiding it does automatically
02-13-2009, 11:27 AM#14
Belphegor666
That is a neat trick.
02-13-2009, 07:45 PM#15
Joker
Well here's what I've noticed. The script I posted doesn't work without the autobar. I only assumed it would work with it on is because if I held down the alt key while the autobar was up, I was not able to select any of those units. o.0