HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Need a "mini tutorial" template to make this type of spell>

05-23-2006, 08:55 PM#1
Fulla
Id like to make a series of spells that work like this:

A projectile spells, like a mix of StormBolt & Shockwave.

You target a point or unit and the Caster throws/shoots a projectile towards that direction, it dissipates on contact with the first enemy unit & does an effect to that unit.

Im not sure how to do this? in GUI!!!
I assume:

Create unit, order to move towards direction.
Then Keep checking every 0.1 seconds? If an enemy unit is within range?

Any help would be great.
thx
Fulla
05-23-2006, 10:03 PM#2
StockBreak
Quote:
Originally Posted by Fulla
Id like to make a series of spells that work like this:

A projectile spells, like a mix of StormBolt & Shockwave.

You target a point or unit and the Caster throws/shoots a projectile towards that direction, it dissipates on contact with the first enemy unit & does an effect to that unit.

Im not sure how to do this? in GUI!!!
I assume:

Create unit, order to move towards direction.
Then Keep checking every 0.1 seconds? If an enemy unit is within range?

Any help would be great.
thx
Fulla

I'll explain my GUI method, I hope it will help.
First of all, create a unit that looks exactly like a projectile (give it the locust ability, the invulnerability and the proper graphic model).
Then, when a unit casts that ability, turn ON the following trigger:

-> Every 0.02 seconds (or similar)

-> No conditions

-> Move instantly the projectile towards the target point of ability being cast (offset by a value which should increase every time);
-> Pick every unit within 100 (or what you want) range of the projectile.
-> IF the picked unit is an enemy (or what you want), then damage it by xxx, kill the projectile (to show the animation), and turn OFF the trigger.

I used this trigger a lot of times to create custom projectiles/running abilities and it worked.

EDIT: notice that you must set a maximum distance (for example 900 or similar), to prevent projectile from running forever xD (i.e. if the projectile is on 150 range of the distance of casting unit towards target point of ability being cast offset by 900, then kill it).
05-23-2006, 11:41 PM#3
Rising_Dusk
Yes, you're mostly correct Fulla.
I would create a unit, order it to move towards the angle between the caster's coordinates and the coordinates of the target point, then create a trigger that detects when another unit comes within range (Say 20~50) of the moving projectile.
I probably wouldn't move it with a timer trigger like Stock suggested unless I wanted to simulate >522 movement speed.
To be honest, I think ordering it to move to a point really far away in the given direction works just as well and is easier.

If you'd like a template in jass, just ask.
I could probably whip one up and post it in the resource section or something, sounds like something lots of people could find handy (Assuming you did a search and found that one already doesn't exist?).
05-24-2006, 08:12 AM#4
StockBreak
Quote:
Originally Posted by Rising_Dusk
Yes, you're mostly correct Fulla.
I would create a unit, order it to move towards the angle between the caster's coordinates and the coordinates of the target point, then create a trigger that detects when another unit comes within range (Say 20~50) of the moving projectile.
I probably wouldn't move it with a timer trigger like Stock suggested unless I wanted to simulate >522 movement speed.
To be honest, I think ordering it to move to a point really far away in the given direction works just as well and is easier.

If you'd like a template in jass, just ask.
I could probably whip one up and post it in the resource section or something, sounds like something lots of people could find handy (Assuming you did a search and found that one already doesn't exist?).

1) Projectiles normally moves at speeds like 1000/1500; units cannot reach those speeds, the maximum is 522 (there is a method to break this limit, but it's weird).

2) Using another trigger to detect when the unit comes within range, requires a specific unit event.

3) Normally I use math formulas, so you can move your unit at any speed to simulate a nearly perfect animation, i'll explain better my method:

- Variable Speed = Set it for example 1000/1500;
- Variable Distance = Distance between the two points (position of caster and target point);
- Varibale Time = Distance / Speed;
- Variable NumberOfSteps = Time / 0.02 -> this is the number of times the unit should move every 0.02 seconds, you can create a variable which increase every loop and when it reaches NumberOfSteps value, then break the loop and exit the trigger (I mean, the unit it's arrived at destination).
- Variable Step = Distance / NumberOfSteps -> this is the lenght of the step your unit should move every loop to simulate a (almost) perfect movement at 1000/1500 speed (changing the speed, you will change its speed). I hope it helps. Cheers.

EDIT: seems like I have a lot of free time to spend today. Here is a map to show you my method, I hope you like it.
05-24-2006, 08:14 PM#5
Rising_Dusk
I think I mentioned everything you did in my post. :P

However...
Fulla asked for "it dissipates on contact with the first enemy unit & does an effect to that unit."

What I see you've made is something that could hit multiple units.
The death rocket appears to work perfectly for what you made it do, but somehow I feel like it could be better.
Also, you can always just attach it to the post instead of uploading it elsewhere.
It is under 5mb, afterall. ^_^
05-24-2006, 08:54 PM#6
Fulla
Ok thx alot guys!!

Ill give both methods a try.
05-24-2006, 09:16 PM#7
The)TideHunter(
To be honest, i wouldent use a loop and 2 triggers, a projectile dosent require any triggers, just use a timer and H2I, simple enough.
This is what iv been working on for a while, a mutlifunctionable MUI projectile function, this has been made by Vex, but within the caster system (not saying thats a bad thing but not everybody wants alot of code for a single few functions).
05-26-2006, 07:30 AM#8
Rising_Dusk
It could definately prove very useful.
I imagine you're doing it in jass then (With the references to H2I).
If you need anything along the way, feel free to bug me; I do use a few of these suckers in my map (Done the way I suggested above).
05-26-2006, 07:57 AM#9
The)TideHunter(
Yea i think i do need help lol, iv finished the code, but for some reason its do nothing.
Il post it later, im at school and havent got the code here.
Thanks