1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Trigger] Scripted Lightning Effects

Discussion in 'Triggers & Scripts' started by LittleBigApple, Sep 8, 2013.

  1. LittleBigApple

    LittleBigApple

    Joined:
    Jul 9, 2012
    Messages:
    140
    Resources:
    2
    Maps:
    2
    Resources:
    2
    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: Sep 8, 2013
  2. Malhorne

    Malhorne

    Joined:
    Sep 14, 2012
    Messages:
    2,330
    Resources:
    6
    Spells:
    4
    Tutorials:
    1
    JASS:
    1
    Resources:
    6
    What exactly your problem ?
    To get the z use GetlocationZ
    To get the z of a unit use this and the flyingheight.
     
  3. LittleBigApple

    LittleBigApple

    Joined:
    Jul 9, 2012
    Messages:
    140
    Resources:
    2
    Maps:
    2
    Resources:
    2
    Just to know how to write the custom scripts properly :)
     
  4. Nichilus

    Nichilus

    Joined:
    Sep 26, 2009
    Messages:
    1,968
    Resources:
    0
    Resources:
    0
    Explanation:
    Click
    • 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:
    Click
    • 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: Sep 9, 2013
  5. LittleBigApple

    LittleBigApple

    Joined:
    Jul 9, 2012
    Messages:
    140
    Resources:
    2
    Maps:
    2
    Resources:
    2
    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: Sep 8, 2013
  6. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,426
    Resources:
    18
    Icons:
    1
    Spells:
    4
    Tutorials:
    9
    JASS:
    4
    Resources:
    18
    The custom script line should be:
    • 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)

    LEAS should be in quotes.
     
  7. LittleBigApple

    LittleBigApple

    Joined:
    Jul 9, 2012
    Messages:
    140
    Resources:
    2
    Maps:
    2
    Resources:
    2
    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)
     
  8. Nichilus

    Nichilus

    Joined:
    Sep 26, 2009
    Messages:
    1,968
    Resources:
    0
    Resources:
    0
  9. LittleBigApple

    LittleBigApple

    Joined:
    Jul 9, 2012
    Messages:
    140
    Resources:
    2
    Maps:
    2
    Resources:
    2
    Now it finally works! :) thanks alot!
     
  10. Rheiko

    Rheiko

    Joined:
    Aug 27, 2013
    Messages:
    2,936
    Resources:
    7
    Icons:
    2
    Spells:
    3
    Tutorials:
    2
    Resources:
    7
    script and jass is really sensitive
     
  11. jakeZinc

    jakeZinc

    Joined:
    Aug 13, 2013
    Messages:
    1,373
    Resources:
    20
    Spells:
    20
    Resources:
    20
    I don't think so.. xD but if you learn it how to use JASS. Actually it is easier making JASS scripts than GUI because you do need to write it not click click click everywhere but I prefer GUI :)).
     
  12. Rheiko

    Rheiko

    Joined:
    Aug 27, 2013
    Messages:
    2,936
    Resources:
    7
    Icons:
    2
    Spells:
    3
    Tutorials:
    2
    Resources:
    7
    really? i do think so

    agree
     
  13. Malhorne

    Malhorne

    Joined:
    Sep 14, 2012
    Messages:
    2,330
    Resources:
    6
    Spells:
    4
    Tutorials:
    1
    JASS:
    1
    Resources:
    6
    JASS > GUI :pP
    I hate click everywhere for less efficient script ;)
     
  14. Rheiko

    Rheiko

    Joined:
    Aug 27, 2013
    Messages:
    2,936
    Resources:
    7
    Icons:
    2
    Spells:
    3
    Tutorials:
    2
    Resources:
    7
    haha, sure thing.. for Jasser of course
     
  15. mikagami

    mikagami

    Joined:
    Aug 9, 2012
    Messages:
    112
    Resources:
    0
    Resources:
    0
    yes but JASS has totally different command to write so u must... memorize?
    or at least know all the function :D
     
  16. jakeZinc

    jakeZinc

    Joined:
    Aug 13, 2013
    Messages:
    1,373
    Resources:
    20
    Spells:
    20
    Resources:
    20
    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: )
     
  17. Rheiko

    Rheiko

    Joined:
    Aug 27, 2013
    Messages:
    2,936
    Resources:
    7
    Icons:
    2
    Spells:
    3
    Tutorials:
    2
    Resources:
    7
    just say "next year" :p
    jakeZinc D:
     
  18. Malhorne

    Malhorne

    Joined:
    Sep 14, 2012
    Messages:
    2,330
    Resources:
    6
    Spells:
    4
    Tutorials:
    1
    JASS:
    1
    Resources:
    6
    Guys i think we should stop this useless off-topic :)
     
  19. Rheiko

    Rheiko

    Joined:
    Aug 27, 2013
    Messages:
    2,936
    Resources:
    7
    Icons:
    2
    Spells:
    3
    Tutorials:
    2
    Resources:
    7
    no need, you just have to know the syntax
    that's all..

    right, fun is over guys
    back to topic D:
     
  20. mikagami

    mikagami

    Joined:
    Aug 9, 2012
    Messages:
    112
    Resources:
    0
    Resources:
    0
    Yes, there u all have it....
    Very ... funny