Demonwrath
Happy[ExtremelyOverCommercializ ed]HolidaysEveryon
- Reaction score
- 47
Making Circle Spells Using GUI
created by: Demonwrath
created by: Demonwrath
This tutorial is made to help the community with triggering Circular Spells in GUI. It is made with all knowledge I have, so if there are any parts that should be included, please send me a PM, notifying me of what else should be included and I shall add it.
First I shall explain different ways of making Circular Spells.
For starters, there are three (3) basics behind Circular Spells:
1. Creating a Circle of Models
2. Allowing for Your Circle to 'Follow' a Unit/Hero
3. Making your Circle rotate around a Point, or Unit/Hero
More advanced Circle Spells can:
1. Move towards out out from a point
2. Circle a unit with increasing/decreasing height
3. Move in and out of a point while rotating
4. Rotate around a point while increasing/decreasing in height
5. Rotate around a point while moving in and out as well as increasing/ decreasing in height.
The more you know about creating Circular Spells the better, so above is everything I know what to do with Circular spells, and will somewhere be included in this Tutorial. Lets begin
What is a Circular Spell?
A Circular Spell is a spell which when activated, creates, objects (Orbs are most common) around the casting unit. Below is an example of what a Circle Spell looks like:
Now some of you may be sitting there thinking, 'OMFG THAT IS SO COOL!!!!' This is the most basic a spell that can be made using the techniques in this tutorial.
Circle Spell Basics
1. Creating a Circle of Models
1. Creating a Circle of Models
Before we begin, you will need basic knowledge of:
1. Making Dummy Units
2. The Trigger Editor
3. Variables
For this spell, we are going to have our Hero have a circle of Invulnerability Orbs (the effects from a Paladin's Divine Shield Spell) appear around him.
First we will begin by creating our Dummy unit.
First create a custom Footman in the Object Editor, and give it the name 'Divine Shield'
We will change up the Model File of the Unit, so that it is easier for us to find, and use. Change the Icon to the Divine Shield icon, and the Model File to that of the one for Divine Shield (the Model is under: Abilities- Reveal <Caster>, Item Area Detection <Caster>). Finally, go to Abilities - Normal, and add the 'Locust ability to the unit. The dummy is now finished:
Now that the dummy is finished, we will go into the Trigger Editor and create some Variables. You will need the following variables:
This is what each variable is made to do:
casterPoint - a Point that gets set to the position of your casting unit when they activate the spell.
spell1_Orb - A Unit Array that will be used to create the orbs (your Dummy Model) around the Hero. The array is set to 10 so we can create 10 Orbs
spell1_OrbPoint - A Real Array that will place the Orbs when the spell is cast. It has an array of 10, one for each Orb Created.
Okay, just one more step then we can start triggering this spell!!!
We need to make a dummy ability to use for the Orbs. Roar usually works well. Create the dummy spell just as you did your dummy unit, then change the icon and effects to whatever you wish. I am going to change the caster effects so that when the spell is cast it does the 'Archimonde Dark Portal' effects over my Hero. When your spell is finished, give it to your Hero.
NOTE: Make sure you change the Stats - Hero Ability section to True so your Hero can use the Ability
When that is ready, open up the Trigger Editor
Create a new trigger for the spell. You will need to make the Event:
Code:
Unit - A unit Starts the effect of an ability
Code:
(Ability being cast) Equal to <Your Spell>
First, we must set our variable, casterPoint, to the position of our Hero, the caster, with the following line:
Code:
Set casterPosition = (Position of (Casting unit))
Now every time we need to set an Orb to a point, we can select casterPoint, instead of Casting Unit. This also makes it easier to eliminate leaks when the trigger in finished. Next we need to create our Orbs, to do so, we put this into a loop, whether it is Integer A or Integer B does not matter, but for standards, i will use Integer A.
Code:
For each (Integer A) from 0 to 9, do (Actions)
Loop - Actions
Now we get into the bulk of the trigger, creating the Orbs. I bet you are reading this and thinking, 'IT'S ABOUT BLOODY TIME!!!' now lets get to this.
First we will create our orb. For this spell we will make the Orbs at a distance of 250 units away from the Hero. Each orb will be 36 degrees apart from each other (10 orbs x 36 degrees apart = 360 degrees = full circle):
Code:
Loop - Actions
Unit - Create 1 Divine Shield for (Owner of (Casting unit)) at (casterPosition offset by 250.00 towards (36.00 + (Real((Integer A)))) degrees) facing Default building facing degrees
Set spell1_Orb[(Integer A)] = (Last created unit)
Set spell1_OrbPoint[(Integer A)] = (72.00 x (Real((Integer A))))
CONGRATULATIONS!!! YOU HAVE JUST CREATED YOUR FIRST CIRCULAR SPELL!!!!!!
That is all for now folks. Tomorrow I will add how to add a timer so the Orbs disappear, as well as how to make the Orbs follow your Cast Unit