Staredit Network

Staredit Network -> UMS Assistance -> Switches
Report, edit, etc...Posted by Staredit.Net Essence on 2004-05-31 at 11:47:32
HELP!
i cannot for the life of me figure out those dumb switches
do u even need em and if so....

HOW DO YOU USE THEM!!!
helpsmilie.gif
Report, edit, etc...Posted by Felagund on 2004-05-31 at 12:53:00
How are we supposed to "know" if you need 'em? Please be more specific in your description! You can also check out Death Counters and the such, which work just as well. They work well, for example, if you need to have a guy get a key then walk across the map to open the door!

Condition: Player 1 bring D00d to location "Key"
Action: Set SWITCH "Key found"

Condition: Player 1 brings D00d to location "Door"
-SWITCH "Key found" is set
Action: Disable door at location "Door" (disabling opens, enabling closes)

See? For a trigger to occur every condition must be met! Therefore, if he doesn't find the key, then he cannot open the door. Do you get it?

I'd try to figure out switches before death counters. Anyways, here you go, this is much more accurate than a lot of stuff.

QUOTE
Say you want a pause 20 seconds long. It is of course not a good idea to use a wait as we have established. So what we do for our element of time is we rely on the refresh rate in witch triggers fire. Triggers fire about once every 1.5 seconds. (about 11 times per second with hyper triggers). What we do is create a loop that subtracts or adds to a number until it gets to the point we need it at. I'll using adding for my example.

Players:
-Force 1
Condtions:
-Current player accumulates at least 1 minerals
Actions:
-Add one mineral for current player
-Preserve trigger.

This of course will keep adding minerals. So now back to our 20 seconds and how to incorperate it.

Say you have this trigger

Condtions: switch "storyline" is set
Actions: Display "hello" / wait 20,000milli / Display "Huh?"

To avoid this wait we can use these triggers

Conditions:
-Switch 'storyline' is set
Actions:
-Display "Hello"
-Set resources to 1 mineral for current player.

Conditions:
-Current player accumulates at exactly 15 minerals
Actions:
-Display "Huh?"

And of course you use the trigger above that adds minerals. You might have to play with the values to get them exactly how you want. It is more accurate if you use hyper triggers with larger values.

Now most likely your using minerals and gas for your map so we can't just use that. That is where death counters (or custom score) comes in handy. There are over 200 units in Starcraft (i always forget the exact number) and you can set deaths for each of them. First thing you need to do when selecting a death coutner is to find a unit that is not used in your map or it is impossable for it to die. This is because if the unit dies while the counter is being used it could cause problems (not so much for your trigger). I personaly use critters, powerups, and minerals alot. To use them just replace my example of minerals with the Set Deaths action and the Deaths condition.

Some other uses for counters.
-Setting deaths is sometimes used a kind of supper switch. Rather than createing a switch for each player. Deaths are individual to each player, unlike switches.
-Another example is to store a numbered value of information. Such as the obstical number in a bound. or the Upgrade level of a hero in a RPG. Useing one counter for things like this rules out dozens of switches that might of been used.

Some Helpfull hints:
-Counters are really helpfull because they work indpendantly for each player.
-I personaly like to use 0 as a null state for a trigger like this. Since i use the conditions "at least 1 mineral" for the counter trigger then it doesn't count until i set it to 1 or higher. Then when your done you can set the value back to 0 untill you need to use the counter again.
-Make sure you don't use the same counter at the same time.
-Counters for your purpose are better when used with hyper triggers.

Lastly, Death Score / Counters are something you get more and more accustomed to the more you use them (like switches). If you have any more questions about them feel free to ask.
--(U)Bolt_Head

EDIT: 31 May, 2004 @ 4:04 PM EST

Don't forget that switches start off as cleared!
Report, edit, etc...Posted by (U)Bolt_Head on 2004-05-31 at 13:30:55
This might help. http://www.staredit.net/index.php?showtutorial=103
It is a quick flash tutorial Yoshi Da Sniper Made about Switches.

I would ignore the random part though.
Report, edit, etc...Posted by Mini Moose 2707 on 2004-05-31 at 15:52:50
Condition: SWITCH
This allows you to test against a switch value. Switches are on/off values that can be set with an action. Switches can be used to keep track of which triggers have been activated, to disable or enable certain triggers or to link multiple triggers together. You may also rename switches from this dialog box.

Action: SET SWITCH
The set switch action can be used to:
· Set a switch to its set position.
· Clear a switch to its cleared position.
· Toggle a switch: if a switch is cleared, it becomes set; if it is set, it becomes cleared.
· Randomly choose between the set or cleared position.

Copyright © 1997 Blizzard Entertainment. All Rights Reserved.

--

That's all there is to it. Just use your brain to think of ways to use the switches. -_-
Report, edit, etc...Posted by Staredit.Net Essence on 2004-06-01 at 01:06:19
Simply put....Switches are an off or an on...So for Example if a player brings a unit to "location", and then "Switch 1" is "Set'', Set is mainly meaning "On or "turn it on" and Cleared as in Clear "Switch 1" meaning to turn it off"..The other options such as "Toggle" Switch 1 meaning to put it in another state...example if it were on and U "Toggle" the Switch it goes off..etc..And "Randomizing" mainly meaning....I dunno this one..never used it...but who cares pinch.gif
Report, edit, etc...Posted by (U)Bolt_Head on 2004-06-01 at 02:07:11
QUOTE(Scorpion @ Jun 1 2004, 12:06 AM)
And "Randomizing" mainly meaning....I dunno this one..never used it...but who cares  pinch.gif

lol thats one of the funniest things i have ever read.
Report, edit, etc...Posted by Staredit.Net Essence on 2004-06-01 at 12:13:33
Lol...Well its true..I dunno what that really does OR means pinch.gif I guess the poster of this already knows what switches are for or is as confused as Hell.
Report, edit, etc...Posted by @:@ on 2004-06-01 at 13:19:42
How could you not know what randomization is ? its.. um.. RANDOM!
Report, edit, etc...Posted by Mini Moose 2707 on 2004-06-01 at 15:51:01
random:

Adjective
1. Having no specific pattern, purpose, or objective: random movements. See Synonyms at chance. 2. Mathematics & Statistics Of or relating to a type of circumstance or event that is described by a probability distribution. 3. Of or relating to an event in which all outcomes are equally likely, as in the testing of a blood sample for the presence of a substance.
Report, edit, etc...Posted by flipmonkey on 2004-06-02 at 12:53:10
I really dont get switches either. I mainly stay away from them because them become no use to my maps. all i really use is like the condition bring or comand. Ill learn so day how to use a switch and its purpose
Report, edit, etc...Posted by (U)Bolt_Head on 2004-06-02 at 14:41:02
Here tell me if this helps I wrote this a while back.

QUOTE
Brief Switch Exclamation
Well the concept of switches is fairly simple.

First off switches have two states, clear and set (they always start the game as cleared)

Switches are used in both the Actions and Conditions of triggers.
1) Switches can be set, cleared, toggled, or randomized in the actions
2) Switches also can be used in the conditions to relate if the switch is clear or set

The hard part is to understand the uses. Basically switches store information. If your trigger is . . .
Conditions:
-Force 1 brings at least one men to "key"
Actions:
-Set Switch "key"
. . . then this switch will store the information that a unit owned by force one has been to the location "key"

Then you can use a second trigger to relate this information to something else like the following
Conditions:
-Force 1 brings at least one men to "door"
-Switch "key" is set
Actions:
-Disable doodad state for 'right upper level door' for all players at location "door"

Basically these two triggers are for a door that is lock and key. There are many other ways switches can be used. However they always are used to state that some condition is or was true (or some form of information). You will find more purposes over time with practice.
Report, edit, etc...Posted by flipmonkey on 2004-06-03 at 12:20:16
little confusing.
I dont understand when to use them. how would u now when u will need 1. on one of my maps i thought i would need 1 so i tried it but didnt work, so i just didnt work on it
Report, edit, etc...Posted by Mini Moose 2707 on 2004-06-03 at 15:46:32
If you don't know when to use them, the solution is simple: don't use them. It's like having a gun, but not knowing when to use it, and just shooting people at random.
Report, edit, etc...Posted by (U)Bolt_Head on 2004-06-03 at 18:30:03
I thought of this after I reread what i wrote.

Switches represent a condition that was true in the past. I like to use the lock and key example, because its most apparent in this situation.

If you walk up to a door you would use the conditions "bring at least 1 men to door" as the conditions to open it. But if you want the door to be locked then a simple bring won't work. You need a switch.

When you pick up a key by ether moving to a specific place on the map, or after viewing a certain cut scene, a switch is set. This switch represents that this other trigger has been activated and you now have the key. Since the key is an imaginary object there isn’t anything physical thing in the game that can represent it for your conditions.

So when you walk up to the door you use a switch to check for this imaginary object. If the switch is set then you have picked up the key and if it isn’t then it means you havn’t and the door should remain locked.
<hr>
Now the example above only represents a switch that is used once. You can also clear the switch as well. Say you have dialog that dictates you drop your key.

I know as of version 1.11b you can’t stack buildings but I’ll show you an example of a lights on/off trigger. (with only one beacon to toggle it)

At the start of the game you want your lights to be on, Also switches start the game cleared so I’ll use a clear switch named “light” to represent the lights are on.
[i](if this seems reverse to you then change it but you will need a extra trigger that sets the switch at the start of the game.)[i/]

So I would use two triggers

Conditions:
-Current player brings at least one men to ‘light’
-Switch ‘light’ is clear
Actions:
-Run AI turn Off vision for Player X
-Set Switch ‘light’
-Move all civ at location ‘light’ to location ‘respawn’
-Preserve Trigger

Conditions:
-Current player brings at least one men to ‘light’
-Switch ‘light’ is set
Actions:
-Run AI turn On vision for Player X
-Clear Switch ‘light’
-Move all civ at location ‘light’ to location ‘respawn’
-Preserve Trigger

This switches function is to make two triggers with the same condition toggle every time there fired. So if Trigger A fired last time B will fire the next, and vise versa. This is exactly what we want to do with the lights since it only has two states and we can’t have a trigger that checks if you have vision to yourself.

Also note that the Past Tense description still applies. Every time you go to the beacon in the example. The trigger that fires depends on what you did in the past. (the last time you went there)

You will become aware of more and more uses for switches the more often you use them.
Report, edit, etc...Posted by Staredit.Net Essence on 2004-06-03 at 18:40:09
When i first learned to use switches was when i made my first bound....mainly Switches turn on and off the obstacles in a map...whitout them the bound would be exploding all over the place pinch.gif
Report, edit, etc...Posted by (U)Bolt_Head on 2004-06-03 at 18:42:13
I would disagree with that. If you know how to work death counters properly then switches have little if no role in a bound.

But for simplicity yes switches are excellent ways to turn off and on a preserved trigger.
Report, edit, etc...Posted by Staredit.Net Essence on 2004-06-03 at 18:44:41
Ahh....I don't really know how to do that Death Counter Thingy-thing...It looks tooo Confusing....I leave alone...doesn't bother nobody biggrin.gif
Report, edit, etc...Posted by Mini Moose 2707 on 2004-06-03 at 18:47:02
If you can use triggers for minerals and gas it's the same thing, but instead for deaths.
Report, edit, etc...Posted by (U)Bolt_Head on 2004-06-03 at 18:52:51
Yeah moose is right.

Its like instead of using a switch for the conditions of each level it would be something like

Player accumulates exactly X minerals

And when a level is compleated rather than clearing one switch and setting another you just do "add one mineral for Player"

This is a common practice in defense maps as well.

Death counts simply replace the minerals with death score.

Edit this is kinda weird. Were trying to show one guy how to use switches while at the same time show another how not to use them.
Report, edit, etc...Posted by flipmonkey on 2004-06-04 at 12:13:25
i tried to use the switches when i first made a bound. Didnt do so well so i quit. Now im makeing defences maps.
Report, edit, etc...Posted by .Coko[CK] on 2004-06-04 at 15:20:52
Advantage of Switches over Death Count, simple, show me random Death Count symbol? Yes, i know you could make one, but with what? Switches thats what, so thats the greatest point of them! Plus simple to use!
Report, edit, etc...Posted by Mini Moose 2707 on 2004-06-04 at 16:23:44
Randomization IS the one advantage of Switches over death counts.
Report, edit, etc...Posted by Clokr_ on 2004-06-04 at 17:01:46
Both are important. You can use switches for randomize a death counter, and then work with the death counter. I explained how in that old switches topic.
Report, edit, etc...Posted by (U)Bolt_Head on 2004-06-05 at 02:42:17
QUOTE(Mini Moose 2707 @ Jun 4 2004, 03:23 PM)
Randomization IS the one advantage of Switches over death counts.

Switches are easyer to create triggers for than death counters. Mainly because i think it is easyer to select a switch from the list than select the unit. If there isn't a reason for a death counter. (player control, or 2+ values.) Then go ahead and use a switch there isn't any shame in it.

QUOTE
Advantage of Switches over Death Count, simple, show me random Death Count symbol? Yes, i know you could make one, but with what? Switches thats what, so thats the greatest point of them! Plus simple to use!


I saw a guy who used junkyard dog as his source of randomization. I have also seen a unit like a ghost haveing like 8 units created around it at the same time. And using the one he choices to attack as the randomization. (theres alot of dumb stuff). I use switches because there true random. I don't want some to rely on some Dumb AI for my Randomization.
Next Page (1)