CTF objective


(Miki) #1

I’ve made a deathmatch map (and its about 90% done – some minor bugs to fix) and now i’m thinking it might be better to put a CTF objective in it, I guess it will increase the fun on the map.

Now, i’ve tried to mess around with the capturable flags, and its not working at all.
So, the first question is : does anybody has a good tutorial for a CTF objective in ET?
The second is less important, but perhaps somebody here got some nice flags models? :slight_smile:

Some screenshots of the map : (don’t mind the ‘bugged’ xfire fps meter :D) – It aint a big map so there should be no FPS problems :slight_smile:


The ‘blue’ (allies) zone.

The ‘red’ (axis) zone.

The axis zone down below

The middle

I’ve tried to make it a quake-stylish map : Jumppads, some teleporters… :slight_smile:
Basicly, the whole map is mirrored, so should be ballanced too ;-). Only problem might be that some guys could camp on the big rock in the middle, but with teleporters you can easly get them in there back, and knife those dirty campers :wink:

So, if anybody would know a tutorial for a CTF?


(Pegazus) #2

Can’t help you with the CTF objective, but one thing i like is the Quake style, now only thing missing are the weapons lol.
Good job, waiting for release. :wink:


(sixzeroone) #3

http://www.wolfensteinx.com/surface/tutorials/documents.html


(IndyJones) #4

the layout looks familiar.


(Miki) #5

Sixzeroone, I’ve tried that tutorial, but I cant seem to get it working. The documents (team_CTF_blueflag) aren’t showing up. I’ve done the same as in the tutorial. Weird :frowning:

EDIT : Sixzeroone, the link isn’t working atm… I get ‘network-timeout on wolfensteinx.com


(Qualmi) #6

…maybe you can learn from loffys map file he has released. tell me if its the right link, didnt look -> http://www.wolfmap.de/details.php?file_id=666

and ye…prepare for the ultimate critizism, huahuahuahua :D:stroggbanana:


(shagileo) #7

Well the Surface Editing Shack doesn’t work with me either… pretty weird.
And I’m not sure if that’s going to help you to make a CTF map. I don’t have any experience with CTF maps and I would like to know too.


(eiM) #8

I attatched one of my maps, which I never finished / published as it had shitty dimensions :smiley:

In there I added capturable flags in ET Style which are working quite fine. Feel free to copy/paste. Though you need some shaders to fix the textures for the models, but thats not too hard either.

Have Fun.

http://reveal.eicher.tv/maps/arena.zip (mapfile included ofc)


(Miki) #9

Well, its not working out. I’ve looked in the CTF_FACE_B1 script, and still no solution :confused:
If there would be somebody so kind to make a little .map and .script file for me?

The idea would be like this: first one that has 3 flags advantage, wins. So, basicly,
Axis steal flag => axis are ahead by 1
Allies steal flag => score is tied
Axis steal flag => axis are ahead by 1
Axis steal flag => axis are ahead by 2
Axis steal flag => axis win

So, there should be an infinitive respawn of flags. I guess something like baserace, construction materials keep spawning?

EDIT : posted while eiM was writing. i’ll try that first


(-SSF-Sage) #10

[QUOTE=Miki;189459]The documents (team_CTF_blueflag) aren’t showing up. I’ve done the same as in the tutorial. Weird :frowning:
[/QUOTE]

You probably gave it a targetname. It doesn’t appear if you gave it a targetname, unless you have wait 250 and alertentity targetname in spawn.

There is a key to define the amount of flags that can spawn. I don’t remember the exact key as I’m in work, but radiant shows it up for you.

First of all I assume you understand enough of scripting to make the basic layout of the script for it to work (look at radar for example).

So you want to make a team win when it’s ahead by 2? You could do that with one accum, inc it 1 when allies scores, and inc -1 when axis scores. Then check after each scoring if the accum is 2 or -2 and execute victory.

If you want a score board or announcer, you can use same accum, so you just make a check for each possible accum value (2, 1, 0, -1, -2) and make it trigger based on that. A command to do so:

(global)accum <buffer_index> trigger_if_equal <value> <scriptblock> <trigger_event>

I hope you understood. The script is really simple, so if you have any clue of scripting, you should be able to figure it out easily.


(Miki) #11

Yes, I’ve found it out, thanks the the help of eiM’s files! (Many thanks, works now!)
Its not the ‘ahead by 3’ thing, its just ‘score 3 points’. I’ll see if I change that later.


(stealth6) #12

lol I released a ctf prefab the you could’ve just imported that goes to 99 caps i believe or untill time runs out.
And Rayban released some nice ctf flags.

My prefab (including the rayban models)
http://stealth.staatsschutz.org/ctfprefab.pk3


(shagileo) #13

Ah that’s great, thanks stealth


(eiM) #14

happy that it helped you =) atleast of any use this failmap :smiley:


(Flippy) #15

I wrote most of the script for CTF_Face_b1 (although I did get most of it from Rayban’s sample map I believe). I would be willing to give you the source code for the map if I can find it, but it’s been a long time lol I don’t think I still have it :frowning:

I can give you a few important pointers however going by the script alone (I suppose you have the script from the PK3?)

First of all, in the game_manager spawn event, both flag entities are alerted with alertentity:

		alertentity allied_flag	// reveal the flags to start with, setstate invisble and default
		alertentity axis_flag	// should work from here on.

This is absolutely necessary since the flags have to have a ‘targetname’. If an objective has a ‘targetname’ in ET, it does not show up in the game. The only way to make it show up is to alertentity it like so.

Right after that, two accums (1 for axis, 2 for allies) are set to 0. These accums correspond to the score.

Then there are a few triggers that handle the scoring, trigger allies_captd and trigger axis_captd. Both of these are very simple: they increment (inc) the scoring accum of the corresponding team and call the allies/axis_win trigger if it is equal to 4 (or 3 if you want 3 points).

Then, there is a bunch of ‘scoreboard stuff’ as the comments mention. This is not very important; it handles the re-drawing of the games compass which shows the current score. If you want this in your map aswell you should do a search for ‘compass scoreboard’ written by RayBan and you’ll find it.
For now however just ignore all the scoreboard stuff!

Then the next important thing is the timelimit_hit trigger. It calls a parse_score trigger that checks which team is ahead, and lets that team win. It is kind of a dirty check but as far as I know the only way to handle it in ET scripting. It’s hard to explain how it works, but you can probably just copy/paste it if you don’t understand it.

After that there’s a whole bunch of scoreboard stuff, ignore it.

Then finally the flag control.

Important is that the allied_flag (the objective) and allies_cap_flag (the objective goal trigger brush) are hidden when the flag is stolen, so you can only steal one flag at a time and you can only score if your flag is returned. This was also the reason the objective had to have a targetname.
Obviously, when the flag is returned (or when a point is scored!), the flag and goal are set back to normal.

Once a flag is captured you might think “well, how does it respawn?”. It doesn’t. The objective has a ‘count’ key (I believe it was count) which you can set to some number (in our case 4, in your case probably 3). Once an objective is captured, a new one respawns, until all the 4 (or 3) objectives are gone. So that is all handled internally.

Finally, there are two fake goals that might be important to you too. Looking at your map screenshots I think it is possible to fall of the map and die?

If yes, you should handle that properly. What if the flag carrier runs of the map? The flag will just lay on the bottom of the skybox for 30 seconds before it finally respawns.

We didn’t want that, we wanted it to respawn instantly. So we simply made two fake goals (objective goal brushes), one for each team, right at the bottom of the map (just above the skybox). Once the flag is ‘delivered’ to one of these goals, the usual routine of scoring is followed (setting flag state back to default etc) except that no points are awarded.

I think that’s basically it… Good luck!