Raised This Month: $51 Target: $400
 12% 

[TF2] Get which team can cap and set capture point owner.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ClassicGuzzi
Veteran Member
Join Date: Oct 2013
Location: Argentina
Old 12-06-2014 , 13:01   [TF2] Get which team can cap and set capture point owner.
Reply With Quote #1

I'm making a simple plugin to fix something about orange maps that bugs me: in any 5CP map, at the start of the round red team owns point 1 and 2, and blue team, 4 and 5, so when the round starts everybody goes to the middle point. But there are some maps that don't start with the points 2 and 4 captured.

Thanks to a powerlord snippet, I know how to get if a map is a 5CP type, but I have two main problems:
I don't know who to get if a team can cap a point, for example, in my example, team red at the start can capture point 2 and blue, 4, and neither team can capture the middle point.
I wanted to get which team can cap so I don't make something weird and hard-coded depending on the points name.

The only near about this that I found was two key values here as team_cancap_ (2 and 3) but I'm not sure how to access this team_cancap_3 or team_cancap_2.

Even without that I tried to make a simple version hardcoded without getting which team could cap, and I can't get SetOwner/SetTeam to work for team_control_point/trigger_capture_area. Also I don't think that team_control_point_master can help neither.

If anyone knows something that could help me it would be great
ClassicGuzzi is offline
Inhib
Member
Join Date: Oct 2014
Old 12-10-2014 , 05:33   Re: [TF2] Get which team can cap and set capture point owner.
Reply With Quote #2

I can't test anything at this point but I think this would point you in the right direction. From what I know, all control points are entities in the hammer editor, and I'm assuming they are entities in tf2 as well, using this, you could run GetEntPropInt or something to check the properties of the control point for something similar. Afterwards, use SetEntPropInt to set the control point owner, or something else, depending on variable type.
Inhib is offline
Inhib
Member
Join Date: Oct 2014
Old 12-10-2014 , 05:36   Re: [TF2] Get which team can cap and set capture point owner.
Reply With Quote #3

https://developer.valvesoftware.com/..._control_point
Inhib is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 12-10-2014 , 09:30   Re: [TF2] Get which team can cap and set capture point owner.
Reply With Quote #4

...and don't forget that control points have an associated trigger_capture_area.

Quote:
Originally Posted by ClassicGuzzi View Post
Thanks to a powerlord snippet, I know how to get if a map is a 5CP type, but I have two main problems:
Speaking of which, I need to update that as I thought of a better way to detect TC maps.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 12-10-2014 at 09:31.
Powerlord is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 12-10-2014 , 10:27   Re: [TF2] Get which team can cap and set capture point owner.
Reply With Quote #5

Quote:
Originally Posted by Powerlord View Post
...and don't forget that control points have an associated trigger_capture_area.


Speaking of which, I need to update that as I thought of a better way to detect TC maps.
You mean besides the tc_ in the mapname?
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 12-10-2014 , 10:31   Re: [TF2] Get which team can cap and set capture point owner.
Reply With Quote #6

Quote:
Originally Posted by friagram View Post
You mean besides the tc_ in the mapname?
The game doesn't use the map's filename to determine the map type. Since that's the case, any detection method shouldn't either.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Inhib
Member
Join Date: Oct 2014
Old 12-10-2014 , 17:24   Re: [TF2] Get which team can cap and set capture point owner.
Reply With Quote #7

Quote:
Originally Posted by Powerlord View Post
The game doesn't use the map's filename to determine the map type. Since that's the case, any detection method shouldn't either.
You can check for 6 control point entities
Inhib is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 12-10-2014 , 17:41   Re: [TF2] Get which team can cap and set capture point owner.
Reply With Quote #8

Quote:
Originally Posted by Inhib View Post
You can check for 6 control point entities
cp_dustbowl is a TC map?

Which brings up two points:
  • Not all 6 CP maps are Territorial Control.
  • Not all Territorial Control maps have 6 team_control_point entities.

No, the proper way to detect a TC map is to see if the team_control_point_round count is > team_control_point count / 2. The reason this works is because TC shares points between rounds.

Now, this still might not properly detect tc_meridian because it's technically a multi-round CTF map...

My other thought was to check the map's resource/roundinfo/<mapname>.res file, but that can be packed inside the BSP (and invisible to SourceMod)... and there's nothing saying that other maps can't have their own copy of this to show stuff other than the TC overlay map (koth_lolcano does this iirc).
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 12-10-2014 at 17:43.
Powerlord is offline
ClassicGuzzi
Veteran Member
Join Date: Oct 2013
Location: Argentina
Old 12-10-2014 , 20:20   Re: [TF2] Get which team can cap and set capture point owner.
Reply With Quote #9

Thanks Inhim and powerlord but SetOwner/SetTeam won't work for team_control_point/trigger_capture_area for me at last.

Also, since you're in that topic, I have a orange map called cp_orange_x3_8cp or something like that, that work exactly as a 5cp map, and I also have many 3cp points that are symmetric too, don't forget about them!
ClassicGuzzi is offline
Inhib
Member
Join Date: Oct 2014
Old 12-11-2014 , 03:10   Re: [TF2] Get which team can cap and set capture point owner.
Reply With Quote #10

Try
PHP Code:
SetEntProp(entityProp_Sendm_iOwnerownerteamindex
Not sure if Prop_Send or Prop_Data, try both, would appreciate it if someone could tell me the difference between the two as well.
Ownerteamindex is 2 or 3 depending on blue or red, not sure which is which.
Inhib is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:28.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode