Control Points

I’ve been working on a set of control point entities for a few weeks. The general idea is to have a set of entities that mappers and gamemode creators can use to make control point games. I’m basing them fairly heavily on the TF2 entities to start with. In addition to a usable set of gmod entities, I hope to provide a set of base control point entities that can be easily inherited to use for specific cases or other games. My test case right for this right now are the TF2 entities – I can load up a TF2 map in Garry’s Mod and the existing control point entities work with my framework.

My initial idea is to provide entity types based on the TF2 entities (the gmod entities will likely have different names to differentiate):
[li]trigger_capture_area: triggers when players step on it to capture the point
[/li][li]team_control_point: the control point entity
[/li][li]team_control_point_master: controls the points
I think there are some other entities involved sometimes, but these three are my goal for version 1. I have the trigger and point entities more or less functional, but haven’t started on the master yet.

Features and Goals:
[li]Supports key/values entered in Hammer
[/li][li]Supports inputs/outputs entered in Hammer
[/li][li]Supports Garry’s Mod hook system
[li]Will raise events at appropriate times (point captured, start capture, etc. actual list of events still TBD)
[/li][li]These can be hooked by using the existing gmod hook.Add function
[li]Works with existing Garry’s Mod team system
[li]Works for more than 2 teams (This may be too complicated; we’ll see)
[li]Easy to hook into gamemodes – a gamemode creator shouldn’t have to modify the control point entity code at all, just drop them in and configure/hook events.

I’m at work, so no screenshots right now, but imagine a couple of TF2 control point images right here.

I threw together a quick Fretta gamemode to test out the control points.


I was working on a control point system too, but haven’t had the opportunity to test it yet. I’m not so certain if you need a master entity, though.

Yeah, I was leaving that until last. I think something like it is probably necessary if you want to let a mapper define the control point layout though.

How far did you get on your system?

Fairly far. I didn’t implement any master entity, but it runs off the control point and the brush for the capture zone. It should earn capture based on the players inside it. For example, 1 player from team 1 means that it gains 1 capture every time it adds percentage. Two makes it 2. If there are two from team 1 and one from team 2, only 1 capture will be added every check. The rate can be configured by the mapper.

Yeah, I was thinking about adding an attacker/defender difference capture mode later. Right now it just does the standard any defender blocks the cap.

I just felt it was easier. Because there are only two teams, -100% goes to one team, and +100% goes to another.

I threw together a quick Fretta gamemode to test out the control points.


ugh, what the hell

[lua]function GM:CheckRoundEnd()
–TODO: this is super hacky, clean it up
local capPoints = ents.FindByClass(“team_control_point”);

if(capPoints[1]:GetOwningTeamId() == TEAM_RED and
	capPoints[2]:GetOwningTeamId() == TEAM_RED and
	capPoints[3]:GetOwningTeamId() == TEAM_RED) then
elseif(capPoints[1]:GetOwningTeamId() == TEAM_BLUE and
	capPoints[2]:GetOwningTeamId() == TEAM_BLUE and
	capPoints[3]:GetOwningTeamId() == TEAM_BLUE) then



Loops are your friend. At least then you can support multiple cap points.

Oh yeah, it was 6am and I wanted to get it working. That’s definitely changing in the future. I’m not even sure whether that code is going to remain there or go into an entity yet.

Edit: I even put a comment there and everything :stuck_out_tongue:

Why wouldn’t you have done it as a loop to begin with?

Because I was falling asleep and didn’t want to design another object.

You could’ve just used loops in the first place… it would have been easier than doing the if/elseif spam.
And what the hell are you talking about, ‘design another object’… the fuck?

Can this be scripted for moar than two teams?
Could you also script the points to provide resources if the gamemode allowed it?
Could you have a master point wich waw non contestable

its jus for a mode im thinking of freating involving turf warz