• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] Timer, Periodic Event and variables...

Status
Not open for further replies.
Level 12
Joined
Mar 23, 2008
Messages
942
Well, I'm wanna to do a spell that allows my archer to concentrate energy in the bow, and after releasing it, shoot a missile that deals damage to the first unit it hit.
The dummy spell is based in channel and have 1s max charge per level, 5 levels (5s max charge). Damage increase by each second charging.

But, I don't know how to make a trigger that only starts when a unit begins channeling that spell, and start repeating each second that the unit stay channeling it.

I think this have something about handlevars or whatever...
Someone know some tutorials that will help me doing this?
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
When unit starts channeling of that spell
start the spell
when unit's order is still same as spell order make it continue (in a loop)
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
Er, I would do it differently, but since I cannot talk JASS I'm just going to say it without code examples. You should use three triggers and create a boolean variable. The second trigger should check if the caster stopped casting the ability, and if he did, set the Stop variable to true. In the first trigger in the first line set Stop to false then put a loop (Integer A) with the max integer depending on the level, after that in the loop put a one second wait and run the third trigger. The third trigger should check if Stop is true, and if it's not, increase the arrow damage or whatever you wanted to do.

I have a feeling this system has a flow somewhere, I don't seem to be good at making good GUI systems. Lets just hope I did it right... :p
 
Level 12
Joined
Mar 23, 2008
Messages
942
But the problem is not about specifically this, I really need to learn how to do a periodic loop. Because I'm having problems with everything that needs this...
Why stupid blizzard didn't made a looptime (real) or something like that...

So, there is a tutorial or something about periodic loops?

Hmm how would you check if it hits someone? Making (x,y) points while x is arrows and y is a unit which gets in a <wantedrange>?
I will make a projectile trigger that stop looping if someone gets 60 distance of the arrow. and them hit that person xD
 
Level 11
Joined
Feb 18, 2004
Messages
394
Why stupid blizzard didn't made a looptime (real) or something like that...

So, there is a tutorial or something about periodic loops?

JASS:
native TimerStart takes timer whichTimer, real timeout, boolean periodic, code handlerFunc returns nothing

Pay attention to boolean periodic


JASS:
call TimerStart(CreateTimer(), time, true, function TimerLoopFunc)

http://wc3campaigns.net/showthread.php?t=89072
 
Status
Not open for further replies.
Top