Capture the Flag
Post Reply
Quote
Re: Capture the Flag
Posted by Yesurbius on Tue Jan 11th at 6:42am 2005


I am racking my brain trying to figure out a way to get CTF to work good. Here is what I have so far:

Basic Rules:
  • A typical CTF map is composed of two opposing sides, a red side and a blue side.
  • A team is required to get into the enemy side, steal their flag and return it to the home base in order to score a point.
  • The home base will not accept the opposing team's flag if the home flag is missing itself.
  • Players can use weapons, but he who carries the flag is not allowed to use any weapons until he drops the flag.
  • Once a flag is dropped, it remains on the ground for an arbitrary amount of time, and then automatically returns to its home base.
  • A flag that is on the ground, when touched by a member of the same team, will return to its home base.
  • A flag that is on the ground may be picked up by the opposing team.
  • When one team has reached a predetermined amount of points, the game ends and the team with the most points wins.
  • When a certain amount of game time has elapsed, the game ends and the team with the most points wins, or a tie in the case of equal points.
Don't think I missed anything.

How this can be done in HL2 without modding:
  • The zone where a flag is returned is a trigger_teleport. The zone uses a filter_multi, which uses two other filters: One to test for the presence of a team member, and one test for the presence of the opposing team's flag. We could branch another AND in there, testing for the absence of any opposing team member. When conditions are met, a game_text is Displayed such as "Blue Team has captured the flag!" and the score is incremented.
  • Once the filter_multi is a PASS, the trigger will disable motion on the flag, break it, and call an Input to create a new flag in that team's home base.
  • Once a team steals the flag, the trigger_teleport for the opposing team is disabled.
  • The flag is a regular func_physbox with a mass scale of like .01 (easily carried). On Physgrab, a test for team is made, and if it is the proper team, motion is enabled, and a game_text message is sent out such as "Blue has stolen the flag". OnPhysDrop would disable motion and send out a game_text message such as "Blue has dropped the Flag" ... We could use a logic_ entity to keep track of whether the flag has been taken or not, and that value affects the OnPhysgrab and OnPhysDrop behaviors (So Blue can carry their flag back to their base.)
Big question is ..

How do we get the flag to automatically zip back to the flag post once its own team touches it? There is no output that I can use such as "MoveTo <name of target>" Unfortunately. We *COULD* put a twist on CTF and have flag return points throughout the level, so touching the flag is not enough, you have to return it to the nearest flag return. Maybe we can use the OnPhysgrab, combined with a successful check that the flag has been removed from the base to put in a server command to destroy the current flag, and create another in the base (someone else should comment on this as I have no experience with it) ...

Anyways - any ideas on how we can make this fly?


[addsig]




Quote
Re: Capture the Flag
Posted by Mad on Tue Jan 11th at 11:34am 2005


There are already a lot of CTF maps out there (check steamforums). To make the "flag" return can't you just use a "object respawn" (prop_respawn?) can't remember what the exact name of it is, but just like every thing that respawns when it breaks in lockdown for example. So when you leave the flag in your base trigger it to break, and it will respawn to it's origin with this entity. Sorry for my english hope you understand what im talking about.

As for the maps that i have played, they are a bit slow. Think there is a entity that can change the players speed, haven't tried it out yet though.

And would be cooler if somone could make a animated prop for a real flag for the blue and red team. So we could get a package that everyone could use with standard rules for CTF map makers to follow. Not fun to capture a banana as a flag on one map and a ball on the other, and get 30 points for one flag on one map and 1 on another.

Another thing is the room with the flag in it should have doors that close like 10 sec after you pick up the flag killing everyone in it after the 10 seconds. And have the spawn points very close or outside these doors, so you cant camp in the flag room.

Most important thing is you should get like 3 frags for taking the flag to your base, the times ive played ctf in hl2dm most people don't give a s**t about getting the flags, just fragging.




Quote
Re: Capture the Flag
Posted by Yesurbius on Tue Jan 11th at 1:21pm 2005


I will have to check out that CTF later tonight ... More than likely they did not have team based play - everyone spawns everywhere kinda thing right?
[addsig]




Quote
Re: Capture the Flag
Posted by Mad on Tue Jan 11th at 1:42pm 2005


Each team starts in there base. Can't remember where i read it, but i think they solved it using some filter entity with teleports. Think it was on verc or hl2.net.

Check out this map if you can find it "tdm_2fort_b5", there are probably better ones out there, but i know this one works.

EDIT: Um i just checked the tutorial section here, you where the guy who wrote about it sorry, lol.




Quote
Re: Capture the Flag
Posted by sXenoG on Wed Jan 12th at 12:29am 2005


That makes total sense how you'd achieve that in hl2dm! Is there a way to parent objects to specific players tho? (id kind of like to do a ctf map for cs:source if its possible)





Post Reply