I've looked and looked but nowhere can I get the information I want. I know the stuff like, that they can be either on or off. But wtf

what do they do, when do they do it, and why they do it! Please, someone tell me! *yeah, yeah, very noobish!
Switches dont really do anything on their own.. You have to add actions for them when the condition "switch 1 is set", or for when "switch 1 is cleared"..
By default, a switch is cleared..
One example would be in a defense, you could use them to make levels. Let's say you have a starter for the levels.
Player brings Starter to Start > Set Switch 1
Switch 1 is Set > Create Unites to be defended
Computer suffers let's say 100 deaths of units > Clear Switch 1
Then just do that all over again for the next level and so on. And remember, this is only one example of what siwtches can do. Do you ge tit?
While we're on the topic of switches, I also have a question (I hope HellCat doesn't mind). Lets say you have a switch constantly randomizing througout the whole game, how will this affect other switches (Hyper triggers are in the map)?
Will they never fire or will they take a super long time to fire or...?
QUOTE
Lets say you have a switch constantly randomizing througout the whole game, how will this affect other switches (Hyper triggers are in the map)?
Will they never fire or will they take a super long time to fire or...?
If you have a switch randomizing throughout the game, it wont affect the other switches, unless you have the randomized switch have actions that will affect most of the other switches... With hyper triggers it will fire almost instantly..
QUOTE(l)ark_13 @ Apr 22 2005, 11:33 AM)
While we're on the topic of switches, I also have a question (I hope HellCat doesn't mind). Lets say you have a switch constantly randomizing througout the whole game, how will this affect other switches (Hyper triggers are in the map)?
Will they never fire or will they take a super long time to fire or...?
[right][snapback]193127[/snapback][/right]
It would just have a differant random result every time it is checked. Theres no reason to randomize a switch all the time unless your doing something like a madness with a random unit spawn every second.
However the switch itself won't really lag the game any more. Even if you randomize all 256 switches you wouldn't notice any differance in performance. Its just bad practice to have triggers running when you don't need too and could easly avoid it.
Switches are independent, and do not affect other swithces, unless you link them with triggers.
So if switch 1 is set, then set switch 2.
In those cases, switches will affect each other.
But with a trigger, with no "Switch Condition" will have no impact other switches.
Also, Death counters are very similar to switches, and give a whole lot more variety. There are atleast 50 units, in starcraft, and over 200 deaths for each one so like 10000 switches.
QUOTE(sckor @ Apr 22 2005, 09:38 PM)
Switches are independent, and do not affect other swithces, unless you link them with triggers.
So if switch 1 is set, then set switch 2.
In those cases, switches will affect each other.
But with a trigger, with no "Switch Condition" will have no impact other switches.
Also, Death counters are very similar to switches, and give a whole lot more variety. There are atleast 50 units, in starcraft, and over 200 deaths for each one so like 10000 switches.
[right][snapback]193429[/snapback][/right]
I belive there are 227 units in starcraft and there are 8 players you can set deaths for. (only if there in the game). But just because a death counter can hold multiple values doesn't mean a single death counter can replace two switches.
You can use a switch to see if a condition is true. I don't know if anyone else answered this like I have, but for example...When you do a "Defense" map. You could control the levels by switches. Level 1 is Switch 1, Level 2 is Switch 2...etc. So what you can do is the following.
On level 1, you set Switch 1 to true.
To prevent level 1 from continuing, you see if Switch 1 is set, when you hit the "Go Button" again, you go to level 2 instead of level 1.
Then on level 2, you set Switch 2 to true, then check switch 2 for level 3...etc.
This is especially helpful, because I for one, have use gas and minerals on a defense map I have done in the past. So what I did was use Switchs to make sure level 1 doesnt go forever.
Do you understand? (Sorry, again, if someone else has shown this example)
QUOTE(PeaceMetroid @ Apr 23 2005, 03:59 PM)
You can use a switch to see if a condition is true. I don't know if anyone else answered this like I have, but for example...When you do a "Defense" map. You could control the levels by switches. Level 1 is Switch 1, Level 2 is Switch 2...etc. So what you can do is the following.
On level 1, you set Switch 1 to true.
To prevent level 1 from continuing, you see if Switch 1 is set, when you hit the "Go Button" again, you go to level 2 instead of level 1.
Then on level 2, you set Switch 2 to true, then check switch 2 for level 3...etc.
This is especially helpful, because I for one, have use gas and minerals on a defense map I have done in the past. So what I did was use Switchs to make sure level 1 doesnt go forever.
Do you understand? (Sorry, again, if someone else has shown this example)
[right][snapback]193815[/snapback][/right]
Heh, I showed that

Death counts, the bad thing is,
multiple switches can be set, and cleared.
Death counts, it's always one value, and since you can't rename them, so unless your using paper and pencil or happen to have a supernatural memory, use switches!
QUOTE(sckor @ Apr 24 2005, 02:42 AM)
Death counts, the bad thing is,
multiple switches can be set, and cleared.
Death counts, it's always one value, and since you can't rename them, so unless your using paper and pencil or happen to have a supernatural memory, use switches!
[right][snapback]194214[/snapback][/right]
Cough Cough, you can rename units.
that is true, but what if you wanted the units to have a purpose in game too?
you wouldn't name it "Boss Counter".
Then you probolly would pick a differant unit.
Theres always the invisable marker.
what if it's like a defense map and all of the units are being used? (it's not likely though).
Okay, and you can have multiple switches cleared and set.
Death counts, you can't make it;s value 1 and 2 at the same time. Although you could have a value of 3 which is when both value "1" and "2" are "set".
And if you use multiple units, you'll run out of units quite quickly.
QUOTE(knockdownshawn @ Apr 24 2005, 03:11 AM)
Heh, I showed that

[right][snapback]194184[/snapback][/right]
Oh sorry then =P
And
If you are using units, you can ALWAYS use the Flag. Ive seen that before =P But still, I think sckor's suggestion should work as well.
So it's all like some advanced way of preserving and... well... Disabling triggers?
Using preserve trigger:Player suffers 1 death of "blabla"
Create 1 unit at location "jibberish"
Preserve trigger
(a whole lot of units placed

)
Using switches:Player suffers 1 death of "blabla"
Set switch1
Switch1 is set
Create 1 unit at location "jibberish"
preserve trigger
Player brings 1 unit to location "jibberish"
clear switch1
Is this the right way to do it?
QUOTE(sckor @ Apr 24 2005, 07:33 AM)
what if it's like a defense map and all of the units are being used? (it's not likely though).
Okay, and you can have multiple switches cleared and set.
Death counts, you can't make it;s value 1 and 2 at the same time. Although you could have a value of 3 which is when both value "1" and "2" are "set".
And if you use multiple units, you'll run out of units quite quickly.
[right][snapback]194267[/snapback][/right]
Sounds like your guilty of over using Switches. I don't think i have ever seen a defence map that even comes close to using all the units. You always have things like the power ups, resources, critters, and buildings. In witch there are normally alot of extra choices.
I'm not saying switches are bad or anything, I use them alot myself.
QUOTE
Using preserve trigger:
Player suffers 1 death of "blabla"
Create 1 unit at location "jibberish"
Preserve trigger
(a whole lot of units placed )
Using switches:
Player suffers 1 death of "blabla"
Set switch1
Switch1 is set
Create 1 unit at location "jibberish"
preserve trigger
Player brings 1 unit to location "jibberish"
clear switch1
Is this the right way to do it?
Yes that's basically how it's done...
Although, you could have said:
Switch1 is set
Create 1 unit at location "jibberish"
Clear switch 1
preserve trigger
Instead of:
QUOTE
Switch1 is set
Create 1 unit at location "jibberish"
preserve trigger
Player brings 1 unit to location "jibberish"
clear switch1
I never used 256 switches.
Defense maps- you would probably use them all.
And I stick to the reason, that you can't have multiple DEATH COUNTERS "cleared" or "set".
Unless, you assign another value of the death counter as when other TWO are set.
So that means, you get a lot less.
And plus, it is much easier to randomize with switches than death counters.
(you don't really randomize death counters... see the tutorial)
Any defence map that uses 256 switches probably could be made with less switches without changing the gameplay whatsoever.
Death counters are like switches with tens of thousands of different available states.
If you wanted them to imitate switches, you would only use two values, say 0 and 1.
- Use the condition "DEATHS: #player has suffered exactly #quantity deaths of #unit" to check the state of the deathcounter-switch.
- Use the action "SET DEATHS: modify death counts for #player: set to #number for #unit" to set the state of the switch.
The deaths of different units are independent of one another, so many of these conditions or actions can be combined in the one trigger.
The best time to use death counters as a replacement for switches is when you want a multiple-state switch, e.g. if you wanted to keep track of a five-stage trigger system, you might use a death counter to keep track of which stage it was at.
If there are only two distinct possibilities for something, then it's smarter to use a switch.
I said I never used 256 switches! Not even CLOSE TO 100!
jeesh.
They're much convenient to use. and the fact that they have ONE variable only (well two, including the "switch" and the "state action"
I use switches as connectors, it is useful to be connected to many triggers.
thts not all switchs can be used for, example i used switchs for my Star Ocean rpg
EX: (Note this is on 2 different triggers)
Condictions(Trigger 1)
player 1 custom score is "at least" "339"
Actions
Display for curret player : Fayt Level up,etc
Set hit points for 1 Fayt LeinGod owned by player 1 at "anyway" to "8%"
Modify resources for player 1: Add 2 Minerials
Condictions(Trigger 2)
player 1 custom score is at least 339
player 1 custom score is at most 345
"Switch 1" is set
Actions
Clear "Switch 1"
set hit points for 1 Fayt LeinGod owned by player 1 at "anywhere" to "8%"
Perserve Trigger
I only half understand that and i made the trigger, but thats how it works for my uses.