wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Resources > Code Resources > Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 06-16-2009, 09:53 PM   #46
akolyt0r
In Flames
 
akolyt0r's Avatar
 
Join Date: Jan 2006
Posts: 1,154

Submissions (3)

akolyt0r has a spectacular aura about (120)

Default

Quote:
Originally Posted by Flame_Phoenix
I read the documentation before posting on this thread Anitarf, you taught me that the hard way ...


This does not solve my problem ...
Assume for instance my user is an idiot, or a newb bigger than me, and that he makes:
Collapse JASS:
set TimedLoop_PERIOD = 10 //in seconds...

So, when my hero dies I set a boolean to false and ... 10 SECONDS later the spells dies ...
Correct me if I am wrong, but this is horrible =S
My question is: "Is there a way to make this work without having to wait TimedLoop_PERIOD seconds?"
If no, can it be added?

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.
akolyt0r is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 06-16-2009, 10:06 PM   #47
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default

So you are saying I should ... do something like this?
Collapse JASS:
//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
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition

Last edited by Flame_Phoenix : 06-17-2009 at 02:20 PM.
Flame_Phoenix is offline   Reply With Quote
Old 06-17-2009, 01:24 PM   #48
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default

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
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition
Flame_Phoenix is offline   Reply With Quote
Old 06-17-2009, 01:58 PM   #49
akolyt0r
In Flames
 
akolyt0r's Avatar
 
Join Date: Jan 2006
Posts: 1,154

Submissions (3)

akolyt0r has a spectacular aura about (120)

Default

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 !!!
__________________
akolyt0r is offline   Reply With Quote
Old 06-17-2009, 02:21 PM   #50
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default

Quote:
i meant that boolean as struct member ... didnt make that clear though 0.o
Ya ...I already do that ... (realized my example was in bad shape and fixed it)

Quote:
and of course you should NOT NOT NOT call onTimedLoop manually !!!
Meh xD

So, I am really forced to wait those 10 seconds?
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition
Flame_Phoenix is offline   Reply With Quote
Old 06-17-2009, 06:39 PM   #51
akolyt0r
In Flames
 
akolyt0r's Avatar
 
Join Date: Jan 2006
Posts: 1,154

Submissions (3)

akolyt0r has a spectacular aura about (120)

Default

Quote:
Originally Posted by Flame_Phoenix
Ya ...I already do that ... (realized my example was in bad shape and fixed it)


Meh xD

So, I am really forced to wait those 10 seconds?

NO... you really need me to do this ? -.-

Expand JASS:

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.
akolyt0r is offline   Reply With Quote
Old 06-17-2009, 07:23 PM   #52
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default

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
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition
Flame_Phoenix is offline   Reply With Quote
Old 06-17-2009, 07:40 PM   #53
akolyt0r
In Flames
 
akolyt0r's Avatar
 
Join Date: Jan 2006
Posts: 1,154

Submissions (3)

akolyt0r has a spectacular aura about (120)

Default

Quote:
Originally Posted by Flame_Phoenix
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

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 ..
__________________
akolyt0r is offline   Reply With Quote
Old 06-17-2009, 07:46 PM   #54
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default

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)
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition
Flame_Phoenix is offline   Reply With Quote
Old 06-17-2009, 07:52 PM   #55
akolyt0r
In Flames
 
akolyt0r's Avatar
 
Join Date: Jan 2006
Posts: 1,154

Submissions (3)

akolyt0r has a spectacular aura about (120)

Default

Quote:
Originally Posted by Flame_Phoenix
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)

post your spell in the Trigger&Scripts forum, maybe we can help you there ...
we should stop to spam Vex's thread ...
__________________
akolyt0r is offline   Reply With Quote
Old 06-17-2009, 08:54 PM   #56
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

Quote:
Originally Posted by Flame_Phoenix
Ako, in that example you will wait 10 seconds ...
No, he won't, only idiots will wait 10 seconds, and Vex already explained more than ten posts ago what he thinks of them, so why do you keep bringing these 10 seconds up? Seriously. That's like saying "any spell that uses TimedLoop will bug if the user sets the TimedLoop_PERIOD to a value larger than the spell's duration." No shit, Captain Obvious! Guess what? Even if you coded the looping yourself instead of using TimedLoop, users could still break it with moronic inputs. Just let it go, nobody cares about this "problem".
__________________
Anitarf is offline   Reply With Quote
Old 06-17-2009, 09:08 PM   #57
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default

Quote:
Just let it go, nobody cares about this "problem".
Fine, I will make sure you remember these words once you start seeing my codes using this procedure.
Quote:
post your spell in the Trigger&Scripts forum, maybe we can help you there ...
we should stop to spam Vex's thread ...
I guess there is no need for that now ... thx anyway.
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition

Last edited by Flame_Phoenix : 06-17-2009 at 09:10 PM.
Flame_Phoenix is offline   Reply With Quote
Old 05-23-2011, 03:02 AM   #58
SanKakU
User
 
Join Date: Jan 2009
Posts: 136

SanKakU has a little shameless behaviour in the past (-2)

Send a message via AIM to SanKakU Send a message via MSN to SanKakU Send a message via Yahoo to SanKakU
Default

i like your simple scripts. this one and itemdex are both seeming to work out nicely.
SanKakU is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 04:26 AM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services