Trigger Question

guitar89

New Member
Reaction score
0
When i do a trigger of needing 30 seconds to complete, being used 2 times within 30 seconds, wat wll happen. Like

Event : A unit cast a spell
Condition : Unit of ability being cast equals to *target*
Action : ~actions~
wait for 10 seconds game-time
~actions~
wait for 10 seconds game-time
~actions~
wait for 10 seconds game-time

when a unit triggered this trigger when its running, wat will happen ?
Run 2 times together ? Overwrite run (cancel the first run, run second run)? or it will crash ?
 

saw792

Is known to say things. That is all.
Reaction score
280
Both will run. That is why you need to be very careful when you use waits in functions as your variable data may be overwritten while the wait is occuring.
 

guitar89

New Member
Reaction score
0
if i use once more about 10 seconds later after the first run, it will start with 2 different sections ? mean one is doing action about on 10 seconds later, and run from initial ? Do you mean like that ? If i want to make a recastable skill(triggered, complicated skill), how do i do it before it happens again without leaking locations and unitgroup ?
 

Ryuu

I am back with Chocolate (:
Reaction score
64
> it will start with 2 different sections ?

Yes. However, if there are any variables set between or after the waits, they will be overwritten. Therefore it is good to make arrays for the variables of that trigger.

> mean one is doing action about on 10 seconds later, and run from initial ?

Yes.

> Do you mean like that ?

Yes.

> If i want to make a recastable skill(triggered, complicated skill), how do i do it before it happens again without leaking locations and unitgroup ?

Like I said earlier, you have to have arrays for the variables in that trigger. How, you ask.
Check out Flare's solution for making MUI spells.

If you have any questions, feel free to ask.
 

vypur85

Hibernate
Reaction score
803
Actually, Flare's method doesn't exactly solve the wait problem (but of course, there are workarounds to make it work). It generally solves the timer problem.

To really solve the wait problem, use locals, which are incorporated into arrays.

Example:
Code:
Event
 A unit starts the effect of an ability
Condition
Actions
 local integer udg_k
 If then else
  Condition - If
    i Less than 500
  Then - Actions
    Set i = i + 1
  Else - Actions
    Set i = 1
 Set k = i
 Set Target[k] = (Target unit ability being cast)
 Set Point[k] = Position of (Target unit ability being cast)
 Wait 10 seconds
 Unit - Cause (Triggering unit) to damage Target[k] X damage....
 Wait 10 seconds
 Unit - Cause (Triggering unit) to damage Target[k] X damage....
 Wait 10 seconds
 Unit - Create 1 Footman at Point[k] for someone facing somewhere....
 Custom script:   call RemoveLocation (udg_Point[udg_k])

This somewhat incorporate Flare's method and local method. It's mentioned in this thread by Sooda. Probably not many people understood the tutorial, which makes it not so active. But of course, it's not efficient, which makes learning JASS even more important.
 

BarzahdX

Active Member
Reaction score
18
Or you could use other lame "fixes" by either increasing the cooldown, decreasing the duration, or have multiple triggers, and have the original one set to turn itself off as it turns on the other one, during the wait.. Of course you'd set the other triggers to also have other variables.
 

guitar89

New Member
Reaction score
0
cause i want to make a reset cooldown item, with needed to fixes those problem will cause in reset cooldown.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top