![]() |
#46 | |
In Flames
Join Date: Jan 2006
Posts: 1,154
![]() |
![]() Quote:
You can do your cleanup stuff directly in your death-trigger or whatever ... but you have to make sure that the ontimeloop method wont fuck up afterwards. So the only thing you have to do is, you add some private boolean heroDead=false, set this one to true in your death-trigger, and check in the ontimeloop method if heroDead==true ...so you know that the hero is already dead, and most of the spell stuff is already cleaned up ... well except the struct itself... so return TimedLoop_STOP now ... depending on your implementation, and this system (didnt look that deep into it ..), maybe even a simple call X.destroy() would be sufficient, dunno. Last edited by akolyt0r : 06-16-2009 at 09:56 PM. |
|
![]() |
![]() |
Sponsored Links - Login to hide this ad! |
|
![]() |
#47 |
retired coder | real ilfe
|
![]() So you are saying I should ... do something like this?
__________________![]() //struct with stuff boolean stopNow = false private method onTimedLoop takes nothing returns boolean //instance's timer expired: if (stopNow) then return TimedLoop_STOP endif return TimedLoop_CONTINUE //do my other stuff! endmethod //endstruct private function Actions takes nothing returns nothing local unit vic = GetTriggerUnit() //get the struct related to this unit set stopNow = true vicStruct.onTimedLoop() endfunction private function Init takes nothing returns nothing local trigger BurningBloodTrg = CreateTrigger( ) call TriggerRegisterAnyUnitEventBJ( BurningBloodTrg, EVENT_PLAYER_UNIT_DEATH ) call TriggerAddAction( BurningBloodTrg, function Actions ) endfunction And sorry for the indentation =P Last edited by Flame_Phoenix : 06-17-2009 at 02:20 PM. |
![]() |
![]() |
![]() |
#48 |
retired coder | real ilfe
|
![]() Ako if your solution is what I implemented then it will not work because onTimedLoop is private ... meaning I can't call it from a function outside everything ...
__________________Is there a good solution for the problem I presented earlier ?? I would appreciate if someone could say one =S |
![]() |
![]() |
![]() |
#49 |
In Flames
Join Date: Jan 2006
Posts: 1,154
![]() |
![]() i meant that boolean as struct member ... didnt make that clear though 0.o
__________________and of course you should NOT NOT NOT call onTimedLoop manually !!! |
![]() |
![]() |
![]() |
#50 | ||
retired coder | real ilfe
|
![]() Quote:
Quote:
So, I am really forced to wait those 10 seconds? |
||
![]() |
![]() |
![]() |
#51 | |
In Flames
Join Date: Jan 2006
Posts: 1,154
![]() |
![]() Quote:
NO... you really need me to do this ? -.- ![]() i dont guarantee this is working code, i dont have any wc3 at hand at the moment. Last edited by akolyt0r : 06-17-2009 at 06:42 PM. |
|
![]() |
![]() |
![]() |
#52 |
retired coder | real ilfe
|
![]() Weermmmm Ako, in that example you will wait 10 seconds ... unless you call .destroy() in method .heroDied, but I think that will mess up things badly and so it is not advisable.
__________________All this time, your solution is my problem xD |
![]() |
![]() |
![]() |
#53 | |
In Flames
Join Date: Jan 2006
Posts: 1,154
![]() |
![]() Quote:
NO, because you do your "cleanup stuff" in the heroDied method ... please ...open your eyes .. lol Of course you could make another private method called cleanup or something, which you call in onDestroy and heroDied (where "//cleanup (stuff)" currently is located) if you want to avoid double cleanup code .. |
|
![]() |
![]() |
![]() |
#54 |
retired coder | real ilfe
|
![]() Wermmm Ok, I guess my big problem here is .. what am I supposed to do on the CleanUp section?
__________________I can't call onDestroy (which would be the ideal) so what's the point? (As you may have already noticed, I am having trouble on this xD) |
![]() |
![]() |
![]() |
#55 | |
In Flames
Join Date: Jan 2006
Posts: 1,154
![]() |
![]() Quote:
post your spell in the Trigger&Scripts forum, maybe we can help you there ... we should stop to spam Vex's thread ... |
|
![]() |
![]() |
![]() |
#56 | |
Procrastination Incarnate
Development Director
|
![]() Quote:
|
|
![]() |
![]() |
![]() |
#57 | ||
retired coder | real ilfe
|
![]() Quote:
Quote:
Last edited by Flame_Phoenix : 06-17-2009 at 09:10 PM. |
||
![]() |
![]() |
![]() |
#58 |
User
|
![]() i like your simple scripts. this one and itemdex are both seeming to work out nicely.
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
|