• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[General] Giving units, of certain type, abilities.

Status
Not open for further replies.
Level 2
Joined
May 7, 2021
Messages
4
Hello,
I would like to ask how can you add certain abilities to units of type, that means even those that aren't on the map (like units that are trained afterwards)
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,503
I don't fully understand your question so maybe one of these two answers will help:

Go into the Object Editor, find the unit-type that you want to edit, and click their Abilities field where you can Add/Remove abilities.

OR

Go into the Trigger Editor and create a new trigger like so:
  • Events
  • Unit - A unit enters entire map
  • Conditions
  • Unit-type of (Triggering unit) Equal to Footman
  • Actions
  • Unit - Add Bloodlust to (Triggering unit)
Units should only ever "enter" the map once, which happens when they're first created.
 
Level 2
Joined
May 7, 2021
Messages
4
Ty for the answer,
I have it like this:
There is 4 difficulties, and in the 4th one, units gain extra abilites, so I just add there this condition?

Or something else?
 

Attachments

  • Výstřižek.PNG
    Výstřižek.PNG
    70.8 KB · Views: 14

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,503
That seems like a good start, but if those units can also be created with triggers/trained from a barracks-type structure then they won't receive the ability.

So I would also set a Variable that tracks the difficulty:
  • Set Variable Difficulty = "Easy"
  • Set Variable Difficulty = "Medium"
  • Set Variable Difficulty = "Hard"
You can use a String variable or an Integer variable.
  • Set Variable Difficulty = 1
  • Set Variable Difficulty = 2
  • Set Variable Difficulty = 3
I prefer Integer because that allows the use of Arrays which would use your game difficulty as their [Index]. This can help keep things organized and manageable.

Now whenever a Mur'gul Reaver enters the map you can use an If Then Else statement to check the state of this difficulty variable:
  • If Difficulty Equal to "Easy" then Unit - Add Ability to (Triggering unit)
 
Level 39
Joined
Feb 27, 2007
Messages
4,989
An easier way to do this is to give the units all abilities in the OE, but make the high difficulty abilities have a techtree requirement. When that difficultly is activated, simply research the tech for the owner of those units via triggers or create 1 of the appropriate unit hidden somewhere on the map to satisfy the techtree requirement.
 
Status
Not open for further replies.
Top