Post by Wigglesnapper on Nov 22, 2009 13:10:42 GMT -8
So, you interested in making some spells eh?
Lets start with a basic spell that damages an enemy unit for 200 damage.
First you'll need a dummy spell
dummy spell - a spell that does nothing.
For the spell we are making, we need to have a dummy spell that targets a unit without a stun.
I will use acid bomb. Take out all the stats for the spell (armor reduction, primary damage, etc). Remove the buffs.
Also set the range and cooldown to what you want, but make sure you don't set the duration of the spell to 0. This will fuck you up. Set it to 1 to be safe.
Next, open up the trigger editor. Create a new trigger and name it something. Now, we need a condition for the spell. Almost all spells start with the condition: "A unit starts the effect of an ability"
To find this go to event>unit>generic unit event>a unit starts the effect of an ability
We probably don't need any conditions for this spell so ignore that.
Actions comes next. To keep it simple, I'm not gonna add any thing special. Just put in: "unit- order (triggering unit) to damage (target of ability being cast for 200 damage type spells). This is found in unit>damage target
There your done your spell. This has no special effects or anything. It just does 200 damage at all levels.
Good job on your first spell!
--------------------------------------------------------------------------------
Lets expand on this now. Lets say you wanted this spell to do 100 damage at level one, 200 at level two, 300 at level three, and 400 at level four.
Go to your action line that does damage then change "200" to 100x(level of NAMEOFABILITY for (triggering unit)). This is found in arithmetic. Set the first value to 100 then change it to multiplication.
The second part is harder. Click on it, then go to "convert interger to real". Click the blue text and scroll down to "unit - level of ability for unit". Set this to level of NAMEOFABILITY for (triggering unit).
Now its better
--------------------------------------------------------------------------------------
[glow=red,2,300]Lets add special effects![/glow]
Now that we have our base damage complete we can add the flashing lights and shit.
Under the damage part, create a new action and make a "special effect" action. Create a new special effect. Click on the massive line of blue text and click on select model. Choose a model by switching over to abilities in the small drop down menu, then select something let's go with "purge".
Now that you have created a special effect you need to destroy the memory leak (really fucking important).
Definition - a memory leak is a memory leak. All you need to know is that they are evil and you need to destroy them otherwise it's going to lag the living fuck out of your computer if enough of them are left over.
Luckily for you, destroying memory leaks created by special effects is easy. Create an action after the special effect action you just made. Create another special effect action but this time use the dropdown menu to make it a "destroy special effect action" (I may not be exact since I'm not on a computer but w/e figure it out yourself). Make sure it says "destroy last created special effect.
Good job, you made a special effect for the impact of the spell. Let's move onto the missile art, skip this part if you want the spell to be instant cast but if you want it to be instant cast go into the object editor and set the missile speed of yourdummy spell to 0.
Now for missile art. There are several ways to do this and I shall show you the easiest one. Go to your dummy spell and choose missile art. Pretty straitfoward from there just make sure that missile speed is anything but 0. I recommend 600-1400 for it to look good.
Good job! Now your spell doesn't look like a piece of shit!
----------------------------------------------------------------------------------------
THE NEXT FEW PARTS OF THE GUIDE IS NOT REALLY IMPORTANT, JUST AWESOME IT EXPLAINS HOW WE CAN COMPLICATE OUR SIMPLE SPELL INTO A SPELL THAT DOES SOMETHING. YOU DONT NEED TO DO ALL OR ANY OF THEM.
-----------------------------------------------------------------------------------------
1. AOE stun and damage.
K, for this part of our spell you need to understand what dummy units are.
Definition: A dummy unit is used to help enhance spells when you are creating trigger enhanced spells. Dummy units might be invisible, look like special effects, or look like your caster. They basically cast spells to make your original spell look better.
Were gonna need a dummy unit for this spell so copy and paste a footman and do the following:
-delete all current abilities and add "locust". This makes your target unselectsable
-add invulnerable (neutral) to it's abilities
-shift click model file and type in none.mdl
- set shadow image (I think that's what it's called) to NONE
-disable it's attack
-remove food cost
Good job, you made a dummy unit.
Next go into the abilities tab and copy and paste stormbolt.
Find this: hero ability = true and set it to false
make it have the same amount of levels as your original spell.
Then:
-remove mana cost
-remove cooldown
-change range to 99999
-stun duration to w/e
-damage to whatever at each lvl. E.g, "lvl 1 - 200, lvl 2 - 300, etc."
Gj, now back to the trigger editor. After your line of destroy special effect, add in a unit group action that looks something like this:
pick all unit in (something) and do multiple actions.
For the (something) click on it, then the dropdown menu, then go to units in range matching condition. Change it to units in 300 range of (target of ability cast) matching (matching unit) is alive and (matching unit) is an enemy of (owner of (triggering unit))
k I'll walk you through the condition.
First, use the dropdown to go to "and" it will have 2 areas to put in conditions. For the first one create a Boolean condition. Click on the first line of blue text to change the Boolean type, change it to unit is alive. Then change (triggering unit) to matching unit. Now for the second blue line in the "and" condition, once again create a Boolean condition, go to Boolean type "matching unit is an enemy of player" then change "triggering unit" to matching unit, and change the last part to owner of unit (in the dropdown) then choose triggering unit.
Your done your condition!
Now when you create that action your gonna see something called loop - actions under it tabbed out. The remaining actions will be under here.
Make it look like this under the loop:
unit - create 1 (your dummy unit) for owner of triggering unit, at position of (picked unit) facing default building degrees
unit - add (your dummy spell stormbolt) to last created unit
unit -set level of (your dummy spell stormbolt) to level of (your original spell) for triggering unit
unit - add a 1 second generic expiration timer to last created unit
unit - order last created unit to Human mountain king - stormbolt (picked unit)
I'm going to clarify the last 2 lines. The second to last one destroys the unit memory leak, nuff' said. The last line is found under "unit - issue order targeting a unit (or something like that)
it doesn't matter if your dummy spell is called stormbolt because it doesn't make a difference. What matters is what you based the spell on.
Were almost done here. Just need to remove the unit group leak.
THIS DOES NOT GO UNDER THE LOOP. Click on the unit group action and then create an action called "set variable"
you will need to create a variable for this.
A variable stores info so that it can be used later. A variable name means nothing and does nothing. It just helps you find it better.
Click on the red (I think) set variable, then click "edit variables". Create a new variable using the green X and make it a unit group variable and call it whatever. I'm going to call it temp_group.
Close up the variable editor and then set the variable to (last created unit group).
Make a new action and use "custom script".
Your custom script will be (feel free to copy and paste if you're using the same variable): call DestroyGroup(udg_temp_group)
There. Now if you set the damage on the dummy stormbolt in the Object editor delete your original damage line because unless you want bonus damage, you need to remove it.
Congratulations you just made an AOE stun and damage spell.
---------------------------------------------------------------------------
Lets start with a basic spell that damages an enemy unit for 200 damage.
First you'll need a dummy spell
dummy spell - a spell that does nothing.
For the spell we are making, we need to have a dummy spell that targets a unit without a stun.
I will use acid bomb. Take out all the stats for the spell (armor reduction, primary damage, etc). Remove the buffs.
Also set the range and cooldown to what you want, but make sure you don't set the duration of the spell to 0. This will fuck you up. Set it to 1 to be safe.
Next, open up the trigger editor. Create a new trigger and name it something. Now, we need a condition for the spell. Almost all spells start with the condition: "A unit starts the effect of an ability"
To find this go to event>unit>generic unit event>a unit starts the effect of an ability
We probably don't need any conditions for this spell so ignore that.
Actions comes next. To keep it simple, I'm not gonna add any thing special. Just put in: "unit- order (triggering unit) to damage (target of ability being cast for 200 damage type spells). This is found in unit>damage target
There your done your spell. This has no special effects or anything. It just does 200 damage at all levels.
Good job on your first spell!
--------------------------------------------------------------------------------
Lets expand on this now. Lets say you wanted this spell to do 100 damage at level one, 200 at level two, 300 at level three, and 400 at level four.
Go to your action line that does damage then change "200" to 100x(level of NAMEOFABILITY for (triggering unit)). This is found in arithmetic. Set the first value to 100 then change it to multiplication.
The second part is harder. Click on it, then go to "convert interger to real". Click the blue text and scroll down to "unit - level of ability for unit". Set this to level of NAMEOFABILITY for (triggering unit).
Now its better
--------------------------------------------------------------------------------------
[glow=red,2,300]Lets add special effects![/glow]
Now that we have our base damage complete we can add the flashing lights and shit.
Under the damage part, create a new action and make a "special effect" action. Create a new special effect. Click on the massive line of blue text and click on select model. Choose a model by switching over to abilities in the small drop down menu, then select something let's go with "purge".
Now that you have created a special effect you need to destroy the memory leak (really fucking important).
Definition - a memory leak is a memory leak. All you need to know is that they are evil and you need to destroy them otherwise it's going to lag the living fuck out of your computer if enough of them are left over.
Luckily for you, destroying memory leaks created by special effects is easy. Create an action after the special effect action you just made. Create another special effect action but this time use the dropdown menu to make it a "destroy special effect action" (I may not be exact since I'm not on a computer but w/e figure it out yourself). Make sure it says "destroy last created special effect.
Good job, you made a special effect for the impact of the spell. Let's move onto the missile art, skip this part if you want the spell to be instant cast but if you want it to be instant cast go into the object editor and set the missile speed of yourdummy spell to 0.
Now for missile art. There are several ways to do this and I shall show you the easiest one. Go to your dummy spell and choose missile art. Pretty straitfoward from there just make sure that missile speed is anything but 0. I recommend 600-1400 for it to look good.
Good job! Now your spell doesn't look like a piece of shit!
----------------------------------------------------------------------------------------
THE NEXT FEW PARTS OF THE GUIDE IS NOT REALLY IMPORTANT, JUST AWESOME IT EXPLAINS HOW WE CAN COMPLICATE OUR SIMPLE SPELL INTO A SPELL THAT DOES SOMETHING. YOU DONT NEED TO DO ALL OR ANY OF THEM.
-----------------------------------------------------------------------------------------
1. AOE stun and damage.
K, for this part of our spell you need to understand what dummy units are.
Definition: A dummy unit is used to help enhance spells when you are creating trigger enhanced spells. Dummy units might be invisible, look like special effects, or look like your caster. They basically cast spells to make your original spell look better.
Were gonna need a dummy unit for this spell so copy and paste a footman and do the following:
-delete all current abilities and add "locust". This makes your target unselectsable
-add invulnerable (neutral) to it's abilities
-shift click model file and type in none.mdl
- set shadow image (I think that's what it's called) to NONE
-disable it's attack
-remove food cost
Good job, you made a dummy unit.
Next go into the abilities tab and copy and paste stormbolt.
Find this: hero ability = true and set it to false
make it have the same amount of levels as your original spell.
Then:
-remove mana cost
-remove cooldown
-change range to 99999
-stun duration to w/e
-damage to whatever at each lvl. E.g, "lvl 1 - 200, lvl 2 - 300, etc."
Gj, now back to the trigger editor. After your line of destroy special effect, add in a unit group action that looks something like this:
pick all unit in (something) and do multiple actions.
For the (something) click on it, then the dropdown menu, then go to units in range matching condition. Change it to units in 300 range of (target of ability cast) matching (matching unit) is alive and (matching unit) is an enemy of (owner of (triggering unit))
k I'll walk you through the condition.
First, use the dropdown to go to "and" it will have 2 areas to put in conditions. For the first one create a Boolean condition. Click on the first line of blue text to change the Boolean type, change it to unit is alive. Then change (triggering unit) to matching unit. Now for the second blue line in the "and" condition, once again create a Boolean condition, go to Boolean type "matching unit is an enemy of player" then change "triggering unit" to matching unit, and change the last part to owner of unit (in the dropdown) then choose triggering unit.
Your done your condition!
Now when you create that action your gonna see something called loop - actions under it tabbed out. The remaining actions will be under here.
Make it look like this under the loop:
unit - create 1 (your dummy unit) for owner of triggering unit, at position of (picked unit) facing default building degrees
unit - add (your dummy spell stormbolt) to last created unit
unit -set level of (your dummy spell stormbolt) to level of (your original spell) for triggering unit
unit - add a 1 second generic expiration timer to last created unit
unit - order last created unit to Human mountain king - stormbolt (picked unit)
I'm going to clarify the last 2 lines. The second to last one destroys the unit memory leak, nuff' said. The last line is found under "unit - issue order targeting a unit (or something like that)
it doesn't matter if your dummy spell is called stormbolt because it doesn't make a difference. What matters is what you based the spell on.
Were almost done here. Just need to remove the unit group leak.
THIS DOES NOT GO UNDER THE LOOP. Click on the unit group action and then create an action called "set variable"
you will need to create a variable for this.
A variable stores info so that it can be used later. A variable name means nothing and does nothing. It just helps you find it better.
Click on the red (I think) set variable, then click "edit variables". Create a new variable using the green X and make it a unit group variable and call it whatever. I'm going to call it temp_group.
Close up the variable editor and then set the variable to (last created unit group).
Make a new action and use "custom script".
Your custom script will be (feel free to copy and paste if you're using the same variable): call DestroyGroup(udg_temp_group)
There. Now if you set the damage on the dummy stormbolt in the Object editor delete your original damage line because unless you want bonus damage, you need to remove it.
Congratulations you just made an AOE stun and damage spell.
---------------------------------------------------------------------------