- Joined
- Oct 29, 2012
- Messages
- 1,474
Wait-Action & Alternatives in GUI
Hello people!
Preview:
This is the first tutorial I submit. I might mess some things up, but I wish I can succeed letting you receive the important about the three types of Timers.
Introduction:
We all know there are efficient and inefficient ways of triggering. This tutorial includes the ways about timers/waits, some are efficient, some not.
Terms:
MUI = Multi-Units-Instance = Several Units can cast the spell at once
MPI = Multi-player-instance = Several players can cast spells through several units at once
1- Waits :
The least efficient way to create a wait/timer, is to use this action :
Actually the no-efficiency of this function isn't about its slowness, it's about how many waits of the same trigger can be ran at once ( Instance ).
Example : We have a spell of loading, we make the caster load, and to do that we pause him then after a while we unpause it.
The messed thing about this trigger is that it can be ran only by one player and one unit. If two players cast the spell at once, one unit will be paused forever, the other one will work normally. Here it comes the sake of 'MUI' timers ( See terms )... Which we will include later on...
A- Pros of waits :
- Can be used very easily and they just take one line.
- Uses one line of one trigger.
B- Cons of waits:
- They make the spells non-MUI ...
- They suck way hard with For-Each-Integer/If-Then-Else/Picking actions... they will bug hard as tested.
2- Countdown timers :
A well known way to count time. They allow the use of MUI spells and can be used greatly with MPI too... they are efficient but they take more space/lines, whereas you should create 2 triggers to make the timer work.
Above, it's an example of the using of timers in MUI spells, which responses to the expiration of any timer for any player.
A- Pros of Countdown Timers:
- Can make spells MUI
- Can be used many times and can be repeated whenever and however reconfigured.
- You can see the remaining time by creating a window or using Game - Show (Remaining Time of (Last Started Timer))...
B- Cons of Countdown Timers:
- Take two triggers to achieve the goal
3- Periodic Increasing Real (PIR) :
It's a very new way of an increasing time, it uses reals and a periodic event, and it's efficient and support MUI spells, and can't be bugged and is very different than how a normal timer works. The way to achieve this is simple, we use booleans, integers, reals and the periodic event.
For example, we have a loading bomb spell. Here is its configuration:
Pros of PIR :
- It's very efficient and fast and doesn't get bugged like timers often do.
- It can be freely controlled and configured however.
- The most MUI-Supporting timers.
- They work best with For-Each-Integer/If-Then-Else/Picking Actions, it's also a method to count units in a unit group.
- You can know the remaining time whenever. (Game - Show (String(PIR_Real))
- You can reset it whenever by using (Set PIR_Real = 0)
Cons of PIR :
- Takes more space rather than other timers.
Conclusion :
If you are planning for a Single player map, you can freely use Waits because that doesn't matter, even blizzard used it in its maps.
If you are planning to make MUI spells/Systems, I'd suggest Countdown timers and PIRs... They are very efficient and easy...
Good luck felahs !
Preview:
This is the first tutorial I submit. I might mess some things up, but I wish I can succeed letting you receive the important about the three types of Timers.
Introduction:
We all know there are efficient and inefficient ways of triggering. This tutorial includes the ways about timers/waits, some are efficient, some not.
Terms:
MUI = Multi-Units-Instance = Several Units can cast the spell at once
MPI = Multi-player-instance = Several players can cast spells through several units at once
1- Waits :
The least efficient way to create a wait/timer, is to use this action :
One-line Wait
- Wait 0.1 Seconds
Example : We have a spell of loading, we make the caster load, and to do that we pause him then after a while we unpause it.
Example
- Events
- Unit - A Unit starts the effect of an ability
- Conditions
- (Ability Being Cast) Equal to Loaded Bomb
- Actions
- Set Caster = (Triggering Unit)
- Unit - Pause Caster
- Wait 5.00 seconds
- Unit - Unpause Caster
A- Pros of waits :
- Can be used very easily and they just take one line.
- Uses one line of one trigger.
B- Cons of waits:
- They make the spells non-MUI ...
- They suck way hard with For-Each-Integer/If-Then-Else/Picking actions... they will bug hard as tested.
2- Countdown timers :
A well known way to count time. They allow the use of MUI spells and can be used greatly with MPI too... they are efficient but they take more space/lines, whereas you should create 2 triggers to make the timer work.
Countdown Timer Example
- Run Timer
- Events
- Unit - A Unit starts the effect of an ability
- Conditions
- (Ability Being Cast) Equal to Loaded Bomb
- Actions
- Set Caster[Player Number of (Triggering Player)] = (Triggering Unit)
- Unit - Pause Caster
- Countdown Timer - Start Bomb_Timer[Player Number of (Triggering Player)] that expires in 2 seconds
- Timer Ends
- Events
- Time - Bomb_Timer[1] expires
- Time - Bomb_Timer[2] expires
- Time - Bomb_Timer[3] expires
- Time - Bomb_Timer[4] expires
- Time - Bomb_Timer[5] expires
- Time - Bomb_Timer[6] expires
- Time - Bomb_Timer[7] expires
- Time - Bomb_Timer[8] expires
- Time - Bomb_Timer[9] expires
- Time - Bomb_Timer[10] expires
- Time - Bomb_Timer[11] expires
- Time - Bomb_Timer[12] expires
- Conditions
- Actions
- Player Group - Pick every player in (All Players) and do multiple actions:
- Loop - Actions
- If/Then/Else :
- Conditions
- ( (Remaining Time) of (Bomb_Timer) for (Picked Player) Lesser than 1 seconds
- Actions
- Unit - Unpause Caster[Player Number of (Picked Player)]
A- Pros of Countdown Timers:
- Can make spells MUI
- Can be used many times and can be repeated whenever and however reconfigured.
- You can see the remaining time by creating a window or using Game - Show (Remaining Time of (Last Started Timer))...
B- Cons of Countdown Timers:
- Take two triggers to achieve the goal
3- Periodic Increasing Real (PIR) :
It's a very new way of an increasing time, it uses reals and a periodic event, and it's efficient and support MUI spells, and can't be bugged and is very different than how a normal timer works. The way to achieve this is simple, we use booleans, integers, reals and the periodic event.
For example, we have a loading bomb spell. Here is its configuration:
Configuration of PIR Loading Bomb
- Events
- Unit - A Unit starts the effect of an ability
- Conditions
- (Ability Being Cast) Equal to Loading Bomb
- Actions
- ------- Configuration -------
- Set Bomb_PN = (Player Number of (Triggering Player))
- Set Caster[Bomb_PN] = (Triggering Unit)
- Set Damage[Bomb_PN] = ( Level of Loading Bomb of Caster[Bomb_PN] x 100 )
- Set Duration_Of_Loading[Bomb_PN] = 5.00
- ------- Run Spell ------
- Unit - Pause Caster[Bomb_PN]
- Player - Add (Triggering Player) to LoadingBomb_PIR_Group
- PIR Loading Bomb
- Events
- Time - Every 0.05 seconds of game time
- Conditions
- Actions
- Player Group - Pick Every Player in (LoadingBomb_PIR_Group)
- Loop - Actions
- Set PIR_PlayerNumber = (Player Number of (Picked Player))
- Set PIR_Real = (PIR_Real + 0.05) == This is our PIR, it's increasing time according to the event, if it was 0.01, then we add 0.05, but it's suggested 0.05
- If/Then/Else
- Conditions
- PIR_Real Greater or Equal to 'Duration_Of_Loading[PIR_PlayerNumber]'
- Actions
- Player Group - Remove (Picked Player) from (LoadingBomb_PIR_Group)
- Unit - Unpause Caster[PIR_PlayerNumber]
- It's very efficient and fast and doesn't get bugged like timers often do.
- It can be freely controlled and configured however.
- The most MUI-Supporting timers.
- They work best with For-Each-Integer/If-Then-Else/Picking Actions, it's also a method to count units in a unit group.
- You can know the remaining time whenever. (Game - Show (String(PIR_Real))
- You can reset it whenever by using (Set PIR_Real = 0)
Cons of PIR :
- Takes more space rather than other timers.
Conclusion :
If you are planning for a Single player map, you can freely use Waits because that doesn't matter, even blizzard used it in its maps.
If you are planning to make MUI spells/Systems, I'd suggest Countdown timers and PIRs... They are very efficient and easy...
Good luck felahs !
Last edited: