Need help for stunning through triggers

Nyph

Occasional News Reader
Reaction score
87
I'm working on a small project and I need to be able to trigger a stun.
What i mean is to have a stun and remove it after the time is up with triggers.
The problem is that if a unit is stunned and then stunned again it will come out of the second stun early.
Does anyone know how to fix this?
 

w00t22

CSS L4D DoD? Steam ID = w00t22
Reaction score
43
i did this for my spell, create a special buff for your stun thats called Stun 2 or somthing than when you go to remove the buff it removes that stun
 

Nyph

Occasional News Reader
Reaction score
87
hmm that doesnt seem to work because i want x number of stuns overlapping each other not just 2, and for your method i would have to make a new buff for each one i want attached to the target.And plus there is a buff limit.
 

Somatic

You can change this now in User CP.
Reaction score
84
Erm just remove the Buff the stun ability is based off. That should work.
 

Nyph

Occasional News Reader
Reaction score
87
no because it will remove overlapped stuns because I'm using waits
 

chovynz

We are all noobs! in different states of Noobism!
Reaction score
130
How many stuns do you want to stack? Make a separate channel stun for each of the stuns you want to allow for. That way you can refer to each as it is applied.
 

Nyph

Occasional News Reader
Reaction score
87
no. You guys probably don't understand where im coming from.
I have trigger that creates a dummy that casts an infinitely long stun on a unit, then after x seconds the buff is removed, the problem with that is if say, x = 5 and the unit gets stunned once and 2 seconds into the stun he gets stunned again by the trigger, it will remove the buff 3 seconds after, not 5.
 

Somatic

You can change this now in User CP.
Reaction score
84
I think i got it, you are running this trigger on a Global Variable?

Thats the reason why because the Variable is being over written non stop. Thus causing the timer problem.

i get what you mean.

A got stun and its removed after 5 second.
A got stun again after 2 second (First stun removing in 3 sec, 2nd stun in 5 sec)
A got release from stun (5 second full for 1st stun and still 2 Sec left for 2nd stun)

Right?

USe Local to solve this
 

Nyph

Occasional News Reader
Reaction score
87
i am using locals, it's removing the buff that isn't working
 

Somatic

You can change this now in User CP.
Reaction score
84
In that case can you calculate roughly how many times a unit can be stunned at the Maximun? IF you can then i suggest you use more then 1 Stun buff, and detect if a unit has the Buff alrd and then use a "Level X + 1" Stun to stun the target.

Edit : Forget it, use a 1 sec stun to do the job. Make it such that you get a trigger to calculate how long u want this unit to be stunned and then make a loop to stun this unit constantly every second.
Thats the best i can think of for now.
 

Nyph

Occasional News Reader
Reaction score
87
you gave me an idea... what if i detect if the unit already has the buff then prevent it from being removed for the next x amount of seconds... dunno how though

edit: and i forgot to tell you - x is a real
 

Somatic

You can change this now in User CP.
Reaction score
84
wait. I got an idea. You can check how long a Timer is left in running i belive. If so you can determine how long a unit can still get stun.
 

Nyph

Occasional News Reader
Reaction score
87
good idea but to make it mui it needs handle vars and I'm not to sure on how to do them
 

Somatic

You can change this now in User CP.
Reaction score
84
Go read up on "Advance Jass Tips" By Daelin. I think its in the Jass Forum's Sticky Thread with the Guide. It will give you quite a good idea about it. Im learning the skills for that too now....
 
Reaction score
333
Answer this question and I will make a snippet of code (vJass) for you:

When a unit is stunned:

a. The stun overrides any current stun (like normal war3).
b. The stun duration is added to the duration of any current stun.
c. The unit will be stunned for the full duration of the stun or of any current stun.
 

Nyph

Occasional News Reader
Reaction score
87
yeh i've read that like a dozen times but i still don't entirely get how to do them properly - especially in gui - bring on the custom script lol

edit: a. The stun overrides any current stun (like normal war3).
edit edit: can you explain more on c.
 
Reaction score
333
yeh i've read that like a dozen times but i still don't entirely get how to do them properly - especially in gui - bring on the custom script lol

edit: a. The stun overrides any current stun (like normal war3).
edit edit: can you explain more on c.

Instead of the latest stun overriding previous stuns, the stun that will run out first will be overwritten by the stun that will expire last.

So, for example, if I stun someone for 5 seconds, and then I wait 1 second and stun someone for 3 seconds, the 5 second stun is not canceled.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top