• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Lightning Problem

Status
Not open for further replies.
Level 7
Joined
Jul 12, 2008
Messages
295
Hey guys need a little help with changing heights of the created lightning... Here's the custom script that does that:
call SetLightningZ(udg_tmpLightning, udg_startPoint, udg_endPoint, 150.)
The problem is that it is changing heights at the startpoint(position of caster) and the endpoint(position of targeted unit of ability is being cast). How to make it so it will only change the heights at the start point?
 
Level 3
Joined
Jun 6, 2007
Messages
48
Try this and tell me if it works, you need to make a variable called "flyHeight" thats of variable type real for it to work:

  • Events
    • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Blood Drain
    • Actions
      • Set flyHeight = 300
      • Set startPoint = (Position of (Casting unit))
      • Set tmpReal = (Random real number between 500.00 and 1000.00)
      • Set endPoint = (Point((Distance between (Position of (Casting unit)) and (Position of (Target unit of ability being cast))), (Distance between (Position of (Target unit of ability being cast)) and (Position of (Casting unit)))))
      • Lightning - Create a lightning effect Life Drain startPoint endPoint
      • Set tmpLightning = (Last created lightning effect)
      • Custom script: call MoveLightningEx(udg_tmpLightning, true, GetLocationX(udg_startPoint), GetLocationY(udg_startPoint), GetLocationZ(udg_startPoint) + udg_flyHeight, GetLocationX(udg_endPoint), GetLocationY(udg_endPoint), GetLocationZ(udg_endPoint) + udg_flyHeight)
 
Level 7
Joined
Jul 12, 2008
Messages
295
how to do this?
Set endPoint = (Point((Distance between (Position of (Casting unit)) and (Position of (Target unit of ability being cast))), (Distance between (Position of (Target unit of ability being cast)) and (Position of (Casting unit)))))
EDIT: It doesn't work... Can u just show me custom script to change heights only at the startPoint
 
Level 3
Joined
Jun 6, 2007
Messages
48
To change the height only at the start point by 300 you would use:

  • Custom script: call MoveLightningEx(udg_tmpLightning, true, GetLocationX(udg_startPoint), GetLocationY(udg_startPoint), GetLocationZ(udg_startPoint) + 300, GetLocationX(udg_endPoint), GetLocationY(udg_endPoint), GetLocationZ(udg_endPoint) + 300)
 
Level 7
Joined
Jul 12, 2008
Messages
295
Thanks for the help +rep.. Another question how to make the lightning to follow the targeted unit of ability being cast because when is cr8ed if the targeted unit moves the lightning stands there when it was that unit...?
 
Level 3
Joined
Jun 6, 2007
Messages
48
You would use a periodic event for the moving of the lightning.

  • How to move lightning
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
      • Some check here
    • Actions
      • Custom script: call MoveLightningEx(udg_tmpLightning, true, GetLocationX(udg_startPoint), GetLocationY(udg_startPoint), GetLocationZ(udg_startPoint) + 300, GetLocationX(udg_endPoint), GetLocationY(udg_endPoint), GetLocationZ(udg_endPoint) + 300)
 
Level 7
Joined
Jul 12, 2008
Messages
295
Doesn't work. Can u tell me why?? I rly don't get it it doesn't move the lightning
 
Level 7
Joined
Jul 12, 2008
Messages
295
guys it doesn't cr8 new lightning... Only the old 1 stays there... How to fix? The problem still remains
 
Level 14
Joined
Nov 23, 2008
Messages
187
You should set (or move) location <endPoint> to new position of unit before actually moving lightning:
  • How to move lightning
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
      • Some check here
    • Actions
      • set endPoint = (Position of <target unit>)
      • Custom script: call MoveLightningEx(udg_tmpLightning, true, GetLocationX(udg_startPoint), GetLocationY(udg_startPoint), GetLocationZ(udg_startPoint) + 300, GetLocationX(udg_endPoint), GetLocationY(udg_endPoint), GetLocationZ(udg_endPoint))
      • Custom script: call RemoveLocation(udg_endPoint)
 
Status
Not open for further replies.
Top