tf_gamerules how do I add points to team score?

TheMightyGerbil

L2: Junior Member
Dec 23, 2012
79
21
Hello I joined this forum years ago, mapped for years alone but didn't post. Today I hit my limit break after 6+ hours of trying to get something super simple to work.

I want to score points manually.
tf_gamerules has AddRedTeamScore and AddBlueTeamScore inputs.
I've tried firing them from triggers, item_teamflags, and through logic_relays.
I've tried a parameter override of 1 , 2 , 3 , "1", +1 and I've tried leaving it blank.

All the entities show connected correctly.

Nothing happens. There are only 3 dialog boxes and no flags I can see that need setting. Why does this not work?

If I deliberately mess the parameter override or do it without the logic_relay it will give me...

!! ERROR: bad input/output link:
!! tf_gamerules(tf_gamerules,AddRedTeamScore) doesn't match type from logic_relay

...but that only shows the output is reaching tf_gamerules that error won't show if I use what I think is correct, a 1 and a logic_relay.

...and yes I've googled until I'm blue.

To any replies I have to go for a bit and will probably reply tomorrow. Thank you for any help.
 
Last edited:

TheMightyGerbil

L2: Junior Member
Dec 23, 2012
79
21
Here is a simple .vmf example right click and save, it's super small, I also uploaded it below. When you break a brush a team should get a point in the example. There should be a way to bind scoring points to any entity's output, which is what I want to do, not specifically the breaking brush example. tf_gamerules seems to be that way when it has AddRedTeamScore and AddBlueTeamScore inputs but it doesn't work. I'm guessing I'm either overthinking it and missing some simple mistake I made or those inputs are broke. I haven't mapped for a while so maybe there is some other entity I needed to add, IDK, but then I've never tried to manually score things. Thanks.
 

Attachments

  • as_reference_6.vmf
    54.1 KB · Views: 105
Last edited:

Egan

aa
Feb 14, 2010
1,375
1,720
AddRedTeamScore <integer> Add to the RED team score (can be a negative number)
AddBlueTeamScore <integer> Add to the BLU team score (can be a negative number)

These commands will only affect the score on the scoreboard when a player brings it up with the TAB key:
SV9gljZl.jpg



But not any other sort of score mechanism like the CTF HUD (which I assume you are trying to change):
GbTgkLRl.jpg



The only way to affect the CTF HUD scores is to have a player carry an item_teamflag into a func_capturezone. Video.

Alternatively try to find another HUD mechanism to use, like the PD HUD or using game_text entities.
 

TheMightyGerbil

L2: Junior Member
Dec 23, 2012
79
21
These commands will only affect the score on the scoreboard when a player brings it up with the TAB key:
SV9gljZl.jpg



But not any other sort of score mechanism like the CTF HUD (which I assume you are trying to change):
GbTgkLRl.jpg



The only way to affect the CTF HUD scores is to have a player carry an item_teamflag into a func_capturezone. Video.

Alternatively try to find another HUD mechanism to use, like the PD HUD or using game_text entities.

Bummer :( . I don't get why Valve didn't put in a simple mechanism for this as it could be used to create a lot of game modes. I mean what is the point of altering it on the scoreboard if it functionally does nothing. I'm probably going to have to go back to figuring out how to do in a source mod plugin. I had it half way but hoped this would be a simpler method.

I've got a backlog of questions I'll probably be asking now I've posted but I'll save those for later. Thanks for your time and answers.
 

killohurtz

Distinction in Applied Carving
aa
Feb 22, 2014
1,016
1,277
If I'm understanding your problem right, you could easily accomplish this score counting with Player Destruction entities instead of the scoreboard (which is more typically used to count rounds won rather than scores within a round). All you'd have to do is configure the collectible flags to not drop and send inputs to increment the score directly instead of through flag captures. I can explain in more detail if this sounds like the solution you're looking for.
 

TheMightyGerbil

L2: Junior Member
Dec 23, 2012
79
21
If I'm understanding your problem right, you could easily accomplish this score counting with Player Destruction entities instead of the scoreboard (which is more typically used to count rounds won rather than scores within a round). All you'd have to do is configure the collectible flags to not drop and send inputs to increment the score directly instead of through flag captures. I can explain in more detail if this sounds like the solution you're looking for.

Hmmm I downloaded the pd_prefab just now, played with it, and got it to score via breaking a brush. I'm not certain this will work or not but it's something, thanks. I'm going to have to mess with it more.

Does replacing the .res file in tf_logic_player_destruction actually work and allow your clients to have your custom hud? I ask because I've never done it but have had problems with getting custom CTF models to work (a question for another time).

Also I was thinking is there a server command to give a team a point directly that way? If so there was an entity for sending these commands in a map but I can't remember the name. What was it?
 

killohurtz

Distinction in Applied Carving
aa
Feb 22, 2014
1,016
1,277
Does replacing the .res file in tf_logic_player_destruction actually work and allow your clients to have your custom hud? I ask because I've never done it but have had problems with getting custom CTF models to work (a question for another time).

Yes, replacing the .res file does work, but you'll want to use HudObjectivePlayerDestruction as the base no matter what because the PD entities are made to work with it. You can edit it pretty extensively like Egan did for Watergate, though.

Also I was thinking is there a server command to give a team a point directly that way? If so there was an entity for sending these commands in a map but I can't remember the name. What was it?

You're thinking of point_servercommand. If such a convar exists (which I'm not sure it does) you can technically use this method. But since TF2 now has a convar for point_servercommands that disables them by default, you may run into problems running your map on servers that have this convar set. I would suggest avoiding the use of a point_servercommand if you can.

If you decide to go through with the PD entities down the road, ping me and I can walk you through the little tweaks you need to make to turn it into a generic scoring system.