Switches

Gerone

New Member
Joined
Dec 25, 2007
Messages
4
Reaction score
0
Ello :)

I guess you can say im an ok map maker but i cant figure out how to use switches, i only know how to rename them xD Which is nothing. So could you tell me how to use em :)

Thanks...

P.S. AWESOME EMOTES!
 

Johnny

IMMERSION RUINED
Joined
Mar 24, 2005
Messages
2,375
Reaction score
1
Location
Garden Grove, CA
They act like switches, pretty much. When something happens (Player 1 brings 1 unit to Location 1), turn switch 1 ON. When switch 1 is ON, create 1 zergling at location 2 for Player 1. I haven't made maps in several years, but I think there was some kind of trigger for when there was no unit of player 1's on location 1, then you would make the switch go to off.

Its hard to describe, but its as if it makes the trigger repeat, otherwise, when player 1 goes to location 1, it would only create 1 zergling. With switches, it would create it every however long your wait is set for.

Sorry if its not as advanced as you would need, you can google more advanced switch guides, I just haven't made a map in at least 2 years.
 

Gerone

New Member
Joined
Dec 25, 2007
Messages
4
Reaction score
0
yeah i need abit more detail and that example can i think be used

Condition: Player 1 brings 1 rine to Location 1
Trigger: Create 1 Zergling At location 2
Preserve trigger

that would be like that.

And things like the thing, sex on the beach (sorry if thats vulgar) and especially those games where you mass the location where the observer is. I need things like that but thanks anyway
 

Johnny

IMMERSION RUINED
Joined
Mar 24, 2005
Messages
2,375
Reaction score
1
Location
Garden Grove, CA
I think it would be more like this when using switches. The conditions/triggers you had would make it only create 1 zergling every time player 1 brought a marine to location 1. I think.

Code:
Players: 1
Condition: Player 1 brings exactly 1 marine to location 1
Trigger: Turn Switch 1 ON
Preserve trigger

Condition: Switch 1 is ON
Trigger: Create 1 zergling for player 1 at location 2
Wait 500 milliseconds
Preserve Trigger

Condition: Player 1 brings exactly 0 marine to location 1
Trigger: Turn Switch 1 OFF
You can also use them in Hyper Triggers, which will make your game, waits and triggers lag to hell and become useless.

Code:
Player: 1
Conditions: Always 
Actions: Preserve trigger
Wait 0 milliseconds 
Set Switch 1 
Wait 0 milliseconds

Player: 2
Conditions: Switch 1 is set 
Actions: Preserve trigger
Wait 0 milliseconds
Clear Switch 1

Sorry I can't be any more help, let me know if you have any diablo 2 help you need sorted out. :(
 

Gerone

New Member
Joined
Dec 25, 2007
Messages
4
Reaction score
0
Yeah i think i see the basics of it. Thanks just need to know how to use that "mass where the observer is" thing then ill be done :)

And i dont have Diablo 2 :OOO
 

-Azrael666-

BattleForums Senior Member
Joined
Jan 19, 2005
Messages
2,986
Reaction score
3
I'll just point out that switches aren't always reliable, especially when you need them to change rapidly. It may take a thousand plays through a map with a hundred switches all being toggled non-stop with hyper triggers running at the same time for you to experience it once, but when a switch fails to set or clear, you'll know it.

A much more reliable substitute for switches is death counts, and they are much easier to work with, since they can be assigned player-specifically with a single trigger. I use both, myself, but use death counts about a thousand times more often than switches.

Basically, instead of using the action "Set Switch 1," you would use the action "Modify death counts for Player 8: Set to 1 for Jim Raynor (Vulture)." Instead of clearing Switch 1, you'd set Player 8's death count for Jim Raynor back to 0. Instead of using the condition "Switch 1 is Set," you would use the condition "Player 8 has suffered exactly 1 death of Jim Raynor (Vulture)."

Not only can this be done on a player-by-player basis, but it also allows you to use the same "switch" in more than two modes (instead of "Set" and "Clear," you have 0, 1, 2, 3, 4, etc).

Just something to keep in mind. As for your original question, a switch is nothing more than a tool to be used in trigger conditions. One trigger turns a switch on, another trigger performs actions repeatedly while the switch is on. Another trigger turns that switch off, and the repeating trigger turns off.

Not too bad when you get used to using them.
 

SagaWrath

Smot Poker
Joined
Mar 15, 2008
Messages
16
Reaction score
0
Here is a little trick I've figuered out on my own years ago but I'm sure people use it all the time with switches. You know how there is a Random setting for switches. This works great...

With Fastest triggers works best....

Condition
Always
Action
Switch 1 Random
Switch 2 Random
Switch 3 Random
Preserve Trigger

Whatever trigger you want to randomly happen whenever, would be...

Condition
Switch 1 Set
Switch 2 Set
Switch 3 Clear
Action
(Whatever you want)

With fastest triggers it will switch through every possibility very fast until it happens. Each Switch you add to that randomization will add something like 400% harder chance for it to happen.

I'm too old to hide my ideas now.. lol.. I hope you put these ideas into some good use
 

New threads

Top