• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

[Trigger] How to remove Aloc (Locust)

Status
Not open for further replies.
Hello! I discovered today this little thing, How to remove Aloc (Locust).

Okay, so you probably want to know how to do it, so here it is:
In trigger editor, do this:
  • Unit - Hide MyUnit
  • Unit - Unhide MyUnit
Now you have an unit with no locust on it.

If you want the locust back to an unit, you have to add the Aloc (locust) to an variable.
So well, do these.

Part 1 - Adding Aloc (Locust) to an Variable:
  • AddAbilityLocust
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: set udg_MyAbility = 'Aloc'
Part 2 - Adding Aloc (Locust) to an Unit:
  • AddAbilityLocust ToUnit
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Unit - Add MyAbility to MyUnit
If you got questions, or something else about this, be free to tell.

- MyUnit is not an variable, I just replaced the No Unit as MyUnit since you have to have an unique unit name, instead of something No Unit. And remember, Do target your triggers in units, not in No Unit, and allways remember to check your variables.




/bah OffGraphic bah bah.. BAH!
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
This function would yield the same results as yours:

JASS:
function RemoveLocust takes unit u returns boolean
    if not UnitRemoveAbility(u, 'Aloc') then
        return false
    endif
    call ShowUnit(u, false)
    call ShowUnit(u, true)
    
    return true
endfunction
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
This function would yield the same results as yours:

JASS:
function RemoveLocust takes unit u returns boolean
    if not UnitRemoveAbility(u, 'Aloc') then
        return false
    endif
    call ShowUnit(u, false)
    call ShowUnit(u, true)
    
    return true
endfunction

but it's not GUI and I think that is the point since you can directly remove locust with JASS while you can't do this with GUI

however I wonder why he posted it here
it's too short for a tutorial (maybe with all other ability tricks together....)
and this is no insight forum (there probably is a subforum like that but I don't know)
 
Status
Not open for further replies.
Top