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

A little help to create abilities

Status
Not open for further replies.
Level 7
Joined
Dec 14, 2012
Messages
192
Hello there.

I want to create a few abilities, but I need to use triggers for that, most likely.
I searched around a lot, yet I find most of the games relatively confusing. But maybe a simple example, how to create such a skill, would be enough for me.

So, what do I want to do~ I want to "combine" two base skills, practically: Entangling Roots + Life Drain. I'll just give a short description:

Roots a target enemy unit for 10 seconds, hindering the targeted unit from moving. During this time, 50 health is drained every second from the unit.
The spell should not be channeled, but rather instant.
(Note that the numbers are pwetty random)

Could someone show me how to create this skill? This would surely be very helpful.
Note that I am not experienced at all with triggers and variables.

I thank you in advance.
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
Note that I am not experienced at all with triggers and variables.

then you should really read up tutorials about triggering first, it won't be enough to just show you how to create the spells without even knowing a single thing of triggering. not that i don't want to help you, but first you need to help us.
 
Level 7
Joined
Dec 14, 2012
Messages
192
then you should really read up tutorials about triggering first, it won't be enough to just show you how to create the spells without even knowing a single thing of triggering. not that i don't want to help you, but first you need to help us.
I read a number of tutorials and am reading them right now, too.
I simply do not understand it completely. Okay, well, I do understand things - but I am just very unsure(especially about variables).
For once, I'd like to know: What kind of methods are at my avail? Can I(Or should I) completely code the skill with trigger? Can I just "combine" two custom skills in one? Do I need a dummy-unit for that, that casts the second skill?
I am unsure about all of these things. An example would most probably give me a lot of clarity there.

As I mentioned, I already have read a number of guides and such~ I just need some help to get started. I am pwetty good at figuring things out myself, provided I generally know what I am doing.
 
Level 7
Joined
Dec 14, 2012
Messages
192
About the drain part...
Does it creates Lightning (Drain Lightning) from Caster to Target ?
Is there any distance limit which the drain would be cut-off ?
I would not want the lightning to be there, actually. I want roots(Or to be precise: Tentacles. But that wouldnt be quite possible, I guess) to come from beneath the target and clutch it, rooting it in place and damaging the target(Like Entangling Roots). The only part I want to change is, that it drains instead of damages, actually. I tried things - many things - to somehow make this skill work, but I am left with no methods. So I thought about using triggers~

Edit: Sorry, saw your question only after i posted ^^"
 
Level 7
Joined
Dec 14, 2012
Messages
192
Okay, here's the test map.
Thanks, the spell works great^^
I've looked through and found out, you are actually doing it fully with triggers. I do understand most of the triggers, but I am a bit at a loss with the variables~ I figured out that you need to set a certain value to the variables through triggers and I pretty much understand what the values mean~ I do not, however, understand these variable types and what they do. If you could explain them to me or provide me with a link to a comprehensive guide, I would be grateful.

Also, I do not quite understand the "Else Actions" within "DT Loop".
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Ready for the long post ?

  • DT Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set DT_DrainSetup[1] = 30.00
      • Set DT_DrainSetup[2] = 40.00
      • Set DT_DrainSetup[3] = 50.00
      • Set DT_Ability = Entangling Roots
      • Set DT_Buff = Draining Tentacle
      • Set DT_DrainSFX = Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
DT_DrainSetup[] is an array variable in which the number inside it representing level power. For example, at level 1 (DT_DrainSetup[1]), the drain would be 30 per second while at level 3 (DT_DrainSetup[3]), drain would be 50 per second

As for other variables, you understand, right ?

  • DT Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to DT_Ability
    • Actions
      • Set DT_MaxIndex = (DT_MaxIndex + 1)
      • Set DT_Caster[DT_MaxIndex] = (Triggering unit)
      • Set DT_Target[DT_MaxIndex] = (Target unit of ability being cast)
      • Set TempInteger = (Level of DT_Ability for DT_Caster[DT_MaxIndex])
      • Set DT_Drain[DT_MaxIndex] = DT_DrainSetup[TempInteger]
      • Trigger - Turn on DT Loop <gen>
What I did here was a method called indexing which will make your spell MUI (and also, SMUI).
If you do not understand what is MUI and SMUI, let me explain.

MUI
It stands for Multi-unit Instanceability - in which it refers to the capability of the trigger to handle the ability for all instance of it at a time. In English, when you cast this spell by 2 units at the same (or within the duration of the spell while still running), the spell won't be bugged (overwritten) and will work for each instance flawlessly. Without indexing or hashtable, you can't make a trigger to become MUI (well, yes you can, but you have to use local variable for that) but locals are not advised to be used if the trigger does a very long job because it will lose its efficiency - somehow.

SMUI
Stands for Stacking Multi-unit-Instanceability in which it refers to the trigger's capability to handle the spell/system without overwriting it from a same instance of unit. If let's say Caster casts a spell to Target provided that the spell lasts for 5 seconds. In the 3rd second, Caster re-cast the spell again to Target. If the trigger is not SMUI, it will overwrite the first cast, and resets the counter (duration) to 5. If it is SMUI, it will handle each instance respectively, therefore the duration would be 2 seconds left and 5 seconds left, applied to the unit.

  • DT Loop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer DT_CurrentIndex) from 1 to DT_MaxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (DT_Target[DT_CurrentIndex] is alive) Equal to True
              • (DT_Target[DT_CurrentIndex] has buff DT_Buff) Equal to True
            • Then - Actions
              • Unit - Cause DT_Caster[DT_CurrentIndex] to damage DT_Target[DT_CurrentIndex], dealing DT_Drain[DT_CurrentIndex] damage of attack type Spells and damage type Normal
              • Unit - Set life of DT_Caster[DT_CurrentIndex] to ((Life of DT_Caster[DT_CurrentIndex]) + DT_Drain[DT_CurrentIndex])
              • Special Effect - Create a special effect attached to the origin of DT_Caster[DT_CurrentIndex] using DT_DrainSFX
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
              • Set DT_Caster[DT_CurrentIndex] = DT_Caster[DT_MaxIndex]
              • Set DT_Drain[DT_CurrentIndex] = DT_Drain[DT_MaxIndex]
              • Set DT_Target[DT_CurrentIndex] = DT_Target[DT_MaxIndex]
              • Set DT_CurrentIndex = (DT_CurrentIndex - 1)
              • Set DT_MaxIndex = (DT_MaxIndex - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • DT_MaxIndex Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
As for this trigger's explanation, it's pretty simple.
The IF/THEN/ELSE function, is for the trigger to decide whether the spell should end, or keep on draining.
It uses 'And' condition, which both must be true, for the spell to be continue, if either 1 of the condition is not true, the spell would stop.

Condition 1 - isTargetAlive ?
Condition 2 - isTargetHasBuff ?

The first condition checks whether the target is still alive or dead.
The second condition checks the Target unit if it still has the buff - this indicate the duration of the spell (which you can edit it in Object Editor).
SpellDuration == BuffDuration

As in the ELSE block, it does nothing but to de-index your indexing so that the indexing is dynamic, you would not have a waste index lying around in the game memory - it does not relate to the spell, at all, it's just a method to Dynamic Indexing.
 
Level 7
Joined
Dec 14, 2012
Messages
192
Ah thanks, that was very comprehensive. When I'll have time, I'll think I am up to try and create a simple ability on my own. Hopefully, it will work out~ Once I have some experience, I can start to edit my old creations with my newfound wisdom. You see, I have already created a Naga-Race(Working and balanced, it is practically finished~ But I haven't used triggers, so I may find some new, interesting skills. Also, I sometime feel a certain lack of models for some units/Buildings).
Right now, I am creating a demon-race. But for many many skills, I need triggers~ ALso, I once again suffer from a certain lack of models, but well~


But, let me ask a few things. As far as I understand now, arrays are used, if the variable contains more than one instance, correct? For example, different levels, different casters, different targets etc. etc. I am correct with that, yes?

Another question: What exactly is the "TempInteger"-variable for?

Other than that, I think I pretty much got it.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
But, let me ask a few things. As far as I understand now, arrays are used, if the variable contains more than one instance, correct? For example, different levels, different casters, different targets etc. etc. I am correct with that, yes?
Arrays are usually used if you are not certain of how many instance you're going to have.
If you a pre-defined instance, it should not be arrayed.
Another reason to make a variable array is because we want to make it unique to one instance at a time give the properties of MUI to it.

You can also use non-array variable - by using Hashtable.
Well, actually Hashtable is an array, but a 2D-array which consists of parentKey and childKey.

It really depends on the situation you want it to be.

Indexing gives you properties of stacking effect while Hashtable gives you properties of overwriting effect and load speed when searching instance of something, compared to arrays, which use Linear Search, proves to be quite slower.

Another question: What exactly is the "TempInteger"-variable for?
Whenever you see the word "Temp", it means it is a TEMPorary, which means the data saved is for temporary usage and can be used with the same variable for another trigger as well without bugging other triggers.

TempInteger means, temporary integer variable, which the variable saves the Level of that ability so that it can drain according to the spell level.

Let's say;
TempInteger = Level of Ability
Drain = DrainSetup[TempInteger]

If let's say the ability is 3, the Drain would be equivalent to DrainSetup[3] which is 50.00 (refer to the trigger in the test map).
 
Level 7
Joined
Dec 14, 2012
Messages
192
Thanks, that was helpful. Well, I'll see what I can do on my own now~ I think a grasped the concept and can possibly also apply it.

Just on a sidenote, though~ What exactly is hashtable? Never heard of it o_O
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
ust on a sidenote, though~ What exactly is hashtable? Never heard of it o_O
Like I said, Hashtable is a 2D-array which consists of parentKey and childKey

Let's say you're gonna save a 200 Integer value to a unit, it should look like this;
  • Hashtable - Save 200 as 0 of (Key (Triggering unit)) in Hashtable
200 being the value
0 being the childKey
(Key (Triggering unit)) being the parentKey
Hashtable being the storage where all these data is saved

Next time if you want to load it from that unit, you would do this;
  • Set TempInteger = (Load 0 of (Key (Triggering unit)) from Hashtable)
TempInteger should take values of '200' by now.
 
Status
Not open for further replies.
Top