PDA

View Full Version : All I need is one good answer...


Beef
12-07-2004, 6:41 PM
These friggin' switches are bugging me. I don't know what the point of them is. Some one give me one GOOD example.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

And another question (which may solve my problem). If you were to make a trigger with 2 condition like:
If All Buildings are destroyed for PLayer 1
Elapsed scenario time is 20 minutes
,do both of the triggers have to happen before the Action part of the trigger happens or does only one of them need to happen?

Markpyro
12-07-2004, 6:50 PM
Is it my computer, or is this a double thread.... Mod delete please?

gungnir
12-07-2004, 7:23 PM
Correction: Triple post. See "Two Questions" thread.

EdvardMunch
12-07-2004, 8:30 PM
Switches:

Switches are a way of recording that a certain event has happened.

For example, let's say you're making an installation map. You put up a door and you want it so the player must step on beacon A, then walk over and step on beacon B in order for the door to open. There is no condition that reads like this: Player 1 brought 1 any unit to "Beacon A"

Because conditions operate in the present tense only.

Instead, what you do is set a switch once the player steps on beacon A.

Now, the trigger for what opens the door is covered in this trigger:

CONDITIONS
- "Player Steps On Beacon A" is set
- Player 1 brings at least 1 any unit to Beacon B
ACTIONS
- Disable doodad state for upper left door

Download the enclosed map to see this in action.

As for your second question: Yep, both conditions must be set. If all of the buildings are gone, you will have to wait until the total game time is 20 minutes before the trigger will work. All conditions in a trigger must be true for the trigger to fire.

Nahotnoj
12-07-2004, 8:34 PM
Well you really didn't need to create a triple thread.

But anyway, I'll answer the second question first, since its the easiest. Answer: yes. all enabled conditions of a trigger have to be fulfilled before the action can occur.

for switches:

Ok, the general explenation that everyone seems to give is that they are set values. They don't actually do anything themselves, you must make triggers causing certain actions to occur when a switch is either set or cleared. And some extra information: all switches are cleared by dfault.

So let's say you have these two area in a map. In one area a messenger gives you a message to take to someone in the other area. You only have one unit, and you want to make sure that they [the player(s)] can't just go to the second area before he has been given the message and get whatever rewards for delivering the message. You wouldn't be able to have "player 1 brings 1 <unit> to <location of area 1 where player recieves message>", and have a second condition with "player 1 brings 1 <unit> to <location where message is to be delivered>" because that would mean they'd have to bring a unit to the message recieving area at the same time as the message giving area, which they of course can't do. So you use a switch to record that the player has recieved the message. so it would go something like this:

Condition(s):
Player 1 brings 1 AnyUnit to Recieve Message
Action(s):
Set Switch MessageRecieved

Condition(s):
Switch MessageRecieved is set
Player 1 brings 1 AnyUnit to Give Message
Action(s):
(Note: this is just a chessy example, actions are whatever you want to happen whben the switch is set and w/e)
Display Text Message: *listens to message* Thank you for bringing me this message! he is your reward!
Set Minerals for current player: add 500 ore

Does that help?

Beef
12-08-2004, 7:34 PM
ya sorry about making a triple thread. i put this one in the wrong section and transfered the text over to another post. From there it got really messed up. sry

StealthyDeath
12-08-2004, 7:58 PM
If you still haven't gotten how switches work. Think of them as an on/off switch. Set is on and Cleared is off.

Example:

Condition:
Player brings 1 unit to location on.
Action:
Set Switch 1

Condition:
Switch 1 is Set.
Action:
Create 1 unit at location.

Basically, if a player brings 1 unit to location on it turns on the second trigger. Now that the switch 1 is "on", it will create the unit. All switches start as "cleared"(off) too.

th6bn
12-12-2004, 6:39 PM
What they said.

BloodBall
12-12-2004, 9:13 PM
Well there have already been numerous better answers than mine, but in the map I made an example would be...
(Trigger 1)
Condition - Always
Actions - <intro actions>
"Set" Switch "Civs done talking"
(Trigger 2)
Condition - Switch "Civs done talking" is "Set"
Action - <spawn hero choosers>

Invalid-Player
12-13-2004, 11:34 PM
Say you're making a fresh new ums game. There are 256 switches available, but are not utilized until you involve them in your trigger commands. All switches are cleared (open) at the beginning.
Now say you have a 2 player TvB map and you want to inform player 2
if player 1 is coming down the map or going back up. You can use switches
and locations to do this. Location X is centered across the map and location Y is right below it. Now if he's coming down the map he's going to cross X then Y, if he's going up, he crosses Y then X. Two switches are needed to tell which location was crossed first. Trigger ex: If plyr1 crosses location X and switch2 is cleared (which it will be) set switch1 (switches 1 and 2 never existed before,you just plucked them out of thin air and used them in your trigger command). Now if plyr1 crosses Y and switch1 is set
(which it is because you just set it) and switch2 is cleared (which it is) then print "There're Coming" and clear switch1. The same for the other direction: if plyr1 crosses location Y and switch1 is cleared, set switch2. If he crosses X and switch2 is set and switch1 is cleared, print "The chickens are hauling ass back up" and clear switch2 to set it up again. Now if this
hasn't totaly confused the shit out of you then this map sure will. So many
switches for such a simple silly game.

Basan
12-17-2004, 5:13 AM
To my view you'll only need 4 triggers to set the action you just spoke of. Or 6 at max.
2 triggers to set the switches and the other 2 to do the action you intend to. And maybe another two to clear if the switches have been set. But I think you could pull it off with with only 4 triggers. ;)

I'm gonna dl the map to take a peek at it. Is it protected? If it is I won't play test it any time soon... (I'm currently at an workin' office of our sites.) :concern:

Invalid-Player
12-26-2004, 6:06 PM
Sorry for the late reply, there's alot more to those triggers than
meets the eye. The map is not protected, but forget that one.
Here's a good example. I had to disable the reverse feature
because it kept screwing up when it had units on both of the
locations at the same time. Instead of refining it more, I just
omitted it.

Basan
12-27-2004, 9:31 AM
Still my advice is for you to try it. I guess you'll have it workin' shortly. That way is the only way to really learn the switches potencial(s). :)

I'll check this last one, but can't promise nothing.