• 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.

give unit-type ability with an upgrade?

Status
Not open for further replies.
Level 5
Joined
Jul 10, 2009
Messages
89
Generally, here's what I want to do: I want a unit-type to be granted an ability when a particular upgrade is researched.

In my map, I have a custom attachment ability that equips grunts with shields, but I only want it to be applied after the user researches the "Equip Shields" upgrade.

Is this possible? Thanks.
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
The second trigger is initially off.

  • Untitled Trigger 095
    • Events
      • Unit - A unit Finishes research
    • Conditions
      • (Researched tech-type) Equal to Defend
    • Actions
      • Game - Display to (All players) the text: True
      • Set Temp_Group_1 = (Units owned by (Owner of (Triggering unit)) of type Footman)
      • Unit Group - Pick every unit in Temp_Group_1 and do (Actions)
        • Loop - Actions
          • Unit - Add Defend to (Picked unit)
      • Custom script: call DestroyGroup(udg_Temp_Group_1)
      • Trigger - Turn on Untitled Trigger 096 <gen>
  • Untitled Trigger 096
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
      • (Current research level of Defend for (Owner of (Triggering unit))) Greater than 0
    • Actions
      • Unit - Add Defend to (Triggering unit)
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
add ability in object editor to your unit
make ability require - your upgrade

or

add ability in object editor to your unit

map initialization

pick every player in all players and do action
disable Your Ability for picked player


when unit finished research
enable Your Ability for owner of triggering unit/researching unit
 
Status
Not open for further replies.
Top