Fine-tuning Flags?

DrHaphazard

L5: Dapper Member
Jan 6, 2008
249
12
Spaceweasel has a post in the tutorial forum about the different CTF gametypes you can set when you create an item_teamflag...

http://tf2maps.net/showthread.php?t=202

...and I was very happy when I saw this because I would like to create a CZ2 style map in which the flag slows down the carrier. The Attack/Defense gametype of flag does just that, however I was wondering if this could be finetuned any? For example:

1) Can the speed penalty be decrease/increased?
2) Can the message displayed when you hold the flag be changed?
3) Can the timer for a dropped flag be reduced? (I was thinking something closer to 10 seconds, yeah thats fast but theoretically in a cz2 game youd have multiple flags anyways.)

Thanks for any help on this and I love these forums!
 
R

richard_cabeza

just found this today. You might be able to use those parameters to do what you want.

I'm actually looking for info on how to adjust the flag timer, too. I've posted to a few forums but just found this one today. Nobody's been able to answer my questions. I'll keep looking and keep an eye on these replies.
 
R

richard_cabeza

Actually, what I'd really like to be able to do is have the flag sent back to base by a team member.

For instance, a Red guy kills a Blue flag carrier, so the Red flag is on the ground. I want a Red guy to be able to stand on the intelligence for 5 seconds and have it respawn back at its home, not wait 60 seconds for the timer to expire.
 
R

richard_cabeza

I just set up a map where the dropped briefcase respawns after 20 seconds. The timer is totally customizable. The only drawback is I don't know how to adjust the graphical timer. These parameters I'm going to share don't change its 60-second default. :(

http://tf2maps.net/showthread.php?t=136

I started there and just had my big breakthrough. The trick to a custom flag respawn is to create a point_template and connect it to your briefcase. The template should be in the dead center of the briefcase, because that's where it's going to respawn. Give it a custom name. Under "Template 1" use the eyedropper and grab your briefcase. IMPORTANT: On the flags tab, make sure "Don't remove template entities" is checked.

Then I set up some OnDrop commands with the briefcase:

OnDrop, KillHierarchy (Delay 20 sec)
OnDrop [**point_template_name**] ForceSpawn (delay 20.01 sec)

Through trial and error, I found that it can't output commands at the exact same time. I tried Killing and ForceSpawning both at exactly 20 seconds and it just disappeared. Whoops. Have fun with the delays. I've been working on this problem for like 2 weeks. And I finally solved it. HOORAY!
 
Last edited by a moderator:

DrHaphazard

L5: Dapper Member
Jan 6, 2008
249
12
Sweeeeeet man, and a clever solution to the problem. It does suck that the timer will be wrong, but such is life i suppose.

I'll try this method as soon as I can get hammer working again!
 

DrHaphazard

L5: Dapper Member
Jan 6, 2008
249
12
Hmm a good point shmitz, i wish hammer would open for me to test this out.

Also I am assuming that the OnDrop command applies to both you dying with the flag and to the player pressing "l" or whatever to drop the flag manually. Seems like it should but you never know.
 

DrHaphazard

L5: Dapper Member
Jan 6, 2008
249
12
Aight well I've had a chance to test this in a simple map and it seems to work fairly well.

If dropped by player the flag returns after given amount of time
If player dies the flag retunrs after the given amount of time
A dropped flag can be picked back up (although you might have to give it a second)
A flag that is dropped and picked up again can still be capped

There seems to be only one glitch in the system:

A flag that is dropped, picked up, and dropped again does not wait the full amount of time on the second drop. As far as I can tell if 5 seconds elapse when first dropped then only 5 seconds will be remaining after the second person drops it. Once capped the timer seems to reset itself.

I did notice once that a flag which returned by the above manner (returned after only a few seconds on second drop) and then was picked up and dropped again returned very quickly. I'm not sure why that would be, perhaps things were not entirely reset or something.

All in all, however, I am quite pleased with the results here, excellent work richard!
 
R

richard_cabeza

Thanks!

I'm actually here (and happy to report) that I have a much more elegant solution!

Here are instructions for adding a Red flag to the map with a 20-second respawn time when dropped:

To start, create a point_template entity in the center of your briefcase in its home location. Name it RedFlagTemplate. In the "Template 1" field, use the eyedropper to select your briefcase (RedFlag for me).

Then create a logic_relay entity (anywhere) and name it according to the team color. I called mine red_flag_logic. In the Outputs tab, do the following:

OnTrigger, RedFlag, KillHierarchy, 20 sec delay
OnTrigger, RedFlagTemplate, ForceSpawn, 20.01 sec delay

Then for the briefcase (RedFlag), add these Outputs:

OnDrop, red_flag_logic, Trigger, 0 delay
OnPickup, red_flag_logic, CancelPending, 0 delay

Do the same for the blue flag and you're ready to go. The timer resets on CancelPending, so flags don't randomly respawn. It needs to be tested more, but it seems to work flawlessly. I can post a simple demo map if anyone wants to see it.

If anyone knows how to adjust the graphical countown timer, I'd appreciate the help.
 

Intraman

L4: Comfortable Member
Nov 4, 2007
191
0
hrmm that's interesting. By graphical timer you mean the icon that pops up over the flag right? I wasn't even aware that changed. I sure no one will really complain if that doesn't change.
 

Vilepickle

Banned
Oct 25, 2007
372
199
I actually use the graphical stuff all the time. I donno, Valve needs to add this functionality in rather than making us hack around it. It's some of the most basic stuff in Fortress related games and it isn't easily available in full working form. Sigh :I
 
B

BeelZebub

Spaceweasel has a post in the tutorial forum about the different CTF gametypes you can set when you create an item_teamflag...

http://tf2maps.net/showthread.php?t=202

...and I was very happy when I saw this because I would like to create a CZ2 style map in which the flag slows down the carrier. The Attack/Defense gametype of flag does just that, however I was wondering if this could be finetuned any? For example:

1) Can the speed penalty be decrease/increased?
2) Can the message displayed when you hold the flag be changed?
3) Can the timer for a dropped flag be reduced? (I was thinking something closer to 10 seconds, yeah thats fast but theoretically in a cz2 game youd have multiple flags anyways.)

Thanks for any help on this and I love these forums!

I see that you already have #3 worked out so let me address the other two issues.

1) You can create your own speed penalty/bonus by using a trigger_vphysics_motion entity parented to the flag that has a filter specifying the name of the flag carrier (as outlined in my other post). This will allow you to have total control over the physics of the flag carrier.
2) You can create your own messages for the flag carrier by using a game_text entity. Unlike the game_text_tf entity, the normal game_text only displays the message to the !activator.
 

DrHaphazard

L5: Dapper Member
Jan 6, 2008
249
12
Heh you better be careful BeelZebub, if you keep answering my questions I am going to be bugging you nonstop! How did you learn all this stuff anyways? You just been mapping a long time or did you do this professional at one point?

Oh and Vile I have been considering writing to those people at Valve about some of these strange mapping roadblocks. I know that people like Gabe Newell will actually answer emails. Do you happen to know any one on the TF2 team that you can actually email and that will answer?
 
Last edited:

DrHaphazard

L5: Dapper Member
Jan 6, 2008
249
12
Oh and upon further review I've decided against having the flag carrier slowed down by the flag. TF2 is a fast game, and it would be foolish to penalize those who are actually trying to achieve the map objectives.

Most importantly even in the confines of my small test room the scout was slowed to a crawl by the flag, I cant imagine what a heavy would be like. I can only assume that this vphysics trigger can also speed up players?

I ask this because I would prefer to use the Attack/Defend ctf playstyle for the flags, that way you are carrying your own team's flags and I wont have to disable the built in sounds and messages of the standard CTF playstyle. The only difficulty is that Attack/Defend slows the char, as previously mentioned.
 
B

BeelZebub

I've actually only created one TF2 map, but I work as a software developer so doing interesting things with the entity system isn't terribly far from what I do for a living.

I don't mind answering any questions/problems you come up with. Its fun to play with entities. If you want to collaborate on a project let me know.

To answer your question about vphysics triggers speeding you up...It is perfectly possible for the trigger to do. However, server settings may limit your max speed. You'll have to try it out to find out for sure.

It WOULD be nice if Valve would give us to tools to do more interesting things with map making. Maybe we should create an entity "wish list" to get some thoughts together to send to Valve.
 

DrHaphazard

L5: Dapper Member
Jan 6, 2008
249
12
Right, I wouldnt want to speed people faster than they would normally be, I think the Attack/Defend flag playstyle (and the Territory Control playstyle) slow your char to about 50-75% of their normal runspeed. I would just want to use the vphysics to speed the chars back up to 100%.

I dunno how I am gonna find out exactly how much theyre being slowed though =/

Plus now that I think about it, this map would probably just be a scout fest if I didnt slow them down in any way...Hmmmmm....
 

bipseh

L1: Registered
Mar 13, 2008
2
0
Sorry to bump such an old thread but I've exactly followed richard_cabeza's post but when I go ingame, all flags have disappeared as well as flag indicator in the bottom of the screen...

When I delete logic_relay, flags are still gone...

Flags come back only when I've deleted logic_relay and point_template...

Any suggestion please? :/
 

bipseh

L1: Registered
Mar 13, 2008
2
0
Nevermind, I forgot to tick "Don't remove template entities" in flag tab

But the problem now is that when I drop the flag, after the delay (10s in my case), the flag returns to its spawn point...as if I dropped the flag there...meaning it doesn't respawn and still has the arrow sign in the flag info screen (bottom of screen) and not the house sign...

edit : oops sorry saw the edit button a bit too late :/
 
Last edited: