Alternatives to Locust? Unselectable, but still...

ninjaalamode

New Member
Reaction score
0
I've been using locust on the units in my map to make player controlled units unselectable, but it doesn't seem to allow for them to be picked in triggers, and they can't be hit by spells either.

Is there an alternative to Locust units that allows for a player controlled unit to be unselectable, yet still able to be picked through triggers, and still able to be hit by spells?
 

Jedi

New Member
Reaction score
63
Pick every units owned by player, picks units with locust.But I doubt you can damage them.If you are going to deal damage with triggers, you can remove locust before deal.
 

ninjaalamode

New Member
Reaction score
0
Removing Locust before the main part of the trigger goes off sounds like it would work, but I can't seem to find the actual ability in the Unit - Add Ability GUI. I tried looking for it in the object editor as well, but I couldn't seem to find it.
 

roXplosive

New Member
Reaction score
15
You can add it directly with the editor when editing a unit . If you need to add it in a trigger use the following custom text :
JASS:
call UnitAddAbility(yourunit,'Aloc')


take care since 'Aloc' is case sensitive and represents a number it is different from 'aloc'
 

Jedi

New Member
Reaction score
63
Create an ability variable with name Locust, and add this action to a trigger that fires at map initialization.
Trigger:
  • ATriggerWhichFiresInitialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: set udg_Locust = 'Aloc'
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
Create an ability variable with name Locust, and add this action to a trigger that fires at map initialization.
Trigger:
  • ATriggerWhichFiresInitialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: set udg_Locust = 'Aloc'

Don't you mean integer variable?
 

ninjaalamode

New Member
Reaction score
0
So, I added that map initialization trigger with Locust as an ability variable, messed with my ability trigger a bit to add in removing Locust, and it doesn't seem to work.

This is what I have for my trigger...

Trigger:
  • CQC
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to CQC
    • Actions
      • Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in (Units owned by (Picked player) matching ((Distance between (Position of Soldier[(Player number of (Owner of (Casting unit)))]) and (Position of (Matching unit))) Less than or equal to 250.00)) and do (Actions)
            • Loop - Actions
              • Unit - Remove Locust from (Picked unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Current order of Soldier[(Player number of (Owner of (Casting unit)))]) Equal to (Order(<Empty String>))
        • Then - Actions
          • Unit - Order Soldier[(Player number of (Owner of (Casting unit)))] to Orc Tauren Chieftain - War Stomp
          • Unit Group - Pick every unit in (Units within 250.00 of (Position of Soldier[(Player number of (Owner of (Casting unit)))]) matching ((((Matching unit) belongs to an ally of (Owner of (Casting unit))) Equal to False) and ((Matching unit) Not equal to Soldier[(Player number of (Owner of (Cas and do (Actions)
            • Loop - Actions
        • Else - Actions
          • Unit - Set mana of (Casting unit) to ((Mana of (Casting unit)) + 50.00)


The very first part is where I tried to make it so the trigger would select units within range of a certain unit and then remove Locust, so that in the later part of the trigger they could be selected normally. The trigger runs fine except for the parts involving the picked units that I've been trying to remove Locust from.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
You actually can't pick Locusted units with most "picking-methods", but one that works is "Pick every unit of player", so I would suggest you first pick (All players) and then pick every unit owned by (Picked player) and it should work ;)
 

ninjaalamode

New Member
Reaction score
0
You actually can't pick Locusted units with most "picking-methods", but one that works is "Pick every unit of player", so I would suggest you first pick (All players) and then pick every unit owned by (Picked player) and it should work ;)
That's pretty much what I did in the first part of the trigger, except I used "all players matching a condition". I changed it to just "all players" and it still doesn't work.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Sorry, I just realized that I didn't actually look for that XD

Ok, but can you show the trigger where you set this 'Locust' variable ? :eek:
 

ninjaalamode

New Member
Reaction score
0
Yurp, here ya' go.
Trigger:
  • LocustInitialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: set udg_Locust = 'Aloc'
 

Bogrim

y hello thar
Reaction score
154
Don't you mean integer variable?
Although ability GUI variables are basically just integer variables, you still need to specify it as an ability for the variable to appear in the drop-down menu of variables when selecting an ability in the GUI.
 

educator

New Member
Reaction score
9
couldnt you just use a trigger to force anyone who selects the unit to deselect it imediatly (this would allow the unit to be the target of 'unit target' spells)
 

ninjaalamode

New Member
Reaction score
0
couldnt you just use a trigger to force anyone who selects the unit to deselect it imediatly (this would allow the unit to be the target of 'unit target' spells)
No, when you do that the player still has enough time to give the unit orders if he/she is fast enough.

Also, I've know tried targeting a specific pre-placed unit and removing locust from it with "Unit - Remove Locust from Soldier 0026", and yet the unit still acts as though it has Locust and isn't able to be picked through triggers.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
it can be picked but not with triggers which check for units within range/rect.

this:
"Pick all units within (Playable map Area)"
or
"Pick all units within range of 128 to ..."
doesnt work.

this:
"Pick all units of player 1 red"
or
"Pick all units matching (Matching unit is Alive) Equal to True"
does work perfectly fine.
 

rotten

New Member
Reaction score
2
A simple solution is to make an invulnerable dummy with no model/shadow, flying, 0 collision size. Base it off Wisp.

Also, don't keep the dummy around for too long. Spawn it, order it to cast whatever it needs to and remove it from the game at once. With wisp base you can use kill as well, but remove is cleaner.

If they are visible units which have a longer role, just make a looping trigger that will remove all units of that type from the player's selection. This should be possible in normal World Editor if I don't have Alzheimer's. Average human reaction time is 0.2 seconds, so you can give it this interval, but it may cause lag.

Use Unit group - pick every unit in units currently selected by target player, if unit type is X, remove it from selection.
 

ninjaalamode

New Member
Reaction score
0
Well, my problem is fixed, thanks for the help everyone. I ended up making the units not actually owned by the players themselves, so that they couldn't give them any orders. Everything seems to be working fine now.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top