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

TF2 - in CTF how do I determine which item_teamflag is which?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
octo-dhd
Member
Join Date: Jan 2008
Location: Southern California
Old 05-18-2008 , 22:24   TF2 - in CTF how do I determine which item_teamflag is which?
Reply With Quote #1

I am new to this, so maybe I'm missing something obvious.

So far I am able to look find the entity number (is this the right term?) using both a method like:


// do it either this way
for(new i = GetMaxClients()+1; i <= GetMaxEntities(); i++)
{
if(IsValidEdict(i))
{
decl String:cls[64];
GetEdictClassname(i, cls, sizeof(cls));
if(StrEqual(cls, "item_teamflag"))
{
PrintToConsole(0,"FOUND: %d %s",i,cls);
}
}
}


and by using a recursive FindEntityByClassname

theflag = FindEntityByClassname(-1, "item_teamflag");


I did it both ways to make sure my results were acting right.

I have been able to trigger commands from the item_teamflag outputs (OnReturn) but I have not been able to find a Property that tells me the team the flag belongs to.

According to http://developer.valvesoftware.com/wiki/Item_teamflag I only see Keywords, but I found a post somewhere saying that Keywords could not be looked up, that they could only be set. In Hammer it shows "Team" under properties, but all my attempts at looking that up have been met with errors.

My goal is to reliably know when a flag returned back to its start position. There are a few ways of doing this, one is figuring out which team the flag is for, and me using the OnReturn output. The other one that I thought of was if I could find the actual return time for the flag (and the team) I could just do it with timers based off of the built in pickup/drop/defend/captured events (I wish they'd just put returned in here). I did see a reference to "m_nReturnTime" somewhere but I was unable to figure out how to get that also :-/

Any help would be greatly appreciated
octo-dhd is offline
pRED*
Join Date: Dec 2006
Old 05-18-2008 , 22:36   Re: TF2 - in CTF how do I determine which item_teamflag is which?
Reply With Quote #2

http://wiki.alliedmods.net/Category:Game_Resources

Check 'classnames' list

CCaptureFlag - item_teamflag


Check 'Entity Properties' list.

Big section of names you can use with the Entity Property functions from entity.inc (Theres a wiki article)

m_iTeamNum?
pRED* is offline
octo-dhd
Member
Join Date: Jan 2008
Location: Southern California
Old 05-18-2008 , 23:30   Re: TF2 - in CTF how do I determine which item_teamflag is which?
Reply With Quote #3

Thank you very much - I spent hours reading and reading and just was completely missing it. Your suggestion works great.
octo-dhd 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 13:30.


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