| 03-02-2009, 11:24 PM | #1 |
For some reason when I uncomment the highlighted code, this spell will crash my map. If I comment it out, everything works beautifully. What gives o.o JASS:scope Fireball globals private real array Tickdmg private real array Duration private real Tickmax = 12 private real Interval = 2 endglobals private function DoTLoop takes nothing returns nothing local timer t = GetExpiredTimer() local SpellData D = GetTimerData(t) call UnitDamageTargetEx(D.caster, D.target, Tickdmg[GetPlayerId(GetOwningPlayer(D.caster))], ATTACK_TYPE_NORMAL, D.DoTdmgtype, false) if (Duration[GetPlayerId(GetOwningPlayer(D.caster))] <= 2) then set Tickdmg[GetPlayerId(GetOwningPlayer(D.caster))] = 0 set Duration[GetPlayerId(GetOwningPlayer(D.caster))] = 0 call ReleaseTimer(t) call D.destroy() else set Duration[GetPlayerId(GetOwningPlayer(D.caster))] = Duration[GetPlayerId(GetOwningPlayer(D.caster))] - 2 endif endfunction function FireballDoT takes SpellData D returns nothing local timer t = NewTimer() local unit dummy = CreateCaster(D.caster) call UnitAddAbility( dummy, 'A00D') call UnitApplyTimedLife(dummy, 'BTLF', 1.0) //call IssueTargetOrder( dummy, "unholyfrenzy", D.target ) set D.DoTdmgtype = 4 if Duration[GetPlayerId(GetOwningPlayer(D.caster))] == 0 then call SetTimerData(t, D) call TimerStart(t, Interval, true, function DoTLoop) set Tickdmg[GetPlayerId(GetOwningPlayer(D.caster))] = Tickdmg[GetPlayerId(GetOwningPlayer(D.caster))] + 4 set Duration[GetPlayerId(GetOwningPlayer(D.caster))] = 6 else if Tickdmg[GetPlayerId(GetOwningPlayer(D.caster))] < Tickmax then set Tickdmg[GetPlayerId(GetOwningPlayer(D.caster))] = Tickdmg[GetPlayerId(GetOwningPlayer(D.caster))] + 4 set Duration[GetPlayerId(GetOwningPlayer(D.caster))] = 6 else set Tickdmg[GetPlayerId(GetOwningPlayer(D.caster))] = Tickmax set Duration[GetPlayerId(GetOwningPlayer(D.caster))] = 6 endif endif set dummy = null endfunction function Fireball takes SpellData D returns nothing local timer t = NewTimer() local unit dummy = CreateCaster(D.caster) set D.dummy = dummy set D.spelleffect = AddSpecialEffectTarget("Abilities\\Weapons\\FireBallMissile\\FireBallMissile.mdl", dummy, "origin") call SetTimerData(t, D) call TimerStart(t, .04, true, function MissleLoop) set dummy = null endfunction endscope |
| 03-02-2009, 11:31 PM | #2 |
...the highlighted code is over half of the script. |
| 03-02-2009, 11:35 PM | #3 |
I think he accidently left the highlight open, since only one line has a comment. |
| 03-03-2009, 12:03 AM | #4 |
Becaues you're causing a infinite loop of orders. |
| 03-03-2009, 02:32 AM | #5 |
Whoops, the highlighter doesn't like comments apparently. And how is it causing an infinite order loop? Edit: Found the problem, it wasn't anything you guys could have figured sadly since it was a flag I forgot to put on the ability so the casting system would ignore it. X_X |
| 03-03-2009, 02:38 AM | #6 |
Yes, where is the infinite loop order? Blackstastic, your problem is most likely happening elsewhere in your map script. It sounds like you're issuing an order which triggers some event that issues another order, which triggers, which orders, etc. |
| 03-03-2009, 02:59 AM | #7 |
Was nothing like that. My casting system will fire off unless the ability has a 0 cast time or non-existant ID. I forgot to set either, so a string was trying to reference an attached table without it being there. Instant Crash |
| 03-03-2009, 03:14 AM | #8 |
? How does it crash do you use execute func? Shouldnt use execute func also, get war3err so you dont get crashed while testing |
| 03-03-2009, 04:16 AM | #9 | ||
... Quote:
Quote:
AKA problem solved. Additionally, he highlighted the trouble code and explained what happened when uncommented, and it's obviously not ExecuteFunc(...). And war3err only works on v1.21 of Wc3. He'd either have to not play b.net or have a dual install. |
| 03-03-2009, 08:07 AM | #10 |
Bnet doesn't auto update WE. I just rolled it back a verison XD. |
| 03-03-2009, 11:13 AM | #11 |
Yes but war3err is a Grimoire operation that runs in-game. If you try to run it with a v1.22 wc3, regardless of your WE version, the map won't run properly, if at all. |
| 03-03-2009, 05:35 PM | #12 |
I meant that you don't need a dual install. 1.22 WC3 and 1.21 WE work in unison just fine. |
| 03-03-2009, 09:09 PM | #13 | |
Quote:
...so then this problem was entirely based on code that you didn't post. Well I'm glad you solved your problem. |
| 03-03-2009, 09:40 PM | #14 |
Kind of sort of. It was actually in the object editor. But indirectly it was the code, yes. |
