| 06-27-2007, 09:12 PM | #1 |
i've been working on this one hero for some time that has a trigger that creates a lightning effect.. sets it to a variable.. then every so often it moves the lightning effect to new points of where 2 units are standing.. however i've noticed that i keep getting a warcraft memory fault error.. crashing as that trigger is taking place and i couldn't figure out why it was doing it. so i tested and tested to see what is taking place as i happen to be using that trigger.. and i've noticed that it always takes place when this one other unit decides (it has it's own ai) to cast "spirit link". it doesn't happen every time because the spirit link has to be cast just at certain instantances. it seems that it goes off when the lightning effect is initially create and spirit link is also linking units. i would like to know how this could get in the way when my trigger is not based on spirit link and really has nothing to do with any spells in general.... and here spirit link isn't even a triggered spell. it's the normal one that blizzard made with no modifications. i could understand if it were two triggers with two lightning effects somehow getting mixed but this is really weird. any clue how to avoid this? the two must exist as both are a major part of the game. |
| 06-27-2007, 10:09 PM | #2 |
you're probably destroying a lightning effect that doesn't exist, that causes an instant crash |
| 06-27-2007, 10:10 PM | #3 |
Moving lightning effects and trying to kil them at the same time = crashes. This could be your problem. To fix it, set the lightning to another variable, set the original lightning variable to null, and delete that new variable. |
| 06-27-2007, 11:26 PM | #4 |
Thanks! well that is a relief. i thought it was something beyond my control here. at least i hope this is what the problem is cuz i wont feel so helpless. I work in gui and i noticed i can't do a lightning comparison in that so i had to resort to converting it to script and then did a lot of copy-pasting (hehehe) and here is what i come up with.: In each place that i did a destroy (which all happen to be gui with no move functions in it) i did it like this: Trigger: ![]() Lightning - Destroy LightEffect
![]() Custom script: set udg_LightEffect = nullAnd in the trigger that moves the lightning i had to convert it to script and added this into it around the move function to cover it's tail: JASS:
if ( udg_LightEffect == null ) then
call DestroyLightningBJ( udg_LightEffect )
set udg_LightEffect = null
call AddLightningLoc( "DRAL", udg_Point1, udg_Point2 )
set udg_LightEffect = GetLastCreatedLightningBJ()
else
call MoveLightningLoc( udg_LightEffect, udg_Point1, udg_Point2 )
endifby the way, this is a periodic timer of .02 sec so this is run often enough and what i am hoping that i am doing here is that when it is equal to null i dont move it at all and redestroy it to make it extra safe.. then purposely set it to null to be even safer yet.. then create a new lightning and then set it again to the fresh one. When the trigger runs the next time it wont check as null and should move it in the else function each run until it screws itself up again. I've tested it out for several minutes so far and have not experienced a crash! i'm hoping that we got it!! still going to test some more. thanks guys! |
