Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: How to replicate Capture the Flag
How to replicate Capture the Flag
Nov 24 2012, 3:20 am
By: Pucca  

Nov 24 2012, 3:20 am Pucca Post #1



I am trying to run a 2x2 Capture the Flag tournament. However, I am unable to force spawns in the Team CTF mode so I needed to make a UMS map. I am running into a number of issues but I'd rather tackle one at a time and come back with any other concerns of mine at another time. Currently I am having an issue of replicating the Capture the Flag mode.

In order to replicate capture the flag mode I required two locations where the flag was to spawn for both teams and the place the winner team would capture their flag.

I have run into several issues with this method. For one the beacon will only appear on the map if the player assigned to each beacon is neutral. The major issue at hand is when I bring the flag back to capture it this happens:


Now tinkered with the triggers best I can with my limited knowledge. Here are the current triggers:

For Team 1:


For Team 2:


To further complicate things if these flags spawn as a player's flag which I don't know if that has to be the way to do this. However a problem arises is that Player 2, Player 1's teamate, could take the flag and hide it somewhere on the map. While I would like to embrace this at the same time I would be much happier if I could avoid this. Some of the maps I am using in my tournament are 256x256 like EPICA. I can't have players hiding their flags allover a 256x256 so I took the idea from the actual CTF game. Where everyone can see each others flags. So I introduced players 5 and 6 as computer to simply have their flags spawn and then they share their vision with the enemy team so the enemy team can see the flag of other team.

For Player 5:


For Player 6:


So I am running into multiple issues currently. I am wondering if somoene could help me organize this into such a way I described or at least close to it. Right now this is just a non-functional UMS.

I have provided a link to the two maps I am trying to apply this to. If that helps it will have all the information regarding triggers and my setup thanks for your help!

Attachments:
PCTF Season 3 Maps V0.7.zip
Hits: 1 Size: 478.39kb



None.

Nov 24 2012, 5:06 am Azrael Post #2



1) You have the player races set to User Select.

This causes all preplaced units for the player to be removed. The main building for the chosen race is created at the player's start location, along with a number of workers.

You should set their race to Terran and preplace whatever you want them to have.

This is causing most of your problems, and has probably been pretty frustrating to deal with.

2) Your shared vision scripts are running for the wrong player.

They should run for Force 1/Force 2, and share vision of Player 5/Player 6.

3) Your flags aren't being created for the correct players.

The flags are being created for the actual players, not for the computers. The victory conditions are currently impossible to trigger.

I think that should pretty much solve all the problems you've been having.




Nov 24 2012, 3:57 pm Pucca Post #3



Quote from Azrael
1) You have the player races set to User Select.

This causes all preplaced units for the player to be removed. The main building for the chosen race is created at the player's start location, along with a number of workers.

You should set their race to Terran and preplace whatever you want them to have.

This is causing most of your problems, and has probably been pretty frustrating to deal with.

2) Your shared vision scripts are running for the wrong player.

They should run for Force 1/Force 2, and share vision of Player 5/Player 6.

3) Your flags aren't being created for the correct players.

The flags are being created for the actual players, not for the computers. The victory conditions are currently impossible to trigger.

I think that should pretty much solve all the problems you've been having.
I've changed everything you have instructed and yes has fixed the issue of the flag being captured and now I have vision of the flag. But the problem remains that when the flag spawns at the point it acts as a capture so the game ends immediately as the flag spawns which is problematic.

This is the current trigger right now:


Maybe if I made a crystal for the other team and so one would actually have to go receive it? Other than a flag and crystal is there any other object an SCV can hold and bring somewhere?



None.

Nov 24 2012, 4:34 pm Roy Post #4

An artist's depiction of an Extended Unit Death

Quote from Pucca
Other than a flag and crystal is there any other object an SCV can hold and bring somewhere?
They can carry any power-up: Data Disc, Khalis Crystal, Khaydarin Crystal, Psi Emitter, Uraj Crystal, Young Crysalisk.

Additionally, they can carry Flags, as you know, and they can carry Mineral Chunks and Vespene Orbs/Tanks/Sacs.




Nov 24 2012, 4:50 pm Azrael Post #5



Quote from Pucca
I've changed everything you have instructed and yes has fixed the issue of the flag being captured and now I have vision of the flag. But the problem remains that when the flag spawns at the point it acts as a capture so the game ends immediately as the flag spawns which is problematic.

It shouldn't.

You are using Location 40 to create a flag for Player 1, but also made the victory condition bringing the flag back to Location 40. Those locations should not be the same.

The first location should be where the flag starts, the second location should be where it's supposed to be taken to.

Also, it's a bad idea to use the actual players for the flags. Using Player 5/6 is a better idea. With your current system, if Player 1 leaves the game, the flag will become owned by Player 12 and all your triggers will stop working. There are a number of ways to work around this without using additional players, but since you already set it up to use computer players on at least one of the two maps, it seems like something to take into consideration.




Nov 24 2012, 7:35 pm Pucca Post #6



I have now fixed the issue entirely! I now have two more questions if you guys could help me? Is it possible to say "Team 2's Flag has been Stolen!" when it is picked up by the enemy team? <------ This is minor not at all important.

The major step forward I want to be able to make is a scoring system. After 5 minutes in the game there will be a random Psy Emitter that spawns on the map I already have all the locations down. I just don't know how to setup the trigger to go to one of these locations randomly and every 2 minutes in-game because I only want one of these psy emiiters on the map at any given time. Then when a team scores a point back on their beacon they will gain a point would you have any idea on how to replicate this?



None.

Nov 24 2012, 10:37 pm Azrael Post #7



Quote from Pucca
Is it possible to say "Team 2's Flag has been Stolen!" when it is picked up by the enemy team?

Conditions:
Force 2 brings exactly 0 Flags to FlagStartLocation.
Current Player has suffered exactly 0 deaths of Cantina.

Actions:
Display text for current player "Team 2's Flag has been Stolen!"
Set deaths for current player: Set to 1 for Cantina.
Preserve trigger.

Then just set the DC of Cantina to 0 for Force 2 whenever the flag they're supposed to be stealing gets reset (like at the beginning of a round, assuming you're using them).

If this message will only ever happen once, then you can remove the death count stuff and the preserve trigger.

Quote from Pucca
The major step forward I want to be able to make is a scoring system. After 5 minutes in the game there will be a random Psy Emitter that spawns on the map I already have all the locations down. I just don't know how to setup the trigger to go to one of these locations randomly

Assuming you have 8 locations, you would Randomize Switch 1, Randomize Switch 2, and Randomize Switch 3. This gives you 8 possible combinations (Cleared, Cleared, Cleared; Cleared, Cleared, Set; etc).

If you have more locations, you'd use more switches. It's easiest if you have a power of two though (2, 4, 8, 16) since it works out evenly. If you had 12, for example, you'd need to randomize 4 switches (which gives you 16 possible combinations) and then the last 4 combinations (13-16) would need to result in a rerandomization of the switches until you got one of the 12 results.

Quote from Pucca
and every 2 minutes in-game

Do you mean every 2 real minutes, or every 2 game minutes (this would be 2 minutes for elapsed time and countdown timers, but only 1 minute 20 seconds in real time)?

Assuming you meant 2 minutes in game time, just have a trigger set the countdown timer to 120 seconds. When the countdown timer is 0 seconds, it randomizes the three switches from before (and sets Switch 4), then it sets the countdown timer back to 120 seconds.

You need 8 switches after that, each with a different combination of the three randomized switches (Cleared, Set, Set; etc). However, you also need the fourth switch, Switch 4, to be set. This tells the triggers to check the randomized switches (otherwise the Cleared, Cleared, Cleared trigger would always fire at the beginning, among other issues). Each of these 8 triggers will create a Psi Emitter in a different location, as well as Clear Switch 4.

Quote from Pucca
I only want one of these psy emiiters on the map at any given time.

In the above example, just add "All Players commands exactly 0 Psi Emitter" in the conditions of each of the 8 follow-up triggers. Make a ninth trigger after those that says "Always" and then simply "Clear Switch 4". This will prevent any more Psi Emitters from being created until the current one has been scored somewhere.

Quote from Pucca
Then when a team scores a point back on their beacon they will gain a point

I assume points would be done through the leaderboard. If so, at the beginning of the game show Leaderboard (Points) and set it to Custom.

Then you can just have a trigger that says:

Conditions:
Force 1 brings exactly 1 Psi Emitter to FlagRetrievalLocation.

Actions:
Remove all Psi Emitter for Force 1.
Set Score for Force 1: Add 1 Custom.
Preserve trigger.





Nov 25 2012, 2:59 am Pucca Post #8



I set it as a cantina but what is a cantina? I'm confused.

I also don't understand how to edit or make triggers for switches. Sorry I am terrible with the map editor (--_--#)

So I have made a basic trigger:


I don't quite understand the 2,4,8,16 as well. I'm not grasping this idea of switches very well!

Post has been edited 1 time(s), last time on Nov 25 2012, 3:12 am by Pucca.



None.

Nov 25 2012, 3:38 am rockz Post #9

ᴄʜᴇᴇsᴇ ɪᴛ!

In starcraft each unit is assigned a number. There are 228 total units in the game (including buildings) but many of them are not "real" units, but leftovers from the beta era. Cantina, cave, cave-in, etc... are all left overs that will crash the game when you place them. However, you can read and edit their death counts just fine. Death counts for non-existent units are essentially the same thing as "custom score". You can even display it on the leaderboard (but you need a trick to do it).

Azrael is talking about randomization.

You can randomize in one trigger, but it's easier to do it in 6 triggers:

Conditions:
whatever
Actions:
Randomize switch 1

Conditions:
switch 1 is set
Actions:
Add 4 Deaths to Cantina

Conditions:
whatever
Actions:
Randomize switch 1

Conditions:
switch 1 is set
Actions:
Add 2 Deaths to Cantina

Conditions:
whatever
Actions:
Randomize switch 1

Conditions:
switch 1 is set
Actions:
Add 1 Deaths to Cantina

Now you have a completely random number from 0-7 stored into the death count for Cantina. The "whatever" condition can be always, in case you want a random number every round. Assign the numbers 0-7 to a specific location on the map and make a trigger for it:

Conditions:
whatever
Death Counts of Cantina is exactly 4
Actions:
Create 1 psi emitter at location 4 for player 12

Finally, if you want to spawn one every 2 minutes, you can use death counts to time something or you can use the countdown timer. I'm not going to explain that here because that would be too much for one post.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Nov 25 2012, 5:36 am Azrael Post #10



Quote from rockz
You can randomize in one trigger, but it's easier to do it in 6 triggers

It seems like a good example for explaining what's happening, but I think that's a lot of unnecessary triggers, especially if you want to modify the system later. It is definitely easier in many circumstances (like when you are directly adding a random number of ore/gas/units/score/death counts), but for something that can't be accumulated over a number of triggers (like a random location), it would be less efficient.

Still a good trick to be aware of, regardless :kame:

Quote from rockz
Create 1 psi emitter at location 4 for player 12

Just a note, that wouldn't work. You can't create units for Player 12.

As for the question about not being sure how switches work, they are exactly what they sound like. It's like a light switch, it's either off or on (Cleared or Set). All switches start as Cleared. When you set or clear a switch, it changes for everyone (switches are global, not player specific like death counts). They serve no purpose whatsoever except for you to be able to check them in trigger conditions.

When you go into the "Set Switch" action, you will see there are a few options: Clear (flips the switch off), Set (flips the switch on), Toggle (flips the switch to the opposite of whatever it is already), and Randomize (flips the switch to a random choice).

If you randomize one switch, there are 2 possible outcomes (Clear; Set). If you randomize two switches, there are 4 possible outcomes (Clear Clear; Clear Set; Set Clear; Set Set). Similarly, if you randomize three switches, you get 8 possible outcomes.

Therefore, in the example I gave earlier, you can randomize three switches (Switch 1, Switch 2, Switch 3), and also "Set Switch 4" to activate the triggers after it. Then in the conditions of the 8 triggers which follow it, you'd have something like:

Conditions:
Switch 4 is Set.
Switch 1 is Clear.
Switch 2 is Clear.
Switch 3 is Clear.
All Players commands exactly 0 Psi Emitter.

Actions:
Create 1 Psi Emitter at RandomLocation1 for Player 5.
Clear Switch 4.
Preserve trigger.

Conditions:
Switch 4 is Set.
Switch 1 is Clear.
Switch 2 is Clear.
Switch 3 is Set.
All Players commands exactly 0 Psi Emitter.

Actions:
Create 1 Psi Emitter at RandomLocation2 for Player 5.
Clear Switch 4.
Preserve trigger.

Conditions:
Switch 4 is Set.
Switch 1 is Clear.
Switch 2 is Set.
Switch 3 is Clear.
All Players commands exactly 0 Psi Emitter.

Actions:
Create 1 Psi Emitter at RandomLocation3 for Player 5.
Clear Switch 4.
Preserve trigger.

Conditions:
Switch 4 is Set.
Switch 1 is Clear.
Switch 2 is Set.
Switch 3 is Set.
All Players commands exactly 0 Psi Emitter.

Actions:
Create 1 Psi Emitter at RandomLocation4 for Player 5.
Clear Switch 4.
Preserve trigger.

Conditions:
Switch 4 is Set.
Switch 1 is Set.
Switch 2 is Clear.
Switch 3 is Clear.
All Players commands exactly 0 Psi Emitter.

Actions:
Create 1 Psi Emitter at RandomLocation5 for Player 5.
Clear Switch 4.
Preserve trigger.

Hopefully you notice the pattern and could do the last 3 triggers in that series.

As mentioned earlier, after those triggers, you'd want this:

Conditions:
Always.

Actions:
Clear Switch 4.
Preserve trigger.

This is for the situation where there is still a Psi Emitter on the map somewhere, since none of the previous triggers will have been able to clear the switch.

Also, you should add hyper triggers to your map. They are a set of 4 triggers which make all your triggers run 16x faster, so they become extremely responsive. The only requirement is they must be owned by a player who will be in the game (preferably a computer player).

These four triggers are all identical copies of one another, and all they consist of is:

Conditions:
Always.

Actions:
Preserve trigger.
Wait 0 milliseconds.
Wait 0 milliseconds.
Wait 0 milliseconds.
...
... (Copy the Wait 0 action as many times as you can, until you've filled in the whole trigger. The maximum is 64 actions, use them all.)
...
Wait 0 milliseconds.
Wait 0 milliseconds.
Wait 0 milliseconds.


That's one hyper trigger. Give it to a computer player, and copy it 3 times (for a total of 4 hyper triggers). You should notice an overwhelming improvement in how quickly your triggers are executed.




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[07:32 pm]
Zoan -- I got $2000 bonus. I would like 2000 minerals, please
[04:15 am]
DarkenedFantasies -- you eat lots of beans
[03:46 am]
IskatuMesk -- how do i get gas
[11:43 pm]
Moose -- you don't
[10:06 pm]
Zoan -- how do i get minerals
[2026-4-14. : 11:45 pm]
ClansAreForGays -- Anyone wanna played Skewed StarCraft?
[2026-4-14. : 12:07 am]
Vrael -- NudeRaider
NudeRaider shouted: Vrael ranting still is though
you're a gentleman and a scholar, thank you
[2026-4-13. : 10:07 pm]
NudeRaider -- ya why phone people when you can just write letters
[2026-4-13. : 9:37 pm]
IskatuMesk -- I have never and will never own a phone
[2026-4-13. : 9:15 pm]
NudeRaider -- Vrael ranting still is though
Please log in to shout.


Members Online: Roy