Hyper Triggers Explained

Lwek

Member!
Joined
May 18, 2003
Messages
4,487
Reaction score
0
Website
www.Battleforums.com
-=Explanation of the Starcraft Hyper Triggers=-
Hyper Triggers are triggers that only consist of one Preserve trigger action and atleast 6 Wait 0 Millieseconds actions. They can be for any player that is active in the game. Preferably a computer. For example, lets pretend that Player 8 is a computer:
PLAYERS
-Player 8
CONDITIONS
-Always
ACTIONS
-Comment: Hyper Trigger
-Wait 0 Millieseconds.
-Wait 0 Millieseconds.
-Wait 0 Millieseconds.
-Wait 0 Millieseconds.
-Wait 0 Millieseconds.
-Wait 0 Millieseconds.
-Preserve Trigger

You must have atleast 6 Wait 0 Millieseconds. I'd prefer 62 because then the Hyper Trigger would run more smoothly and you need 1 action for preserving the trigger and 1 action for a comment. That makes 64 actions, which is the max you can have in a trigger.

Copy the Hyper Trigger atleast 2 more times. Now you have the 3 copies of the Hyper Trigger. These 3 triggers makes all your triggers fire in a 'hyper' action. You've probably experienced that Creating a Marine with a preserve trigger will only create one Marine ever second. Having the Hyper triggers will create 7 or 8 Marines ever second.

Warning: Since you have the Hyper Triggers under Player 8, don't have any other triggers with a wait action under Player 8.

-=How Hyper Triggers Work=-
I don't even FULLY know how they work. I know most of it, I think. I'm going to use this trigger for an example:
ACTIONS
-Create 1 Marine at 'Location' for Current Player.
-Preserve Trigger.

Even though it's under Preserve Trigger, a Marine will only be created about every second.
If you add a Waiting trigger:
ACTIONS
-Wait 1000 millieseconds.
-Create 1 Marine at 'Location' for Current Player.
-Preserve Trigger.

This forces the trigger to stop for 1000 millieseconds(or 1 second) before it can continue on with the other actions. While that trigger stops for 1000 millieseconds, it forces the game to check every other trigger before it can continue.
So you have the hyper trigger that contains atleast 6 Wait 0 Millieseconds. When it waits 0 millieseconds, the game has to check through all the triggers, if conditions are met, then the trigger will fire before the Hyper trigger continues.
Trigger:
PLAYERS
-Player 1
CONDITIONS
-Always
ACTIONS
-Create 1 Marine at 'Location' for Current Player.
-Preserve Trigger

Now think hard. The CONDITION 'Always' will always be met so the actions can be fired. And then you have the hyper trigger that forces every trigger to be checked every 0 millieseconds. So now you got a Marine being created at 'Location' for Current Player constantly(only about 7 or 8 every seconds).

-=Lwek's way to do Hyper Triggers=-
This will require two computers having no other wait actions.
Triggers:
PLAYERS
-Player 7
CONDITIONS
-Always
ACTIONS
-Toggle 'Switch #'.
-Preserve Trigger.

PLAYERS
-Player 7
CONDITIONS
-'Switch #' is cleared.
ACTIONS
-Wait 0 Millieseconds.
-Preserve Trigger.

PLAYERS
-Player 8
CONDITIONS
-'Switch #' is set.
ACTIONS
-Wait 0 Millieseconds.
-Preserve Trigger.



-=Demonstration of Lwek's Hyper Triggers=-
The map I uploaded below demonstrates how the Hyper Trigger works. It is unprotected so you can see the triggers.
 

wc2wc2

Member!
Joined
Dec 20, 2004
Messages
24
Reaction score
0
Location
Ft. Carson, CO !FINALLY!!
I have made a single player map because I was really board and the map is really lame but a good time killer when you are board. OK so get to the point huh.
The map only has 2 computers and 1 Human player. Player 1, is human, and player 2 & 8 are CPU’s. I have hyper triggers places for players 1, 2, & 8 because I love the way they fire faster. Under “All Players†I only have 2 triggers (both of witch have Always under actions). First one is a Leader board with no waiting time in it and the second (under a different trigger) has a play wave file. It is a song that I converted to a .wav format so as you can tell, the map fairly large in MB. I have put in a “wait 351170 ms†with the “play .wav file†trigger so it can play the whole song (351.17 sec long). With out it, as you probably know, the trigger will fire to quickly and you will hear a million songs playing at the same time. The problem is that the wait time is random. Some times I have a 2 minute delay from the end of the trigger until the trigger fires again. So I lower the wait time and then sometimes it fires to quickly. After a few times of trial and error, I found out that even though the wait time has not changed, the trigger would still fire at different times. I think that there is some kind of trigger waiting conflicts between “All Players†& hyper triggers for players 1, 2, & 8.
Other then the hyper triggers and the play wav file, I have no other triggers with "wait" in the map.
Do you have any suggestion as to how to fix the problem? (ie get rid of the hyper triggers, whatever?)

"All Players"

Actions:
"Always"
Conditions:
"Show leader board"
"Preserve Trigger"

Actions:
"Always"
Conditions:
"Play boom.wav"
"Wait 351170 ms"
"Preserve Trigger"
 

Lwek

Member!
Joined
May 18, 2003
Messages
4,487
Reaction score
0
Website
www.Battleforums.com
On the first part of my thread, it says to put the hyper trigger under Player 8(computer player). That means you only have to worry about having any other triggers with a wait action under Player 8.
If you were to have the wait trigger under 'All Players', it's the same as having that trigger under Player 1 - 8. So if you have another trigger with a wait action under any player at all, that trigger will screw up with the hyper trigger.
Solution:
Have the wav trigger be under Player 2 and the hyper trigger under Player 8.
 

Bolt Head

Member!
Joined
May 20, 2003
Messages
1,194
Reaction score
0
Website
www.shadowfortress.net
Hyper triggers cause the triggers to fire about 12 times a second. Every 84milliseconds.

You should suggest filling the trigger up with wait 0s because it increase the time the hyper trigger is in effect by alot.

You have the basics down.
 

Lwek

Member!
Joined
May 18, 2003
Messages
4,487
Reaction score
0
Website
www.Battleforums.com
Bolt Head said:
Hyper triggers cause the triggers to fire about 12 times a second. Every 84milliseconds.

You should suggest filling the trigger up with wait 0s because it increase the time the hyper trigger is in effect by alot.

You have the basics down.
Creating units with hyper triggers create about 7 or 8 a second. Minerals, it's about 15 or 16. Did you average them two to get 12?(the last time I tested gave me those numbers)
I've done a lot of testing on these wait 0 actions. Like how another wait action in another trigger can interfere with the hyper trigger. The pause period you get after the hyper trigger is done firing before it continues again.
I'd have to thank you because it was probably you that got me into testing the hyper trigger.
I only stated the easiest way to do hyper triggers in the first post. I don't want to get too many people confused on it.
 

hydrakon

Member!
Joined
Jan 24, 2004
Messages
21
Reaction score
0
Website
clankon.cjb.net
From what I remember, putting all of your hyper triggers below all of your other triggers makes all wait triggers work normally. I think triggers that are at the top of the list of in each player's menu are given higher priority over those below. What I did with my hyper triggers is as follow:

All other triggers above--^

Hyper Trigger (x10)
Wait "0" milliseconds. (x20)
Preserve trigger.
Comment: Hyper Trigger

So this means there are 10 hyper triggers below all of your other triggers. Each hyper trigger has 20 'Wait "0" milliseconds.' actions. Again, it made all triggers with wait actions work NORMALLY if hyper triggers are BELOW all the other triggers. The waits repeat about 12 times like Bolt said if the hypers are above all the other triggers. This may be your problem with waits that could be fixable.
 

Bolt Head

Member!
Joined
May 20, 2003
Messages
1,194
Reaction score
0
Website
www.shadowfortress.net
I made a hyper trigger 3 triggers 62 waits owned by all players. I set up the map to run though all the waits then end in defeat. There was also a trigger to add minerals or some counter along those lines.

The map ran for almost 6 hours then ended. Then it is simply a matter of comparing the time with the amount of times the triggers fired. I don't feel like explaining it in depth But here is a link to a great Deeply Indeath Tutorial Written by Dabbu.
http://www.staredit.net/index.php?showtopic=2683

And here is the simplified instructions. (Basicly just how to do it)
http://www.staredit.net/index.php?act=tutorials&action=01&id=49&g=Triggers&title=Hyper Triggers
 

Lwek

Member!
Joined
May 18, 2003
Messages
4,487
Reaction score
0
Website
www.Battleforums.com
THe map I attached shows that about 7 Marines are created and 7 Minerals is added in 1 second with the Hyper Trigger firing. Explain please.
 

Bolt Head

Member!
Joined
May 20, 2003
Messages
1,194
Reaction score
0
Website
www.shadowfortress.net
Lwek said:
THe map I attached shows that about 7 Marines are created and 7 Minerals is added in 1 second with the Hyper Trigger firing. Explain please.
Well i can't play it but the differance is proboly the way we time it. Check and see if the game speed makes a differance, then check and see if the "elsaped timer" (the timer you see at the end) is any differant than your stop watch, if your using one.

A good way to test the elsapsed timer one would be to have your player 1 trigger when elsapsed time is at least 5 and at most 14, so it would have 10 seconds to fire then devide the amount you get by 10.

PS. I'm on a computer that can't run SC so can't do these test sorry.

Oh yeah is your test in single player mode? that also might make a differance.
 

Lwek

Member!
Joined
May 18, 2003
Messages
4,487
Reaction score
0
Website
www.Battleforums.com
Bolt Head said:
Well i can't play it but the differance is proboly the way we time it. Check and see if the game speed makes a differance, then check and see if the "elsaped timer" (the timer you see at the end) is any differant than your stop watch, if your using one.

A good way to test the elsapsed timer one would be to have your player 1 trigger when elsapsed time is at least 5 and at most 14, so it would have 10 seconds to fire then devide the amount you get by 10.

PS. I'm on a computer that can't run SC so can't do these test sorry.

Oh yeah is your test in single player mode? that also might make a differance.
I've already tried the game speed. No difference. I even tried it under slowest.
Battle.net play didn't affect it.
Having it run for 10 seconds gave me 80 Minerals/10 = 8/second.
Had the game end after 1 second and it said the game lasted for 11 seconds. I think it lasted for 11 seconds because I didn't click on the 'OK' right when it showed up.
Check the image of my trigger set up.
 

-Azrael666-

BattleForums Senior Member
Joined
Jan 19, 2005
Messages
2,986
Reaction score
3
wow.. im a self-taught mapmaker like a lot of people, and never knew about this.. i was actually having a dilemma which dealt with the delay at the end of the final trigger before it loops again, on my current main project.. i implemented this and managed to switch my triggers around to work for the comp i set-up the hyper trigs for.. works beautifully.. many thanks for this post
 

Lwek

Member!
Joined
May 18, 2003
Messages
4,487
Reaction score
0
Website
www.Battleforums.com
Hyper Triggers is one of those things where it does many good things to your map but you also have to do many good things backs in return(if you know what I mean):ufo
 

NewPosts

New threads

Top