Rheiko
Spell Reviewer
- Joined
- Aug 27, 2013
- Messages
- 4,121
I just want to share my experience and knowledge with others and i don't think everyone knows about this. Especially those who just starts modding.
Be aware that I don't recommend this tutorial if you don't understand basic triggering yet.
Table of Contents
- You must understand English
- You have Warcraft III and World Editor
- Knowledge about Triggers/Trigger Editor
- Knowledge about Object Editor
Did you ever wonder how to use a single target ability against multiple units?
For example: Sleep, you can only use Sleep against single unit/target but you want to use it against multiple units, like units within range or something.
We need a little bit of triggering to do this.
If you think triggering is hard to understand, it is not as hard as you think! but i will try to explain it to you as simple as i can.
Without further ado, let's get down to the business. We will start with Object Editor then we will use trigger. We will make a Sleep ability with instant cast which will put units within range to sleep.
I believe you're already familiar with Object Editor, so let's create the base ability. We will use Roar for this.
- Create a New Ability based on Roar (You may use any other instant cast abilities such as; Thunder Clap, War Stomp, Battle Roar/Roar, etc)
- Art - Caster, change it to your desired special effect, this special effect will appeared when you cast the spell.
- Data - Damage Increase (%), change it to 0.00, because we don't want the damage increase effect from this ability.
- Stats - Buff, delete the available value. Buff is status effect which will appeared at Unit's status bar. Note that even if we delete the buff the buff will still appear at unit's status.
- Stats - Duration - Hero
Stats - Duration - Unit, change both of them to 0.00. - Stats - Target Allowed, change it to none
This will be our unit's ability. This is the ability which will we click in the game, You may change its description to whatever you like.
- Create a New Ability based on Sleep (Because we will need Sleep buff to put units to sleep, same to stun. You could use Storm Bolt/Fire Bolt to stun your target)
- Data - Stun Duration, i'm not sure what is this for. But i will change it to 0.00
- Stats - Cast Range, change it to 99999 to make sure our Dummy Unit could reach the target, but this still has a problem because of visibility
- Stats - Duration - Hero
Stats - Duration - Unit, change these to your desired duration. I will change it to 2 second. - Stats - Mana Cost, change it to 0, so our Dummy Unit can use the ability without mana.
This will be our dummy's ability. It's an ability where you can't see it in the game. In order to do this we will need a help from a unit to cast the ability at the enemies. This unit is what the so called Dummy.)
- Create a New Unit, i will base it on Footman. You may use any other unit, though.
- Abilities - Normal, Add the sleep ability and Locust ability to the list. Locust ability allows our Dummy's Hit Points and Mana bar to be hidden
- Art - Animation - Cast Backswing, change this to 0.000 otherwise this method won't work properly
- Art - Animation - Cast Point, change this to 0.000 otherwise this method won't work properly
- Art - Model File, use custom path and write "Dummy" on it. Because there is no Model File with "Dummy" as a name, if you put this inside the world editor it will appear as Green Box. But in the game it will appear without any model file.
- Art - Shadow Image (Unit), change it to none. So Dummy will have no shadow beneath it.
- Damage, we will make the Dummy has no damage. So it won't attack enemy unit.
- Combat - Attack 1 - Damage Base, change it to 0
- Combat - Attack 1 - Damage Number of Dice, change it to 0
- Combat - Attack 1 - Damage Sides per Die, change it to 0
- Movement - Type, change it to Fly. So Dummy won't collide with other units in battlefield.
- Movement - Speed, change it to 0 otherwise this method won't work properly.
Take it slow and just follow the steps. You will understand how it works eventually.
Now, we will begin with the triggering part. Is it hard? No, of course not. You will be just fine.
-
Trigger
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Sleep
-
Actions-
- -------- This is the guy who use the ability --------
- Set Caster = (Triggering unit)
- -------- The Owner of Caster --------
- Set Owner = (Triggering Player)
- -------- Store Caster's position into a variable --------
- Set TempPoint = (Position of Caster)
- -------- We create our dummy --------
- Unit - Create 1 Dummy for Owner at TempPoint facing Default building facing degrees
- -------- Store him into a variable --------
- Set DummyUnit = (Last created unit)
- -------- We gives him the dummy's sleep ability --------
- Unit - Add Sleep (Dummy) to DummyUnit
- -------- We gives him an expiration timer, so he won't stay in the map forever --------
- Unit - Add a 1.00 second Generic expiration timer to DummyUnit
- -------- Pick units within 500 range of position of the caster --------
- Set Group = (Units within 500.00 of TempPoint)
-
Unit Group - Pick every unit in Group and do (Actions)
-
Loop - Actions
- -------- Store the picked unit into a variable first, because we'll use them more than once --------
- Set TempUnit = (Picked unit
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (TempUnit belongs to an enemy of Owner) Equal to True
- ((TempUnit is alive) Equal to True)
-
Then - Actions
- -------- Order him to use it against all units within 500 range of Position of the caster --------
- Unit - Order DummyUnit to Undead Dreadlord - Sleep TempUnit
- Else - Actions
-
If - Conditions
-
Loop - Actions
- -------- We remove potential leaks --------
- Custom script: call RemoveLocation(udg_TempPoint)
- Custom script: call DestroyGroup(udg_Group)
-
Events
- Things that leak
Check this to know more about things that leak - Variables
To know more about Variables, if you don't understand this tutorial. I recommend you to read this first - Things a GUI User Should Know
A Guide about GUI trigger from Beginning to Advanced levels
So how was it?
Quite simple right?
I hope this can be useful for anyone who read this
and you can use the test map if you want to confirm the validity of it or if you want to learn directly from the test map. You can download it - here
I'd like to thank these guys, for supporting and helping me in order to improve this tutorial.
And Thank you for reading all of this ^^
My thanks doesn't apply to those who just skip the tutorial and read this part, make sure to read them thoroughly!
Attachments
Last edited: