HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Meteor Rain Spell. Help

02-11-2007, 11:11 AM#1
SzymonK
Hello. I've decided to make Meteor Rain spell. It'll be channeling abillity I was only able to make single meteor but I need many of them.Explanation: I want to make skill that will spawn meteor every 0.5 second in random point in area ( in my case 800 ) that center is casting unit for 5 seconds. Here is what I've made:
Trigger:
Collapse Event
Unit - A unit Begins casting ability
Collapse Conditions:
(Ability being cast) is equal to Meteor Rain
Collapse Actions
Unit - Create 1 Warlock Meteor D for (Owner of (Casting unit)) at (Random point in (Region centered at (Position of (Casting unit)) with size (800.00, 800.00))) facing (Position of (Casting unit))
Unit - Order (Last created unit) to Special - Doom Guard - Rain of Fire (Position of (Triggering unit))
Unit - Add a 2.00 second General expiration timer to (Last created unit)

And my problem is - I don't know how to make next unit after that.
02-11-2007, 11:41 AM#2
CommanderZ
Use a loop

Trigger:
For Each (Integer A) from 1 to 10, do Actions
Collapse Loop - Actions
Unit - Create 1 Warlock Meteor D for (Owner of (Casting unit)) at (Random point in (Region centered at (Position of (Casting unit)) with size (800.00, 800.00))) facing (Position of (Casting unit))
Unit - Order (Last created unit) to Special - Doom Guard - Rain of Fire (Position of (Triggering unit))
Unit - Add a 2.00 second General expiration timer to (Last created unit)

If I was you, I would use Special Effects and Unit - Damage Area instead of dummy casters, its a bit overkill for this spell.

PS: If you are reall going to use dummy casters...don't forget to remove them afterwards ;)
02-11-2007, 12:31 PM#3
SzymonK
Your idea ain't working :/
02-11-2007, 12:49 PM#4
Chocobo
Quote:
Originally Posted by SzymonK
Your idea ain't working :/

The dummy unit has mana? And all whatever? By the way, the unit casts ever at the triggering unit, so..
02-11-2007, 12:50 PM#5
The)TideHunter(
Don't use Position of (Unit), unless your setting a variable to that, because thats a leak, which will slow your game down every time you use it.
Anyway, if you dont want to you Jass, which i don't think you probally will want to, you need to use a loop and a wait, here is an example:

Trigger:
Meteor Rain
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Meteor Rain
Collapse Actions
Set TempUnit = (Triggering unit)
Set TempPoint = (Position of TempUnit)
Collapse For each (Integer A) from 1 to 10, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Current order of TempUnit) Equal to (Order(!YourSpellsChannelOrderString!))
Collapse Then - Actions
Set TempPoint2 = (Point(((X of TempPoint) + (Random real number between -400.00 and 400.00)), ((Y of TempPoint) + (Random real number between -400.00 and 400.00))))
Unit - Create 1 Warlock Meteor D for (Owner of TempUnit) at TempPoint2 facing TempPoint
Unit - Order (Last created unit) to Special Doom Guard - Rain Of Fire TempPoint
Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
Wait 0.50 seconds
Custom script: call RemoveLocation(udg_TempPoint2)
Else - Actions
Custom script: call RemoveLocation(udg_TempPoint)

Although, if this is casted twice at the same time in the space of 5 seconds, it will bug.
02-11-2007, 09:34 PM#6
SzymonK
Trigger:
(Current order of TempUnit) Equal to (Order(!YourSpellsChannelOrderString!))
I don't understand what to do in this part :/ so my abillity dont work yet could You explain it to me ? I'm sorry but I'm new at triggered skills.
02-12-2007, 12:17 AM#7
Pyrogasm
Open your hero ability in the object editor. Then go down to "Text - Order string use/turn on. Insert whatever it says there (case sensitive) in place of "!YourSpellsChannelOrderString!".
02-12-2007, 08:36 AM#8
CommanderZ
TideHunter: Your trigger will prevent the spell from "going with caster" (like Epicenter in DotA), it will stop in a moment when the caster does something else, won't it? Are you sure Szymonik wants this?

Another idea: What about using polar offset? The code will be simplier and it will produce circular area:
Trigger:
Set TempPoint = (Position of (TempUnit) offset by (Random real number between 0.00 and 600.00) towards (Random angle) degrees)
02-12-2007, 08:54 AM#9
zeroXD
The trigger TheTideHunter made will just hit random spots within a square area.
And Random Angle is actually just a slower version of GetRandomReal(0, 360), or Random Real between 0 and 360.

This is how I would have done it...
Trigger:
Custom Script: set udg_TempPoint = Location( GetLocationX(udg_CastPoint)+GetRandomReal(0, 500)*Cos(GetRandomReal(0, 360)*3.14159/180.0), GetLocationY(udg_CastPoint)+GetRandomReal(0, 500)*Sin(GetRandomReal(0, 360)*3.14159/180.0) )
Like that... I know its big and complicated, but it is just a faster and more leak-free version of
Trigger:
Set TempPoint = (Position of (TempUnit) offset by (Random real number between 0.00 and 500.00) towards (Random angle) degrees)
02-12-2007, 09:42 AM#10
SzymonK
Thank you all, especially TideHunter. This was very helpful in creation of my map but I warn you I'll be back for more :). zeroXD I could't find your idea working.
02-12-2007, 10:12 AM#11
The)TideHunter(
Quote:
Originally Posted by zeroXD
The trigger TheTideHunter made will just hit random spots within a square area.

It won't be that noticable, only small corners.