Staredit Network

Staredit Network -> UMS Assistance -> Switches
Report, edit, etc...Posted by HellCat on 2005-04-22 at 08:19:49
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 ranting.gif what do they do, when do they do it, and why they do it! Please, someone tell me! *yeah, yeah, very noobish!
Report, edit, etc...Posted by FTR_ROCKO on 2005-04-22 at 11:02:33
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..
Report, edit, etc...Posted by knockdownshawn on 2005-04-22 at 12:01:16
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?
Report, edit, etc...Posted by l)ark_13 on 2005-04-22 at 12:33:56
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...?
Report, edit, etc...Posted by FTR_ROCKO on 2005-04-22 at 13:10:30
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..
Report, edit, etc...Posted by (U)Bolt_Head on 2005-04-22 at 15:48:28
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.
Report, edit, etc...Posted by sckor on 2005-04-22 at 22:38:17
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.
Report, edit, etc...Posted by KaboomHahahein on 2005-04-22 at 22:54:11
No one posted a link to the switch tutorial?

http://www.staredit.net/index.php?tutorial=116
Report, edit, etc...Posted by (U)Bolt_Head on 2005-04-22 at 23:59:36
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.
Report, edit, etc...Posted by PeaceMetroid on 2005-04-23 at 17:59:15
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)
Report, edit, etc...Posted by knockdownshawn on 2005-04-24 at 03:11:13
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 happy.gif smile.gif
Report, edit, etc...Posted by sckor on 2005-04-24 at 03:42:32
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!
Report, edit, etc...Posted by (U)Bolt_Head on 2005-04-24 at 05:24:34
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.
Report, edit, etc...Posted by sckor on 2005-04-24 at 07:00:29
that is true, but what if you wanted the units to have a purpose in game too?
you wouldn't name it "Boss Counter".
Report, edit, etc...Posted by (U)Bolt_Head on 2005-04-24 at 07:34:11
Then you probolly would pick a differant unit.

Theres always the invisable marker.
Report, edit, etc...Posted by sckor on 2005-04-24 at 08:33:11
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.
Report, edit, etc...Posted by PeaceMetroid on 2005-04-24 at 10:08:48
QUOTE(knockdownshawn @ Apr 24 2005, 03:11 AM)
Heh, I showed that happy.gif smile.gif
[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.
Report, edit, etc...Posted by HellCat on 2005-04-26 at 03:24:56
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 pinch.gif )

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?

Report, edit, etc...Posted by (U)Bolt_Head on 2005-04-26 at 04:01:44
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.
Report, edit, etc...Posted by FTR_ROCKO on 2005-04-26 at 07:45:10
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
Report, edit, etc...Posted by sckor on 2005-04-26 at 08:16:11
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)
Report, edit, etc...Posted by in_a_biskit on 2005-04-27 at 04:45:07
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.
Report, edit, etc...Posted by sckor on 2005-04-27 at 05:44:43
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"
Report, edit, etc...Posted by dust_core on 2005-04-27 at 09:27:43
I use switches as connectors, it is useful to be connected to many triggers.
Report, edit, etc...Posted by Cloud on 2005-04-27 at 21:04:20
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.
Next Page (1)