• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Line damage

Status
Not open for further replies.

Vunjo

Hosted Project: SC
Level 14
Joined
Jul 1, 2010
Messages
1,340
How to make Spell that deals line damage (Shockwave) deal damage equal to caster's Strength. Like, I know how to make single target damage, and AoE, but I don't know how to make this line damage...

PLZ Help
+REP:goblin_yeah::goblin_yeah::goblin_yeah:
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Basically you just need to do the same as AoE damage, but then move the point in which you do AoE damage.
I'll explain this in more detail:

O = AoE damage
C = caster

O
O
O
O
C

A line! :D
That's all you need to do to go from AoE damage to line damage :p

(You must be able to create MUI spells though, with JASS, indexing or hashtables).
 
Level 15
Joined
Oct 16, 2010
Messages
941
To make it like shockwave or any other line ability in Warcraft 3 you'll have to do what ap0calypse said but periodically.

So:

O @ .8 seconds
O @ .6 seconds
O @ .4 seconds
O @ .2 seconds
C @ cast

Also remember to make it so they don't overlap, so if you move the AoE point 100 yards each time then pick every unit within 49 yards of that point.
 

Vunjo

Hosted Project: SC
Level 14
Joined
Jul 1, 2010
Messages
1,340
To make it like shockwave or any other line ability in Warcraft 3 you'll have to do what ap0calypse said but periodically.

So:

O @ .8 seconds
O @ .6 seconds
O @ .4 seconds
O @ .2 seconds
C @ cast

Also remember to make it so they don't overlap, so if you move the AoE point 100 yards each time then pick every unit within 49 yards of that point.

So I will have to make 1 AoE damage in front of the hero, use wait, then 1 AoE a bit farther etc. am I right?
 
Level 8
Joined
Aug 2, 2008
Messages
193
I would use a timer instead of wait.
If you want it MUI, run a periodic timer with an indexing system.
I would have a look at paladon's Advanced Shockwave Spell linked above, there should be enough thing that could help you. There is also some kind of documentation in it, telling you how to create such a spell.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
For instantanious line damage, use advanced algabra to come with a forumula to make an algerthim to detect collections and then use 1 large enum covering all units affected by the spell and reduce from there using that algerthim.

For shockwave, you just need to perodicly do small searches in a straight line.
To get a straight line point, you use trigonometry (as I am sure you know) where...
x = magnitude*cos(alpha)+offsetx
y = magnitude*sin(alpha)+offsety
alpha = angle in radians of line from a point (the JASS natives for this are in radians but I think the crap GUI accessors for them run in degrees)
magnitude = the distance of the point from the place of origin of the line
offsetx/y = the place of origin of the line (the point where the unit stood while casting the spell usually for cases like this)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
I'd rather use Integer-type variable for the position of the dummy casting the AOE Spell per 0.2 seconds
Why? Firstly an integer is incapable of representing a position (you need a vector). Secondly the WC3 map uses floating point positions thus you will be inaccurate (largish error) if you use integer rather than a real. Thirdly all the trigonometry mentioned return real values thus integers may need typecasting to floats depending if x86 offers float and integer mixed math instructions.
 

Vunjo

Hosted Project: SC
Level 14
Joined
Jul 1, 2010
Messages
1,340
Sorry for bothering, but could someone make me a test map please? ^^
I tried, and I had few buggs, including the lagg one, so please, if you have time, make me a test map =P

I will give more reputation xD
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
try this...first set the shockwave damage to ZERO...

  • Damage
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shockwave
    • Actions
      • Set Caster = triggering unit
      • Set Formula = (Strength of Caster (Exclude bonuses))
      • Unit - create a dummy...
then use loops for this...

  • Unit - Cause (Caster) to damage circular area after 0.00 seconds of radius 100.00 at (POSITION OF DUMMY), dealing (Real(Formula)) damage of attack type Spells and damage type Normal
you must use real variable also to move the dummy unit from point1 to point2

btw point1 is the position of the dummy, point2 is the offset from point1...
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Too bad that hurts everyone, even the caster of the spell...
Never use damage area natives (or GUI). It puts heavy net traffic load (making lag as in delay and not low frame rate) and also does no validation on what it is actually hurting. Thus it will hurt destructables, allies, self, even untargetable stuff for damage making it a source of bugs (killing stuff not meant to be killable like items lieing on ground after dropping from enemy).
 
Status
Not open for further replies.
Top