Warcraft III resources & community, 2003–2006 · archived

Slow "FOR"

21 posts
#16
Yes, that would happen if there wasn't any chance to exist two units with the same spell, at the same time.

I don't know yet how to make multi instanceable spells with timers... But in time I'll discover, I think.

(I don't want to take you time, so if you don't want to, don't waste it answering me, ok?)
#17
arrays
(also it's waaaaaaaaaaaay faster than cache handle vars)
#18
But.. So I'll.. hum.. (lost in thoughts)

I can use only one timer for each event, even if it's array, right? Do I have to make events for each one? And is there a way to get any unit's information when one of those timers expire?

AAahhHH it's makin' me a bit confused....
#19
handle vars

here is how we would do it ( assuming you have the Handle Vars in the maps custom script secion, they can be DLed Here )

anyways, here is how the trigger would work

***uses a global unit U***

Trigger 1 - the Init
Events
(your event)
Conditions
(your conditions)
Actions
Custom Script: local timer t = CreateTimer()
Custom Script: call SetHandleHandle( t, "bob", joe )
//note - for that last thing ( the SetHandleHandle ), replace "bob" with "yourstring", yourstring being the name of where you are storing it being. replace joe with your unit ( if it is A Unit Starts the Effect Of An Ability, for example, it would be GetSpellTargetUnit() for the targeted unit and GetTriggerUnit() for the casting unit. )
//here, do any other handler sets, so for example, i could do
Custom Script: call SetHandleReal( t, "bob", joe )
//with joe being the real and "bob" being the storage name

//next, do all your stuff here

next,

Custom Script: call TimerStart( t, a, true, function Trigger_Trigger2_Actions )

//a should be the time between timer calls ( most spells use 0.01 ). note - for the part that function Trigger_Trigger2_Actions, replace Trigger2 with the name of your 2nd trigger for this. also, Trigger2 must be ABOVE Trigger1 in the list of triggers.

Trigger 2
Events
(none)
Conditions
(none)
Actions
Custom Script: local timer t = GetExpiredTimer()
//next, assuming you want to get the unit and store it in variable U
Custom Script: set udg_U = GetHandleUnit( t, "yourcategory" )
//making sure "yourcategory" is the same place in which you stored it.
//here, do everything else.
#20
Now you can replace 'bit' in my last post with 'really' :D

No, no. I understood almost everything. Just some things that got flying yet:

I didn't understand what 'a' is in "Custom Script: call TimerStart( t, a, true, function Trigger_Trigger2_Actions )"... It's a customized function, isn't it?


Thanks (THANKS) for your time!!! (It should have taken a lot of time to write all this stuff)
#21
PurplePoot//a should be the time between timer calls ( most spells use 0.01 ). note - for the part that function Trigger_Trigger2_Actions, replace Trigger2 with the name of your 2nd trigger for this. also, Trigger2 must be ABOVE Trigger1 in the list of triggers.


a is like the X in Every X Seconds of Game Time.