Removing Locust ability

Synthetics

New Member
Reaction score
7
Hi

Im have some major trouble trying to remove locust so that the unit is unselectable but can be targeted, i've tried everythin i could think off (im not jass literate) and had even tried messing around with jassn (unsucessfully). I've read loads of posts about it but when i type in my unit where they say to insert your unit in the jass bit of code, it has an error.

This is what i have so far if someone could correct me with it i'd be very grateful. and so would the walls of my home :banghead:

Thanks for your time

Trigger:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Locust Swarm
    • Actions
      • Unit Group - Pick every unit in (Units owned by (Owner of (Casting unit)) matching ((Unit-type of (Picked unit)) Equal to Locust)) and do (Actions)
        • Loop - Actions
          • Wait 2.00 seconds
          • Unit Group - Add (Matching unit) to test
      • Unit Group - Pick every unit in test and do (Actions)
        • Loop - Actions
          • Wait 3.00 seconds
          • Game - Display to (All players) the text: if youreading this ...
          • Unit - Hide (Matching unit)
          • Custom script: call UnitRemoveAbilityBJ( 'Aloc', GetEnumUnit() )
          • Unit - Unhide (Picked unit)
      • Game - Display to (All players) the text: hide comenced
 

Tom Jones

N/A
Reaction score
437
Firstly picked unit gets assigned after the group selection, meaning that you can't use picked unit in your matching part of the unit group selection. Use matched unit instead. Secondly, to remove locust you must do it like this:
Trigger:
  • Test
    • Events
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units owned by Player 1 (Red)) and do (Actions)
        • Loop - Actions
          • Unit - Hide (Picked unit)
          • Custom script: call UnitRemoveAbility(GetEnumUnit(),'Aloc')
          • Unit - Unhide (Picked unit)
GetEnumUnit() is jass' equal to Picked Unit, however the important thing to notice here is that you'll have to hide, remove the ability and then unhide the unit in question.
 

Synthetics

New Member
Reaction score
7
Nice 1 thanks Tom it works but not how i thought it would thx for your help tho massively appreciated + rep
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top