Height of lightning effect

Grymlax

Probably not around
Reaction score
138
Hello helpers!

I was wondering if there was some easy way of setting the height of a lightning effect. So far the only way I know how to set the height is creating a spell and then make it target an air unit, this way complicates things when I am triggering and I would prefer an easier way.

Thanks in advance.
//Grymlax
 

Sim

Forum Administrator
Staff member
Reaction score
534
Well it depends.

If you wish to create it via triggers, you can set its height when creating it. If you are casting it with a dummy, you might want to change the "Art - Projectile Launch - Z" field within the dummy unit.
 

Grymlax

Probably not around
Reaction score
138
well actually i wish to only trigger it. the way with the spell will take to much effort for the spell i'm making and it would be better if i knew how to set the height directly with triggers insted of using another spell.
 

Sim

Forum Administrator
Staff member
Reaction score
534
It is only possible through JASS, unfortunately.

Here is the function:

JASS:
native AddLightningEx               takes string codeName, boolean checkVisibility, real x1, real y1, real z1, real x2, real y2, real z2 returns lightning


"AddLightningEx" creates 1 lightning between 2 points which have x, y, and z coordinates.

x1 y1 z1 define the first point's coordinates, while x2 y2 z2 define the second point's coordinates.
 

Sim

Forum Administrator
Staff member
Reaction score
534
You can do something like this inside the GUI editor:

Custom script: local unit cast = GetTriggerUnit()
Custom script: local unit target = GetSpellTargetUnit()
Custom script: local real x1 = GetUnitX(cast)
Custom script: local real y1 = GetUnitY(cast)
Custom script: local real z1 = *whatever height at the caster's position*
Custom script: local real x2 = GetUnitX(target)
Custom script: local real y2 = GetUnitY(target)
Custom script: local real z2 = *whatever height at the target's position*
Custom script: call AddLightningEx(codeName, true, x1, y1, z1, x2, y2, z2)

Should look like that inside your spell's trigger. codeName should be the lightning effect's path.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top