HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Regions + spells + triggers

11-19-2003, 12:59 PM#1
HEZZA
The other day when i got my new pc, i immedialty stuck wc3 & tft in and WEU. I then tested its editing smoothness which was pleaseing.

Since i forgot my old dial up acc as it was my dad who rejistered i decided to continue on making my map.

Then i decided instead of limited abilty editing i will reinforce them with triggers :D

I went to make these 2 spells as a test.

Seeker drone- A unit which is summoned which finds enemys on the map and attacks them.

Fire wall- A wall of fire which deals damage per second.

I made seeker drone ability just normal based on eagle, because its flying. Then a trigger where i added the enemy units in a unit group and would attack a random unit in that group....Nothing happens u just summon it and it stays still unitl u move it...
I want it to
A) when it gets to a certain radiues from you say 3000 it will return
B) work

Fire wall....I had all the effects and damage of the trigger bit ready i just dont have a clue to
A) make a region from triggers
B) postion it infront of the casting unit
11-19-2003, 02:04 PM#2
Biflspud
Sounds like you need to base it on Locust Swarm - make it summon 1 drone, have it return 0 life, and give it a range of 3300.

Make sure to give Unknown (aloc) ability to whatever unit you make as the seeking drone. Also, you may want to consider importing a blank .wav file to get rid of the locust buzz noise.
11-20-2003, 08:32 AM#3
HEZZA
yeah that crossed my mind but im attempting this one with triggers.
11-20-2003, 09:38 AM#4
HEZZA
oh if u cba to read that i also need to know how to CREATE a region with triggers infront of a player for say 30 secs then deleted or a simple one thats always 700 range infront of it
11-20-2003, 10:15 AM#5
Karma Patrol
That's a cinch if you're good with linear algebra. All you really have to do is figure out the slope of the line between you and where you're casting the spell, then find the perpendicular line to that. A line prpendicular to another has a negative inverse slope. Then you set out some regions along that line to check for "burning" units. Ok, first we'll find the slope.

slope = (change in y)/(change in x)
slope = (spell y - unit y)/(spell x - unit x)
spell_slope = (-1)/(slope)

Now go to the point where the spell was cast. To find where you want the regions to be, we'll use the slope-intercept form of linear equations to solve this part.

y = slope(x1-x2) + y2

We will use this equation to figure out where along the y-axis to put our regions. What you should do is loop through x values between the start and end of your wall and generate the y values.

y = spell_slope(loop x - x2) + y2

x2 and y2 are the points where the spell is cast.

y = spell_slope(loop x - spell x) + spell y

Now you can make a region at loop x and y for every cycle of the loop.
Here's a little diagram:

|- end loop x
/
/
/
/
/
/
/
x <- spell x,y
|- start loop x

The diagonal line will be your wall =D I'm sorry if the formatting didn't work, but I think you get the point.