• 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.

AddLightningEx Problem

Status
Not open for further replies.
Level 8
Joined
Sep 7, 2008
Messages
320
I got problem with AddLightningEx, i doesnt create correct lightning ( starting/ending point and length) :eekani: You can see the image at below.
Is this action bugged :eekani:
Area :
attachment.php


  • Actions
    • Custom script: call AddLightning( "LEAS", true, GetLocationX(GetRectCenter(gg_rct_Spawn)), GetLocationY(GetRectCenter(gg_rct_Spawn)),GetLocationX(GetRectCenter(gg_rct_Region_003)), GetLocationY(GetRectCenter(gg_rct_Region_003)) )
attachment.php


  • Actions
    • Custom script: call AddLightningEx( "LEAS", true, GetLocationX(GetRectCenter(gg_rct_Spawn)), GetLocationY(GetRectCenter(gg_rct_Spawn)),150,GetLocationX(GetRectCenter(gg_rct_Region_003)), GetLocationY(GetRectCenter(gg_rct_Region_003)),150 )
attachment.php
 

Attachments

  • Area.jpg
    Area.jpg
    180.9 KB · Views: 279
  • Lightning.jpg
    Lightning.jpg
    156.6 KB · Views: 271
  • Lightning-bug.jpg
    Lightning-bug.jpg
    152.8 KB · Views: 320
Level 28
Joined
Jan 26, 2007
Messages
4,789
Also, instead of "GetLocationX(GetRectCenter(rect))", use "GetRectCenterX(rect)". GetRectCenterY(rect) works the same way.
Your method creates leaks (4 leaks every time you create a lightning effect) and contains more actions.

I also thought you had to put a period after a number if it should be a real (so "150." instead of "150"), because otherwise it would need to convert it to a real first (I do not have proof for this statement).

Cleaned up a little:
call AddLightningEx( "LEAS", true, GetRectCenterX( gg_rct_Spawn ), GetRectCenterY( gg_rct_Spawn ), 150., GetRectCenterX( gg_rct_Region_003 ), GetRectCenterY(gg_rct_Region_003), 150. )


The locations to seem a bit off, you'd expect it to be a bit higher up (towards the flower patch) in comparison to the regular lightning, but it's the other way around.
I've just tried this in a test-map and it works just fine for me (I did what ruler suggested and made the regions smaller).
 
Status
Not open for further replies.
Top