HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

areas for chainlightning and shockwave

11-12-2005, 02:49 PM#1
Mystic Prophet
I'm trying to make stat based versions of chain lightning and shockwave, but first I need to know how I can simulate the proper areas for these spells.

Shockwave does a line effect and I have no idea how to create that with an area damage action.

chainlightning jumps to several targets and i'd like to know if its possible to detect the secondary targets.

If anyone could help on this I'd greatly apreciate it. It's the last bit of information I need to complete my project.
11-12-2005, 03:00 PM#2
Vexorian
Chain lightning doesn't have any "area".

Just picks the firt target then the closest target that wasn't picked before and so and so recursively.

Shockwave doesn't have an area either cause it is moving. Instead it is better to create a dummy unit, keep moving it towards the direction and have a trigger that detects units in range of that unit
11-13-2005, 01:56 PM#3
Mystic Prophet
Ya i figured as much, was hoping i didnt have to use a dummy unit though, as that makes for a rather slow shockwave even at max unit speed.
So for chainlightning could i just use pick random target within range of first target and do so much damage and so on for each consecutive target?

hmm can't figure out how to pick targets properly on chain lightning. I suppose I'll move on to other skills for a while.
11-13-2005, 07:30 PM#4
Vexorian
Dummy units are not really limited by unit speed, you can periodically move the unit with a trigger (Use Unit - move unit , not Issue order to move)

Just use polar projections to get new points.

Remember to remove those points.

And the way chain lightning selects targets is to get the target that is closest to the last target, this is done by for example getting the unit with the lesser distance to it.

Initialize a variable with 10000 then loop through all the units, get the distance of a unit, then if that distance is less than the variable, save the unit in a variable and replace the old value of the variable with the unit's distance.

Once the loop ends you get the closest unit
11-20-2005, 12:34 AM#5
Mystic Prophet
ok with shockwave I'm trying to avoid overlapping damage. right now i'm moving the dummy unit and dealing area damage periodically which of course isn't working too well. I was thinking of picking all the units as he moves by and then damaging all picked units, but was wondering if that would cause some units to get picked twice.

For chainlightning I'm having real big problems, it's hard to explain so i'll just put in the code.

Code:
Events
  Unit- A unit starts the effect of an ability
Conditions
  (ability being cast) equal to lightning
Actions
  For each (integer integer_lightning) from 1 to (number of units in (units within 1000.00 of (target point of ability being cast))).
    Loop Actions
     Set integer_lightning = (integer((distance between (position of (target unit of ability being cast)) and (position of (matching unit)))))
     Unit-Group- pick every unit in (Units within 1000.00 (position of (target unit of ability being cast)) matching ((integer((distance (position of (target unit of ability being cast)) and (position of (matching unit))))) less than integer_lightning)
      Loop-Actions
    Unit-Cause (trigger unit) to damage (picked unit). Dealing 100.00 damage of attack type spells and damage type normal

Problem is no damage gets done and the lightning variable ends up being set to the number of units +1 rather than the distance between 2 units.
11-20-2005, 01:15 AM#6
TaintedReality
Maybe have a dummy unit cast a dummy buff on the casting unit that lasts for the exact length of time it will take the shockwave to finish. Then, make the shockwave deal 1 damage and use a Unit Takes Damage Event, with the condition being Damage Source has buff DummyBuff. Then, you can use the Unit - Damage Target action, and do something like Deal 1.5*Agility of Damage Source to Triggering Unit.

And btw, if you haven't used the Unit Takes Damage Event before, you have to add the events to it through another trigger that fires every time a unit enters the map. I think this will work, although I haven't tested it myself ^^.
11-20-2005, 02:04 AM#7
Mystic Prophet
I finished shockwave i had it set the custom value of all units it passed to 1 then damaged all units with that value and then reset their value to 0.

still at a loss for chain lightning tho.

problem with unit takes damage triggers is it has to be a specific unit, otherwise I'd try something like that for chainlightning
11-20-2005, 02:21 AM#8
TaintedReality
Quote:
And btw, if you haven't used the Unit Takes Damage Event before, you have to add the events to it through another trigger that fires every time a unit enters the map.
; ). So...
Code:
Unit Enters Map
Events:
Unit - A unit enters (Entire map)
Conditons:
None
Actions:
Trigger - Add to Chain Lightning <gen> the event (Unit - (Entering unit) Takes damage)

Just make sure that the affected units aren't pre-placed in the editor. If they are, you can select them all by hand and add them(if there aren't many this would work), or better would be to just create them through triggers rather than pre-placing.
11-20-2005, 02:21 AM#9
TaintedReality
Damn lag...I double posted on accident, sorry =\.
11-20-2005, 02:41 PM#10
Mystic Prophet
could work, but seeing as i'm editing an all ready existing map. It would be a pain to make sure that all the units aren't preplaced. I'll test it out though.
11-20-2005, 03:09 PM#11
Captain Griffen
Pick every unit in (unit group) is there for a reason...
11-20-2005, 04:03 PM#12
Mystic Prophet
that wouldn't really work. you'd have to first add each target to the unit group. and the problem im having is detecting the secondary targets.

and if you just used the unit group with all preplaced units, there's still no condition that would hit all of them. the target unit of ability being cast only affects the unit targeted and not the units it jumps too.
11-20-2005, 04:50 PM#13
Captain Griffen
Quote:
Originally Posted by TaintedReality
Quote:
And btw, if you haven't used the Unit Takes Damage Event before, you have to add the events to it through another trigger that fires every time a unit enters the map.
; ). So...
Code:
Unit Enters Map
Events:
Unit - A unit enters (Entire map)
Conditons:
None
Actions:
Trigger - Add to Chain Lightning <gen> the event (Unit - (Entering unit) Takes damage)

Just make sure that the affected units aren't pre-placed in the editor. If they are, you can select them all by hand and add them(if there aren't many this would work), or better would be to just create them through triggers rather than pre-placing.
11-20-2005, 05:52 PM#14
Mystic Prophet
well ya that works i just made another trigger that set the variable for whatever unit is casting the spell.

however. I can't get it to effect heroes. (due to their reduced spell damage) I tried making another trigger that would detect a unit taking the damage x 0.75 (which is hero's spell damage reduction) but it doesn't seem to work.

I could always get rid of the heros spell reduction in the gameplay constants but i dont really want to.