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

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: 265
  • Lightning.jpg
    Lightning.jpg
    156.6 KB · Views: 258
  • Lightning-bug.jpg
    Lightning-bug.jpg
    152.8 KB · Views: 306
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