• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Timed waves aren't working

Status
Not open for further replies.

Ardenian

A

Ardenian

Hello,

I have the following issue with my spell:

  • Events
    • Unit - A unit starts channelling an ability
  • Trigger - Turn on CH Damage <gen>
  • Time - Every 3.00 seconds of game time
I basically have two different parts: One for the cast, as seen in the first trigger tag. This turns on the second one, a periodic trigger that occurs every 3 seconds.

My problem is, the second trigger does not hit always the same. Sometimes it hits immediately and sometimes it takes 3 seconds, as wished, until it hits. I mean the initial hit, then it hits rather every 3 seconds.

How can I fix this ? I would be glad to receive an answer.
 

Ardenian

A

Ardenian

Thank you for your answer :)

If I use the 0.03 seconds variant, why is it different from using the 3 seconds ?
If I counter to a certain value, then there can be a delay, too, can't there, as with 3 seconds.

For the timer solution, do I have to create a timer like this and then check whether it is + 3 seconds greater than before until I activate the second trigger ?
 
0.03 seconds will also run when trigger is turned off, but you will will achieve better precision.

Every 3 seconds -> the fail is between 0 and 3 seconds when you jump in.
Every 0.03 seconds -> the fail is between 0 and 0.03 seconds when you jump in.

So the smaller the timeout the smaller you will recognize incorrect measurement

You also can use <each 0.1 seconds> if you want correctness from 0 to 0.1 seconds.

Timer:
I mean start a timer that expires in 3 seconds.
That timer will fire an event for an other trigger when expiring.

Timer soltion is more precise one, but timers are not very handy in GUI.
But when only one timer would be good, it would be acceptable, too.
 

Ardenian

A

Ardenian

But the smaller time interval fires my trigger with a higher rate.
So I need to create a variable that is set to +1 every time the trigger runs and if this variable reaches a certain value, then I execute the rest of the trigger, using an IF/Then/Else ?

I think the timer solution is handy, isn't it ?
I understand the game timer way, but not the one for the expiring timer. What do I have to set in the timer creation as 'last expired timer' ?

EDIT: Solved it with using the first way you suggested, thank you very much!
 
Yes you need a integer variable and If/Then/Else. It's a bit of overhead of course, but an quite simple solution.

Timer:
Create a timer variable names "myTimer".

When you wanna start:
  • Countdown-Timer - Start myTimer as a Einmalig timer that will expire in 3.00 seconds
When you wanna catch the event when timer expires:
  • Time - myTimer expires
But to we talk about a MUI concept? Because there won't be a very simple timer solution.
 

Ardenian

A

Ardenian

Yes, the MUI / GUI issue is the next thing I have to face.
In its current state the spell can only be casted by a single unit, can't it ?

I use the solution you offered me first, the counter, thank you very much, I think it works now!
 

Ardenian

A

Ardenian

Alright, so I would create a Counter[PLAYERNUMBER] and instead of the casting unit CS_CastingUnit I would create a CS_CastingUnit[PLAYERNUMBER], is this alright ?

The loop would be using Integer A ? For every Integer A from ... ?
 
If you want MPI (multiple player instanceabiity) only, then PlayerNumber would be enough.
If you want MUI you need indexing system. Look at "Dynamic indexing" in my signaute.

And yes loop through integer from 1 to MaxIndex. MaxIndex will also be an intteger that will represent your amount of current instances.
But don't use IntegerA/B. They are not recommended. Use your own inetger instead. There is also a loop operation for custom integer.
 

Ardenian

A

Ardenian

Thank you, the tutorial was very helpful! I think I managed to adapt it for my own trigger, it should be MUI now.

Thank you very much for your patience and help!
 
Status
Not open for further replies.
Top