• 🏆 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!

[Trigger] Scripted Lightning Effects

Status
Not open for further replies.
Level 7
Joined
Jul 9, 2012
Messages
158
Hey Hives
I have some troubles with creating a lightning effect with custom scripts. I want to create a spell that hits a unit with a beam of lightning from above (using the Z-coordinate), but I can't make it work.
Please help :) thanks
 
Last edited:
Level 25
Joined
Sep 26, 2009
Messages
2,377
Explanation:
  • set udg_YourLightning = AddLightningEx(*lightning type*, *true/false*, GetLocationX(udg_YourPoint1), GetLocationY(udg_YourPoint1), GetLocationZ(udg_YourPoint1) + 40, GetLocationX(udg_YourPoint2), GetLocationY(udg_YourPoint2), GetLocationZ(udg_YourPoint2) + 70)
*lightning type* is a lightning type and it consists of 4 capital letters that need to be in quotes - for example "DRAL" for Drain Life lightning.
*true / false* is visibility. If true, lightning will not appear in Fog of War (= darkened area).
The +40 or +70 after GetLocationZ add +40/+70 height to that point, so the lightning is in air, not on ground.
Your_Lightning is a *Lightning* variable
YourPoint1 and YourPoint2 are *point* variables


Example:
  • set udg_L = AddLightningEx("LEAS", true, GetLocationX(udg_p1), GetLocationY(udg_p1), GetLocationZ(udg_p1) + 40, GetLocationX(udg_p2), GetLocationY(udg_p2), GetLocationZ(udg_p2) + 70)
 
Last edited:
Level 7
Joined
Jul 9, 2012
Messages
158
Wait, it's still not working. (I'm getting the error message)

I have made a Lightning variable called Lightning.
  • Actions
    • Set Point1 = (Center of Region 000 <gen>)
    • Set Point2 = (Random point in (Playable map area))
    • Custom script: set udg_Lightning = AddLightningEx(LEAS, TRUE, GetLocationX(udg_Point1), GetLocationY(udg_Point1), GetLocationZ(udg_Point1) + 40, GetLocationX(udg_Point2), GetLocationY(udg_Point2), GetLocationZ(udg_Point2) + 70)
 
Last edited:
Level 7
Joined
Jul 9, 2012
Messages
158
Should "true" then be with small letters? I have no clue of what i'm doing wrong. Have tried many different things, and yet it is still showing the error message :(
  • Custom script: set udg_Lightning = AddLightning("LEAS", TRUE, GetLocationX(udg_Point1), GetLocationY(udg_Point1), GetLocationZ(udg_Point1) + 40, GetLocationX(udg_Point2), GetLocationY(udg_Point2), GetLocationZ(udg_Point2) + 70)
 
Level 5
Joined
Aug 9, 2012
Messages
119
yes but JASS has totally different command to write so u must... memorize?
or at least know all the function :D
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
yes but JASS has totally different command to write so u must... memorize?
or at least know all the function :D

No just practice in ( 1 months or 3 weeks ) because I learned JASS in 3 weeks :O anyway it is more safe when using vJASS ( I learned basics from vJASS but I didn't learn in structs, allocation , deallocation , textmacros, Zinc.) Anyway I'll learn that when I'm in 14 or 15 years old ( 13 years old from now :ogre_haosis: )
 
Status
Not open for further replies.
Top