Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Help with Switches
Help with Switches
Dec 23 2008, 4:47 am
By: mitchellsalad  

Dec 23 2008, 4:47 am mitchellsalad Post #1



Noob mapmaker here, as if that needed to be said. I'm currently trying to figure out switches, but they're giving me a hard time.

Basically, when a player creates a building at the center expo, I want to display "Center expo taken!" to his foes. Simple, right?

So I have:

PLAYERS
All Players
CONDITIONS
'Switch 01' is cleared.
Foes brings at least 1 [buildings] to 'center'.
ACTIONS
Set 'Switch 01'.
Display for current player: Center expo taken!
Preserve trigger.

PLAYERS
All Players
CONDITIONS
'Switch 01' is set.
Foes brings at most 0 [buildings] to 'center'.
ACTIONS
Clear 'Switch 01'.
Preserve Trigger.


The problem is, once a building is built, "Center expo taken!" displays over and over again.

Some help? Thanks!



None.

Dec 23 2008, 4:55 am Kaias Post #2



Is that right? Because those triggers look fine.



None.

Dec 23 2008, 6:19 am Elvang Post #3



The problem is that your using All Players and Foes. Consider this...
  • Trigger 1 is checked for Player 1: His foe Player 2 brings a building to 'center' thus the text is displayed and the switch is set.
  • Trigger 2 is checked for Player 1: Switch remains set.
  • Trigger 1 is checked for Player 2: His foe Player 1 doesn't bring a building to 'center' and the switch is set so nothing happens
  • Trigger 2 is checked for Player 2: The switch is set and his foe Player 1 brings 0 buildings to 'center' thus the switch is now cleared.
And it continues on forever until every players' foe has a building at location 'center'.




Dec 23 2008, 6:21 am Kaias Post #4



Quote from Elvang
The problem is that your using All Players and Foes. Consider this...
  • Trigger 1 is checked for Player 1: His foe Player 2 brings a building to 'center' thus the text is displayed and the switch is set.
  • Trigger 2 is checked for Player 1: Switch remains set.
  • Trigger 1 is checked for Player 2: His foe Player 1 doesn't bring a building to 'center' and the switch is set so nothing happens
  • Trigger 2 is checked for Player 2: The switch is set and his foe Player 1 brings 0 buildings to 'center' thus the switch is now cleared.
And it continues on forever until every players' foe has a building at location 'center'.
Oh right, of course. I didn't bother looking at the owner of the trigger.



None.

Dec 23 2008, 7:28 am mitchellsalad Post #5



Arg, I see what you're saying. So who should own the trigger? All slots are human

Edit: here's my solution. Probably sucks.

PLAYERS
Force 1
CONDITIONS
Switch 1 is cleared
Foes bring at least 1 building to center
ACTIONS
Set Switch 1
Display "Center expo captured!"
Preserve Trigger

PLAYERS
Force 1
CONDITIONS
Switch 1 is set
Foes bring at most 0 buildings to center
ACTIONS
Clear Switch 1
Preserve trigger.

PLAYERS
Force 2
CONDITIONS
Switch 2 is cleared
Foes bring at least 1 building to center
ACTIONS
Set Switch 2
Display "Center expo captured!"
Preserve Trigger

PLAYERS
Force 2
CONDITIONS
Switch 2 is set
Foes bring at most 0 buildings to center
ACTIONS
Clear Switch 2
Preserve trigger.

Post has been edited 1 time(s), last time on Dec 23 2008, 7:34 am by mitchellsalad.



None.

Dec 23 2008, 9:07 am Elvang Post #6



Your solution works. The people who need to own the trigger are those who you want to see the text. Actions fire for each player that meets the Players and Conditions sections. So if you had a trigger like so:
PLAYERS
All Players
CONDITIONS
Always
ACTIONS
Add 1 mineral for Player 1

Then Player 1 would get 8 minerals in a game with 8 players even without a Preserve Trigger.



None.

Dec 23 2008, 9:32 am scwizard Post #7



Just make the switches subjective by having them be death counters.

ExpoTaken is a renamed tank turret (or some other unused unit).

PLAYERS
All Players
CONDITIONS
CurrentPlayer has suffered Exactly 0 deaths of ExpoTaken
Foes brings at least 1 [buildings] to 'center'.
ACTIONS
Modify death count for CurrentPlayer SetTo 1 of ExpoTaken
Display for current player: Center expo taken!
Preserve trigger.

PLAYERS
All Players
CONDITIONS
CurrentPlayer has suffered Exactly 1 deaths of ExpoTaken
Foes brings at most 0 [buildings] to 'center'.
ACTIONS
Modify death count for CurrentPlayer SetTo 0 of ExpoTaken
Preserve Trigger.



None.

Dec 23 2008, 11:03 am Falkoner Post #8



When you're working with all human players, I'd always use Death Counts, since it helps to have it be individualized, since each player basically has their own switch, it ends up working out better. The problem with switches in a scenario like this is that you need the text to display for each player, and you have the clearing of the switch in with the display of the text, so only the first player's triggers will run, then the conditions of any later triggers for the other players will not.

Working with all human players is really annoying.. I've been doing a map lately that involves it, and it's making me so mad having to do all these workarounds just to make basic things work properly...



None.

Dec 23 2008, 12:56 pm NudeRaider Post #9

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Quote from Falkoner
When you're working with all human players, I'd always use Death Counts, since it helps to have it be individualized, since each player basically has their own switch, it ends up working out better. The problem with switches in a scenario like this is that you need the text to display for each player, and you have the clearing of the switch in with the display of the text, so only the first player's triggers will run, then the conditions of any later triggers for the other players will not.
This. Read it, understand it, do it. If you can't understand, after reading the respective wikis post again and tell us where you're stuck.

If you really insist on using a switch you would need a computer player that checks the condition and sets and clears the switch.
Triggers for comp:
Clear the switch if it is set.
Set it, if All Players brings at least 1 building to expo.
Triggers for Humans:
Display text if switch is set.

Not using a Computer Player that controls the switch AND insisting on switch(es) is just crazy.




Dec 23 2008, 8:35 pm mitchellsalad Post #10



Quote from scwizard
Just make the switches subjective by having them be death counters.

ExpoTaken is a renamed tank turret (or some other unused unit).

PLAYERS
All Players
CONDITIONS
CurrentPlayer has suffered Exactly 0 deaths of ExpoTaken
Foes brings at least 1 [buildings] to 'center'.
ACTIONS
Modify death count for CurrentPlayer SetTo 1 of ExpoTaken
Display for current player: Center expo taken!
Preserve trigger.

PLAYERS
All Players
CONDITIONS
CurrentPlayer has suffered Exactly 1 deaths of ExpoTaken
Foes brings at most 0 [buildings] to 'center'.
ACTIONS
Modify death count for CurrentPlayer SetTo 0 of ExpoTaken
Preserve Trigger.

Before I test this out, and correct me if I'm wrong, but wouldn't "Center expo taken!" display 4 times in a 4v4 game, because the trigger is checked for All Players, for of whom satisfy "Foes"

Edit: hurr durr durfa deep. I'm wrong, because the text is displayed for current player.



None.

Dec 24 2008, 6:36 am Falkoner Post #11



Yeah, you have to remember that All Players really just means a separate trigger for each player.



None.

Dec 24 2008, 11:45 am Zhuinden Post #12



There is a problem with SCWizard's display. The fact is that this way it displays it for everyone, not just the Foes' force. Therefore, I believe that it could mess up because it's checked for All Players, and I'd divide it into a bit more trigs.

PLAYERS
All Players
CONDITIONS
CurrentPlayer has suffered Exactly 0 deaths of ExpoTaken
Foes brings at least 1 [buildings] to 'center'.
ACTIONS
Modify death count for CurrentPlayer SetTo 1 of ExpoTaken
Preserve trigger.

PLAYERS
Player 1, Player 2, Player 3, Player 4, Player 5, Player 6 (I think that's how many you have - the human players individually)
CONDITIONS
CurrentPlayer has suffered Exactly 1 deaths of ExpoTaken
ACTIONS
Display for current player: Center expo taken!
Wait 0 miliseconds
Modify death count for CurrentPlayer Subtract 1 of ExpoTaken
Preserve trigger.


And if you have to have the status of having the expo taken, then include a switch, or another death count that is not used for displaying the text..



None.

Dec 24 2008, 5:36 pm scwizard Post #13



I don't see any problem with my triggers. Has anyone tested them?



None.

Dec 24 2008, 6:01 pm Zhuinden Post #14



The problem is that it shows the text to everyone, while mine shows it only to each player of the force whose enemies build in the center. I'm not sure which one it is meant to be.



None.

Dec 24 2008, 6:15 pm Ahli Post #15

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

PLAYERS
All Players
CONDITIONS
'Switch 01' is cleared.
Foes brings at least 1 [buildings] to 'center'.
ACTIONS
Display for current player: Center expo taken!
wait 0
Set 'Switch 01'.
Preserve trigger.

PLAYERS
All Players
CONDITIONS
'Switch 01' is set.
All Players brings at most 0 [buildings] to 'center'.
ACTIONS
Clear 'Switch 01'.
Preserve Trigger.

This should work. I'm not quite sure about the 2nd trigger. If the text is displayed over and over, you need to put every single player in the conditions (player # brings at most 0 buildings to 'center'.).




Dec 24 2008, 10:40 pm Wormer Post #16



Quote from Zhuinden
The problem is that it shows the text to everyone, while mine shows it only to each player of the force whose enemies build in the center. I'm not sure which one it is meant to be.
What do you mean by saying "The problem is that it shows the text to everyone"? It is not showing the text to everyone. Indeed, the Scwizard's variant is showing the text to some foes (and only foes) of the player who've built a building in the center. Probably it is something else you wanted to say... But Zhuinden, I cant see logic in your triggers :ermm: in my opinion your variant will be simply spamming the text as long as one's foe has taken the expo... :wtfage:

Ahli, I dont understand why do you need wait. I believe you use wait to postpone setting the switch, but what for? If someone (namely Foes) brings at least 1 building then All Players brings at least 1 building for sure and the second trigger wont fire even if the switch is set. The method should be perfect when there are distinct coalitions of players. The coalitions are foed with each other and all players are allied within the coalition. This should suffice for a normal melee game. But it raises an interesting questions when switching between foed owners of the expo in some... unusual cases. Let me elaborate.

The relation of foe might not be symmetrical. It reflects only the player's vision of the relations with the other players. You may consider a player being a foe of yours while that player can consider you an ally. In the situation you will be warend about that player's actions and your vis-a-vis wont be warned about your's. I want to introduce some conventional signs for convenience. I will write the statement "P2 is an ally of P1" (in other words "P1 has an ally flag set to P2" or "P1 considers P2 an ally") as A(P1,P2) and it's negation "P2 is a foe of P1" (in other words "P1 has not an ally flag set to P2" or "P1 considers P2 an enemy") as E(P1,P2). We've just understood that A(P1,P2) does not silently imply A(P2,P1).

Now, the text is meant to display every time a foe of a player takes the expo from scratch, right? It is a distinct question if the expo is taken not from scratch. For example as a result of a sunken attack or a photon push. Well, lets cosider for now the system is meant to work only when the expo is taken from scratch. But wait! What means from scratch when there might be more complicated relations between players than coalitions?! Indeed, consider three players P1, P2, P3. Let's assume P1 and P2 are allied with each other: A(P1,P2) AND A(P2,P1). Let's additionally assume P3 considers P1 an ally but P2 an enemy: A(P3,P1) AND E(P3,P2). It does not really matter for us how players P1 and P2 relates to P3. Now the question: should the building by P2 of his first structure at the expo be considered a building *from scratch* when there are already structures of the P1? From the coalition's point of view it should not because all coalitions see the same picture of ally relations... But in our case from the player's P2 point of view it is the first structure being built by his foes and therefore taking the expo from scratch. Let's see what will we have if now we add a player P4 with the next relation to P1: E(P4,P1). When the player P1 was building his first structure on the expo the switch was set. Later, when P2 is adding structures to the expo this should be considered as a building from scratch for P3, but the switch is already set and he wont get a message. With the Scwizard's triggers he will.

This in no way making one method better than another. This only shows their difference. This also shows that often we need more percise definition of a well-understood intuitive notions than it seems at first look.

I find the discussion about ally/enemy relations quite interesting. The nonsymmethry of the relation is the source of it's interesting properties and raises nontrivial questions. The next question might be: what should happen if the relations' picture is not static in time but can occasionally change? What should happen then? We have not still decided what to do when the capture of the expo happens not from scratch.

Going further, the discussed ideas could be used to develop new kinds of the social type maps like Phantom, The Thing and others where the players have not got the full picture of the relations between each other, where they have to disciver and eliminate the potential enemy. Moreover, there might not even be a total enemy at all! Each player might see it's own picture of what is going on, his own allies and his own enemies! Who says that ally of my ally is my ally? The picture might not be static but changeing in time! And more and more... I believe that many interesting ideas are hidden there. The potential of such kind of maps is not fully discovered.

I could have tried to answer the questions and developped the ideas further, but I've already written a too much for a single post. It is leading me too far from the main topic. The time is also reminding me of spending it in too big quantities. Finally, I should admit it is simply boring to have a discussion with myself.

If you are interested, this could be good start for a new discussion. I am begging pardon for a little offtop there. If someone would like to discuss these ideas, I am asking you, please, make a new topic in the appropriate forum with the link to this post. Though if you have particular questions I think you better ask them there.

Ah, and finally, you should forgive me if I was wrong somewhere.




Dec 25 2008, 5:26 am scwizard Post #17



tl;dr

Fine fine, I'll test my idea if you people are so skeptical.



None.

Dec 25 2008, 8:02 am Wormer Post #18



Quote from scwizard
Fine fine, I'll test my idea if you people are so skeptical.
Hey-hey! I'm not! To be hornest, your method was the first what came into my head when I've read the head post for the first time. I have a confidence it is working fine. The real problem is how far one can go in specifying when he wants the message to be displayed in particullar!



Some.

Dec 25 2008, 3:38 pm scwizard Post #19



Quote from Wormer
Quote from scwizard
Fine fine, I'll test my idea if you people are so skeptical.
Hey-hey! I'm not! To be hornest, your method was the first what came into my head when I've read the head post for the first time. I have a confidence it is working fine. The real problem is how far one can go in specifying when he wants the message to be displayed in particullar!
I seriously didn't read your wall of text, so could you post saying what your main concern is (preferable tersely).



None.

Dec 25 2008, 5:48 pm Wormer Post #20



Quote from scwizard
I seriously didn't read your wall of text, so could you post saying what your main concern is (preferable tersely).
You're disappointing me :ermm: I've tried my best to write that... and spent much time, effort and imagination... I thought it should be interesting for people out there. Probably I was mistaken.

First, I dont understand why Zhuinden says that your system shows the text to everyone, cause it's not.

Second, I dont understand the point of wait in Ahli's triggers.

The third... well, I just ask you, probably it will get you interested.

Have you thought about such situations when one player is allied to another and that another is not allied with the first? In what particular situations do you think the message should be displayed? Should the message be displayed if the exp has changed his owner (both are your enemies) in case that there was not a moment when your foes have broght 0 buildings?

The notion of nonsymmetry of ally relation have an interesting consequences which I am discussing. Ideas of new maps could be based on these property.

On the topic, I found Ahli's method quite interesting and have shown the particular situation when your and his system are working differently.



Some.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:19 pm]
Vrael -- IM GONNA MANUFACTURE SOME SPORTBALL EQUIPMENT WHERE THE SUN DONT SHINE BOY
[01:35 am]
Ultraviolet -- Vrael
Vrael shouted: NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
Gonna put deez sportballs in your mouth
[2024-5-01. : 1:24 pm]
Vrael -- NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
[2024-4-30. : 5:08 pm]
Oh_Man -- https://youtu.be/lGxUOgfmUCQ
[2024-4-30. : 7:43 am]
NudeRaider -- Vrael
Vrael shouted: if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
Yeah I'm not a big fan of Westernhagen either, Fanta vier much better! But they didn't drop the lyrics that fit the situation. Farty: Ich bin wieder hier; nobody: in meinem Revier; Me: war nie wirklich weg
[2024-4-29. : 6:36 pm]
RIVE -- Nah, I'm still on Orange Box.
[2024-4-29. : 4:36 pm]
Oh_Man -- anyone play Outside the Box yet? it was a fun time
[2024-4-29. : 12:52 pm]
Vrael -- if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
[2024-4-29. : 11:17 am]
Zycorax -- :wob:
[2024-4-27. : 9:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
Please log in to shout.


Members Online: Roy