| 07-07-2006, 05:00 AM | #2 |
After the Wait action, "Entering Unit" would no longer reference the entering unit. You have to set a variable to the entering unit at the beginning of the trigger (before the Wait action), then use that variable to reference that unit. Of course if it's a global variable, other players will replace the reference to your unit with their own, so use a unit array. |
| 07-07-2006, 06:42 AM | #4 |
But then why did it work with the Integer A ?? The Entering unit is still being replaced ! :D Anyways I'll try it ! |
| 07-07-2006, 03:13 PM | #5 | |
Quote:
Since when? Waits have never set GetEnteringUnit() too null before, neither have any of them. This is either very new, or wrong. |
| 07-07-2006, 03:45 PM | #6 |
Description of loops say you can't use waits in loops |
| 07-07-2006, 04:02 PM | #7 | |
Quote:
I thought that was only for unit groups, as I use waits on loops without trouble at all. |
| 07-07-2006, 04:25 PM | #8 |
Maybe ^^ |
| 07-07-2006, 04:32 PM | #9 |
While on this topic... I wrote this up earlier and tried testing it, but it kept returning prematurely and never showed the BJDebugMsg(...). JASS:function ITestLoops takes nothing returns nothing local timer tm = CreateTimer() local real tmrem call TimerStart(tm, 5.00, false, null) loop //********************************** set tmrem = TimerGetRemaining(tm) //*It just returns here, doesn't exitwhen tmrem <= 0.0 //*ever get out of the loop. endloop //* call BJDebugMsg("Pass") call PauseTimer(tm) call DestroyTimer(tm) set tm = null endfunction I've been trying to use this as a more accurate substitute for waits in my spells, but it needs to work first. :/ |
| 07-07-2006, 04:59 PM | #10 |
Try slamming a BJDebugMsg(R2S(tmrem)) in the loop just too see if it is elapsing. Or try running it in a different thread. Or check how polledwait works. |
| 07-07-2006, 05:03 PM | #11 |
No game time elapses while code is running. You've got an infinite loop there that quickly hits the script execution limit. |
| 07-07-2006, 05:12 PM | #12 |
Damnit... That sucks. So then is there an alternate way to use waits in loops or not? |
| 07-07-2006, 05:17 PM | #13 |
Nope, you've got to use timer callbacks. While it takes a few more lines the translation is straightforward. |
| 07-07-2006, 06:22 PM | #15 | |
Quote:
|
