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

Check if a cap is locked/unlocked


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 01-08-2014 , 21:23   Check if a cap is locked/unlocked
Reply With Quote #1

I'm not sure how, there's an INPUT that lets you set its lock/unlock status, but is there a way to get this information?
__________________
Chdata is offline
MasterOfTheXP
Veteran Member
Join Date: Aug 2011
Location: Cloudbank
Old 01-08-2014 , 22:35   Re: Check if a cap is locked/unlocked
Reply With Quote #2

GetEntProp(entityIndex, Prop_Data, "m_bLocked") should work.
__________________
Plugins / My Steam / TF2 Sandbox (plugin beta testing!)
MasterOfTheXP is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 01-08-2014 , 22:50   Re: Check if a cap is locked/unlocked
Reply With Quote #3

Quote:
Originally Posted by MasterOfTheXP View Post
GetEntProp(entityIndex, Prop_Data, "m_bLocked") should work.
You'd think that'd work, but sadly that's only the value from Hammer's "Start locked" field and doesn't change during gameplay.

I'm pretty sure the only way to find out a control points lock state is to manually track the control points from the start of the round.

That means checking their m_bLocked and hooking their OnUnlocked output and other fun stuff (such as figuring out how to track when they lock again)

I do wonder if there's somewhere in the game's code where you can find that out, though...
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 01-08-2014 at 22:50.
Powerlord is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 01-09-2014 , 13:30   Re: Check if a cap is locked/unlocked
Reply With Quote #4

I ended up making a native in VSH that reports what the cap was force set to via SetControlPoint.

As for use outside of VSH, well, the only sensible use of what I made would be for arena I guess.
__________________
Chdata is offline
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 01-09-2014 , 19:07   Re: Check if a cap is locked/unlocked
Reply With Quote #5

Quote:
Originally Posted by Powerlord View Post
You'd think that'd work, but sadly that's only the value from Hammer's "Start locked" field and doesn't change during gameplay.

I'm pretty sure the only way to find out a control points lock state is to manually track the control points from the start of the round.

That means checking their m_bLocked and hooking their OnUnlocked output and other fun stuff (such as figuring out how to track when they lock again)

I do wonder if there's somewhere in the game's code where you can find that out, though...
This should work:
http://i.imgur.com/bebc3IQ.png

So there is probably a simple netprop like teamnum or owner which is being returned.

Or maybe try this:
Code:
CBaseTeamObjectiveResource::GetOwningTeam(int)
_ZN26CBaseTeamObjectiveResource13GetOwningTeamEi
__________________
Santa or Satan?

Watch out when you're paying people for private requests! Most stuff already exists and you can hardly assess the quality of what you'll get, and if it's worth the money.
Dr. Greg House is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 01-10-2014 , 10:40   Re: Check if a cap is locked/unlocked
Reply With Quote #6

I don't think get owner would make sense because it's either Uncaptured, RED, or BLU... unless when it's locked it's something other than "Uncaptured" at least for arena mode.
__________________
Chdata is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 01-10-2014 , 10:46   Re: Check if a cap is locked/unlocked
Reply With Quote #7

What exactly are you trying to do?
Because it's easier if it's koth or arena to just always enable them by cvar or with inputs/stripper, and then disable them if you don't need them, or if need be, hooktouch the capture area to disable for specific players.
__________________
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 01-10-2014 , 10:53   Re: Check if a cap is locked/unlocked
Reply With Quote #8

Not sure what Chdata was doing, but I was trying to determine the currently active control point(s) to spawn bosses on them.

Actually, I'm tempted to just check a decompile of cp_manor_event and see what it does.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 01-10-2014 , 11:28   Re: Check if a cap is locked/unlocked
Reply With Quote #9

Quote:
Originally Posted by Chdata View Post
I don't think get owner would make sense because it's either Uncaptured, RED, or BLU... unless when it's locked it's something other than "Uncaptured" at least for arena mode.
Yeah sorry, for some reason I completely misunderstood.

EDIT:
I checked again and looked around. My guess would be that they switch between different think-functions instead of having one which determines/polls the state.

EDIT2:
OR that the mastercp entity has the information.
__________________
Santa or Satan?

Watch out when you're paying people for private requests! Most stuff already exists and you can hardly assess the quality of what you'll get, and if it's worth the money.

Last edited by Dr. Greg House; 01-10-2014 at 11:40.
Dr. Greg House 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 09:53.


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