• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

'Aloc' Making a Unit Unselectable

Status
Not open for further replies.
Level 22
Joined
Jul 25, 2009
Messages
3,091
Okay, this is the code, which I copied from Amig's squad system and modified to make it more efficient.

My idea was to make every unit but the leader an 'Aloc' unit that can attack and take damage, but is not selectable. I've seen it done before, so how do I do it, and if this is close why isn't it working?

  • Else - Actions
    • Set GPoint[1] = (Position of (Trained unit))
    • Set GPoint[2] = (Rally-Point of (Triggering unit) as a point)
    • Unit - Create 1 (Unit-type of (Trained unit)) for (Owner of (Triggering unit)) at GPoint[1] facing (Facing of (Trained unit)) degrees
    • Custom script: call UnitAddAbility(GetLastCreatedUnit(),'Aloc')
    • Unit - Hide (Last created unit)
    • Custom script: call UnitRemoveAbility(GetLastCreatedUnit(),'Aloc')
    • Unit - Unhide (Last created unit)
    • AI - Ignore (Last created unit)'s guard position
    • Unit - Order (Last created unit) to Attack-Move To GPoint[2]
    • Unit - Set the custom value of (Last created unit) to GNumber
    • Custom script: call RemoveLocation(udg_GPoint[1])
    • Custom script: call RemoveLocation(udg_GPoint[2])
Reply asking for it, if you need more of the gui script.
 
Level 22
Joined
Jul 25, 2009
Messages
3,091
Tbh, I only need to remove drag selection from these specific units.

I'm trying what Maker said right now.

Edlt: It worked, but they no longer follow any of the orders they are given by the triggers, and their pathing map becomes 0. Any way to fix either of those things?
 
Last edited:
Level 22
Joined
Jul 25, 2009
Messages
3,091
Seems not (without the mentionned side effects), we are playing with a bug anyway, nothing reliable.

I would expect there is a Jass function to remove drag selection from a single unit, as there is a GUI function to remove all drag selection.

Is there any way to make sure that the leader is only selected? Other than making the units owned by a computer.
 
Level 17
Joined
Apr 27, 2008
Messages
2,455
There are plenty of jass functions which have a global effect, rather than a specific one.
There is no function to remove a drag selection from a single unit.

Is there any way to make sure that the leader is only selected?

I suppose you want mean :

Is there any way to make sure that only the leader is selected ?

Probably by model editing.
 
Status
Not open for further replies.
Top