Thread: Timed Effects
View Single Post
Old 01-21-2009, 10:34 PM   #3
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,279

Submissions (17)

moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

Quote:
Originally Posted by Rising_Dusk
Although, I see lots of flaws in this method versus Deaod's. Firstly, you are dynamically creating timers for use in your code, which is a thing of the past. You should probably use a flavor of TimerUtils for this library, as it will remove that unnecessary and silly step.
What?? No!!! I'm not creating timers for each effect if you mean that. I use a single timer that controls all the effects. It seems the struct arrangement is confusing you. Every method in a struct that is called onInit will run at map init.

Quote:
Additionally, this doesn't allow effects to be created after an X second delay from when the function is called. I think that is a useful quantity to have access to in a library such as this.
Well, honestly in all my time coding I've never needed this as a regular function, I achieve this with the spells themselves rather than using a system because it has not been a common task, but well, we can do that... like an extension of this script.

Quote:
Finally, I think the mode for calling the code is not as effective as it should be. I recommend the following function form --
Collapse JASS:
call UnitAddTimedEffect("Some_File_Path.mdx", X, Y, DELAY, DURATION)
call UnitAddTimedEffectTarget("Some_File_Path.mdx", SOMEUNIT, DELAY, DURATION)
I think that would be the optimal manner by which to code it for it to fit into jass' syntax structure most effectively.
well, I did this function in that way because in this way I cover all the kind of effect possible, but I can't deny your proposal is nice too. I'll do something to make happy everybody, a library extension with that input form, inline friendly.
moyack is offline   Reply With Quote