New overhauled bot interface for latest version of Omni-bot

added new lua function call for input/output events that it is unable to match a target to
added a SpawnBot function to CFFInfoScript objects so they can spawn bots on themselves.
added IsBot function to player script bindings
added OwnsWeaponType to player script bindings
added RemoveAllAmmo to player script bindings
fixed GiveWeapon and RemoveAllWeapons to not take useless parameters that aren't relevant to scripters
added m_SpawnPointOverride to player class to allow a player to be assigned a specific persistant spawn point
changed lua console messages to warnings so they show in red to better reflect errors and not get so lost in the rest of the console spam
This commit is contained in:
drevil 2007-07-31 02:02:55 +00:00
parent 2d7d562e5e
commit 784d147c8e
63 changed files with 6604 additions and 4659 deletions

File diff suppressed because it is too large Load diff

View file

@ -87,6 +87,8 @@ OUTPUTS:
#include "tier0/vprof.h"
#include "ff_luacontext.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
@ -897,6 +899,16 @@ void CEventQueue::ServiceEvents( void )
if ( !targetFound )
{
//////////////////////////////////////////////////////////////////////////
if ( pe->m_iTarget != NULL_STRING )
{
CFFLuaSC sc;
sc.Push(pe->m_pActivator);
sc.Push(pe->m_pCaller);
sc.CallFunction(NULL, STRING(pe->m_iTargetInput), STRING(pe->m_iTarget));
}
//////////////////////////////////////////////////////////////////////////
const char *pClass ="", *pName = "";
// might be NULL

View file

@ -777,7 +777,7 @@ int CFFBuildableObject::OnTakeDamage( const CTakeDamageInfo &info )
CFFPlayer *pOwner = static_cast< CFFPlayer * >( m_hOwner.Get() );
if( pOwner && pOwner->IsBot() )
{
Omnibot::Notify_BuildableDamaged( pOwner, Classify(), edict() );
Omnibot::Notify_BuildableDamaged( pOwner, Classify(), this );
SendStatsToBot();
}

View file

@ -498,31 +498,6 @@ void CFFDispenser::UpdateAmmoPercentage( void )
m_iAmmoPercent = ( ( flAmmo / flMaxAmmo ) * 100 );
}
void CFFDispenser::SendStatsToBot()
{
VPROF_BUDGET( "CFFDispenser::SendStatsToBot", VPROF_BUDGETGROUP_FF_BUILDABLE );
CFFPlayer *pOwner = static_cast<CFFPlayer*>(m_hOwner.Get());
if(pOwner && pOwner->IsBot())
{
Omnibot::BotUserData bud;
bud.DataType = Omnibot::BotUserData::dt6_2byteFlags;
bud.udata.m_2ByteFlags[0] = m_iHealth;
bud.udata.m_2ByteFlags[1] = m_iShells;
bud.udata.m_2ByteFlags[2] = m_iNails;
bud.udata.m_2ByteFlags[3] = m_iRockets;
bud.udata.m_2ByteFlags[4] = m_iCells;
bud.udata.m_2ByteFlags[5] = m_iArmor;
// TODO: Add in radio tag?
int iGameId = pOwner->entindex()-1;
Omnibot::omnibot_interface::Bot_Interface_SendEvent(
Omnibot::TF_MSG_DISPENSER_STATS,
iGameId, 0, 0, &bud);
}
}
//-----------------------------------------------------------------------------
// Purpose: If already sabotaged then don't try and sabotage again
//-----------------------------------------------------------------------------

View file

@ -118,6 +118,10 @@ CFFInfoScript::CFFInfoScript( void )
m_iPosState = PS_RETURNED;
m_allowTouchFlags = 0;
// bot info
m_BotTeamFlags = 0;
m_BotGoalType = Omnibot::kNone;
}
//-----------------------------------------------------------------------------
@ -937,16 +941,22 @@ void CFFInfoScript::RemoveThink( void )
//-----------------------------------------------------------------------------
void CFFInfoScript::SetBotGoalInfo(int _type)
{
int iTeamFlags = 0;
m_BotGoalType = _type;
m_BotTeamFlags = 0;
if(m_allowTouchFlags & kAllowBlueTeam)
iTeamFlags |= (1<<Omnibot::TF_TEAM_BLUE);
m_BotTeamFlags |= (1<<Omnibot::TF_TEAM_BLUE);
if(m_allowTouchFlags & kAllowRedTeam)
iTeamFlags |= (1<<Omnibot::TF_TEAM_RED);
m_BotTeamFlags |= (1<<Omnibot::TF_TEAM_RED);
if(m_allowTouchFlags & kAllowYellowTeam)
iTeamFlags |= (1<<Omnibot::TF_TEAM_YELLOW);
m_BotTeamFlags |= (1<<Omnibot::TF_TEAM_YELLOW);
if(m_allowTouchFlags & kAllowGreenTeam)
iTeamFlags |= (1<<Omnibot::TF_TEAM_GREEN);
Omnibot::Notify_GoalInfo(this, _type, iTeamFlags);
m_BotTeamFlags |= (1<<Omnibot::TF_TEAM_GREEN);
Omnibot::Notify_GoalInfo(this, m_BotGoalType, m_BotTeamFlags);
}
void CFFInfoScript::SpawnBot(const char *_name, int _team, int _class)
{
Omnibot::SpawnBotAsync(_name, _team, _class, this);
}
//-----------------------------------------------------------------------------

View file

@ -131,6 +131,7 @@ public:
virtual Class_T Classify( void ) { return CLASS_INFOSCRIPT; }
void SetBotGoalInfo(int _type);
void SpawnBot(const char *_name, int _team, int _class);
// returns the criteria necessary for another entity to "touch" this entity
int GetTouchFlags( void ) const { return m_allowTouchFlags; }
@ -143,6 +144,9 @@ public:
virtual void ResolveFlyCollisionCustom( trace_t &trace, Vector &vecVelocity );
// bot info accessors
int GetBotTeamFlags() const { return m_BotTeamFlags; }
int GetBotGoalType() const { return m_BotGoalType; }
protected:
// Do not expose these to LUA!
virtual void SetActive( void );
@ -190,6 +194,10 @@ protected:
// indicates some criteria limiting what will
// be allowed to "touch" this entity
int m_allowTouchFlags;
// cached information for bot use
int m_BotTeamFlags;
int m_BotGoalType;
};
/////////////////////////////////////////////////////////////////////////////

View file

@ -136,7 +136,7 @@ void CFFLuaSC::Push(CTakeDamageInfo* pInfo) { m_params.AddToTail(SETOBJECT(pInfo
void CFFLuaSC::PushRef(CTakeDamageInfo& info) { m_params.AddToTail(SETOBJECTREF(info)); }
//---------------------------------------------------------------------------
bool CFFLuaSC::CallFunction(CBaseEntity* pEntity, const char* szFunctionName)
bool CFFLuaSC::CallFunction(CBaseEntity* pEntity, const char* szFunctionName, const char *szTargetEntName)
{
VPROF_BUDGET( "CFFLuaSC::CallFunction", VPROF_BUDGETGROUP_FF_LUA );
@ -152,7 +152,10 @@ bool CFFLuaSC::CallFunction(CBaseEntity* pEntity, const char* szFunctionName)
luabind::object globals = luabind::globals(L);
try
{
globals["entity"] = luabind::object(L, pEntity);
if(pEntity)
globals["entity"] = luabind::object(L, pEntity);
else
globals["entity"] = luabind::adl::object();
}
catch(...)
{
@ -201,6 +204,34 @@ bool CFFLuaSC::CallFunction(CBaseEntity* pEntity, const char* szFunctionName)
STRING(pEntity->GetEntityName()),
szFunctionName);
}
else if(szTargetEntName)
{
luabind::adl::object func;
luabind::adl::object tableObject;
if(_scriptman.GetObject(szTargetEntName, tableObject) &&
_scriptman.GetFunction(tableObject, szFunctionName, func))
{
// push the function onto stack ( entname:addname )
lua_getglobal( L, szTargetEntName );
if (lua_isnil(L, -1))
{
lua_pop(L, 1);
return false;
}
lua_pushstring(L, szFunctionName);
lua_gettable(L, -2);
lua_insert(L, -2);
// store the name of the entity and function for debugging purposes
Q_snprintf(m_szFunction,
sizeof(m_szFunction),
"%s:%s()",
szTargetEntName,
szFunctionName);
}
else
return false;
}
else
{
// get the function
@ -221,7 +252,7 @@ bool CFFLuaSC::CallFunction(CBaseEntity* pEntity, const char* szFunctionName)
(*m_params[iParam]).push(L);
// call out to the script
if(lua_pcall(L, pEntity ? nParams + 1 : nParams, 1, 0) != 0)
if(lua_pcall(L, pEntity||szTargetEntName ? nParams + 1 : nParams, 1, 0) != 0)
{
const char* szErrorMsg = lua_tostring(L, -1);
Msg("[SCRIPT] Error calling %s (%s) ent: %s\n",

View file

@ -81,7 +81,7 @@ public:
// calls out to a script function. if pEntity is NULL, the szFunctionName
// will be interpreted as a global function. returns true if the
// script call was successful; otherwise, it returns false
bool CallFunction(CBaseEntity* pEntity, const char* szFunctionName);
bool CallFunction(CBaseEntity* pEntity, const char* szFunctionName, const char *szTargetEntName = 0);
// calls a global function
bool CallFunction(const char* szFunctionName);

View file

@ -100,6 +100,7 @@ void CFFLuaLib::InitBase(lua_State* L)
.def("GetAngles", &CFFInfoScript::LUA_GetAngles)
.def("SetAngles", &CFFInfoScript::LUA_SetAngles)
.def("SetBotGoalInfo", &CFFInfoScript::SetBotGoalInfo)
.def("SpawnBot", &CFFInfoScript::SpawnBot)
.def("SetModel", &CFFInfoScript::LUA_SetModel) // Leave this!
.def("SetStartOrigin", &CFFInfoScript::LUA_SetStartOrigin)
.def("SetStartAngles", &CFFInfoScript::LUA_SetStartAngles)

View file

@ -51,7 +51,8 @@ void CFFLuaLib::InitOmnibot(lua_State* L)
value("kBackPack_Health", Omnibot::kBackPack_Health),
value("kBackPack_Grenades", Omnibot::kBackPack_Grenades),
value("kFlag", Omnibot::kFlag),
value("kFlagCap", Omnibot::kFlagCap)
value("kFlagCap", Omnibot::kFlagCap),
value("kTrainerSpawn", Omnibot::kTrainerSpawn)
]
];
};

View file

@ -71,8 +71,11 @@ void CFFLuaLib::InitPlayer(lua_State* L)
.def("IsOnGround", &CFFPlayer::IsOnGround)
.def("IsInAir", &CFFPlayer::IsInAir)
.def("IsDucking", &CFFPlayer::IsDucking)
.def("IsBot", &CFFPlayer::IsBot)
.def("MarkRadioTag", &CFFPlayer::SetRadioTagged)
//.def("RemoveAmmo", (void(CFFPlayer::*)(int, const char*))&CFFPlayer::RemoveAmmo)
.def("OwnsWeaponType", &CFFPlayer::LuaOwnsWeaponType)
.def("RemoveAllAmmo", &CFFPlayer::LuaRemoveAllAmmo)
.def("RemoveAmmo", &CFFPlayer::LuaRemoveAmmo)
.def("RemoveArmor", &CFFPlayer::RemoveArmor)
.def("RemoveLocation", &CFFPlayer::RemoveLocation)
@ -87,9 +90,9 @@ void CFFLuaLib::InitPlayer(lua_State* L)
.def("SetRespawnDelay", &CFFPlayer::LUA_SetPlayerRespawnDelay)
//.def("InstaSwitch", &CFFPlayer::InstaSwitch) -- doing this as part of ApplyToPlayer()
.def("GetActiveWeaponName", &CFFPlayer::GetActiveWeaponName)
.def("GiveWeapon", &CFFPlayer::GiveNamedItem)
.def("GiveWeapon", &CFFPlayer::LuaGiveWeapon)
.def("RemoveWeapon", &CFFPlayer::TakeNamedItem)
.def("RemoveAllWeapons", &CFFPlayer::RemoveAllItems)
.def("RemoveAllWeapons", &CFFPlayer::LuaRemoveAllWeapons)
.def("IsFeigned", &CFFPlayer::IsCloaked) // need to remove this one eventually!
.def("IsCloaked", &CFFPlayer::IsCloaked)
.def("IsDisguised", &CFFPlayer::IsDisguised)

View file

@ -487,6 +487,7 @@ CFFPlayer::CFFPlayer()
m_fl_LuaSet_PlayerRespawnDelay = 0.0f;
m_SpawnPointOverride = 0;
#endif // FF_BETA_TEST_COMPILE
}
@ -910,6 +911,12 @@ ReturnSpot:
Warning( "[EntSelectSpawnPoint] Looking for a spawn point!\n" );
#endif
//////////////////////////////////////////////////////////////////////////
// Shortcut for spawning bots where we want them.
if(m_SpawnPointOverride)
return m_SpawnPointOverride;
//////////////////////////////////////////////////////////////////////////
CBaseEntity *pSpot = NULL, *pGibSpot = NULL;
// I think this was one of the main sources of the not-so-randomness - Jon
@ -2727,7 +2734,7 @@ void CFFPlayer::FindRadioTaggedPlayers( void )
// Omni-bot: Notify the bot he has detected someone.
if(IsBot())
{
Omnibot::Notify_RadioTagUpdate(this, pPlayer->edict());
Omnibot::Notify_RadioTagUpdate(this, pPlayer);
}
}
}
@ -2862,7 +2869,7 @@ void CFFPlayer::Command_Radar( void )
// Omni-bot: Notify the bot he has detected someone.
if(IsBot())
{
Omnibot::Notify_RadarDetectedEnemy(this, pPlayer->edict());
Omnibot::Notify_RadarDetectedEnemy(this, pPlayer);
}
}
}
@ -3118,7 +3125,7 @@ void CFFPlayer::PreBuildGenericThink( void )
if(IsBot())
{
Omnibot::Notify_DispenserBuilding(this, pDispenser->edict());
Omnibot::Notify_DispenserBuilding(this, pDispenser);
}
}
break;
@ -3163,7 +3170,7 @@ void CFFPlayer::PreBuildGenericThink( void )
if(IsBot())
{
Omnibot::Notify_SentryBuilding(this, pSentryGun->edict());
Omnibot::Notify_SentryBuilding(this, pSentryGun);
}
}
break;
@ -3188,7 +3195,7 @@ void CFFPlayer::PreBuildGenericThink( void )
if(IsBot())
{
Omnibot::Notify_DetpackBuilding(this, pDetpack->edict());
Omnibot::Notify_DetpackBuilding(this, pDetpack);
}
}
break;
@ -3222,6 +3229,11 @@ void CFFPlayer::PreBuildGenericThink( void )
{
// DevMsg( "[Building] You're currently building this item so cancel the build.\n" );
if(IsBot())
{
Omnibot::Notify_Build_BuildCancelled(this,m_iCurBuild);
}
CFFBuildableObject *pBuildable = GetBuildable( m_iCurBuild );
if( pBuildable )
pBuildable->Cancel();
@ -4802,7 +4814,12 @@ void CFFPlayer::ThrowGrenade(float fTimer, float flSpeed)
#ifdef GAME_DLL
{
if(IsBot())
Omnibot::Notify_PlayerShootProjectile(this, pGrenade->edict());
{
if(m_iGrenadeState == FF_GREN_PRIMEONE)
Omnibot::Notify_PlayerShoot(this, Omnibot::TF_WP_GRENADE1, pGrenade);
else if(m_iGrenadeState == FF_GREN_PRIMETWO)
Omnibot::Notify_PlayerShoot(this, Omnibot::TF_WP_GRENADE2, pGrenade);
}
}
#endif
}
@ -6029,6 +6046,53 @@ void CFFPlayer::LuaRemoveAmmo( int iAmmoType, int iAmount )
AddSecondaryGrenades( -iAmount );
break;
}
/*useful here too?
if(bClipToo)
{
for (int i = 0; i < MAX_WEAPONS; i++)
{
if(m_hMyWeapons[i] && m_hMyWeapons[i]->m_iClip1 != -1)
m_hMyWeapons[i]->m_iClip1 = 0;
if(m_hMyWeapons[i] && m_hMyWeapons[i]->m_iClip2 != -1)
m_hMyWeapons[i]->m_iClip2 = 0;
}
SwitchToNextBestWeapon(GetActiveWeapon());
}*/
}
void CFFPlayer::LuaRemoveAllAmmo(bool bClipToo)
{
BaseClass::RemoveAllAmmo();
AddSecondaryGrenades(-4);
AddPrimaryGrenades(-4);
if(bClipToo)
{
for (int i = 0; i < MAX_WEAPONS; i++)
{
if(m_hMyWeapons[i] && m_hMyWeapons[i]->m_iClip1 != -1)
m_hMyWeapons[i]->m_iClip1 = 0;
if(m_hMyWeapons[i] && m_hMyWeapons[i]->m_iClip2 != -1)
m_hMyWeapons[i]->m_iClip2 = 0;
}
SwitchToNextBestWeapon(GetActiveWeapon());
}
}
bool CFFPlayer::LuaOwnsWeaponType(const char *_name)
{
return Weapon_OwnsThisType(_name, 0) != NULL;
}
bool CFFPlayer::LuaGiveWeapon(const char *_name)
{
return GiveNamedItem(_name, 0) != NULL;
}
void CFFPlayer::LuaRemoveAllWeapons()
{
RemoveAllItems(false);
}
//-----------------------------------------------------------------------------

View file

@ -487,7 +487,7 @@ public:
void Infect( CFFPlayer *pPlayer );
void Cure( CFFPlayer *pPlayer );
void ApplyBurning( CFFPlayer *hIgniter, float scale = 1.0f, float flIconDuration = 10.0f, eBurnType BurnType = BURNTYPE_NONE);
bool IsBurning( void ) const;
bool IsBurning( void ) const { return m_bBurnFlagNG|m_bBurnFlagFT|m_bBurnFlagIC; }
void Gas( float flDuration, float flIconDuration, CFFPlayer *pGasser);
bool IsGassed( void ) const { return m_bGassed; }
@ -723,6 +723,10 @@ public:
public:
int LuaAddAmmo( int iAmmoType, int iAmount );
void LuaRemoveAmmo( int iAmmoType, int iAmount );
void LuaRemoveAllAmmo(bool bClipToo);
bool LuaOwnsWeaponType(const char *_name);
bool LuaGiveWeapon(const char *_name);
void LuaRemoveAllWeapons();
virtual int GiveAmmo(int iCount, int iAmmoIndex, bool bSuppressSound = false);
int GiveAmmo(int iCount, const char *szName, bool bSuppressSound = false);
@ -867,6 +871,7 @@ public:
int m_iStatCritHeals;
int m_iStatInfectCures;
CBaseEntity *m_SpawnPointOverride;
public:
// Run "effects" and "speed effects" through here first
// before giving the player the actual effect.

View file

@ -64,7 +64,7 @@ bool CFFScriptManager::LoadFile( lua_State *L, const char *filename)
// don't allow scripters to sneak in scripts after the initial load
if(!_scriptman.m_isLoading)
{
Msg("[SCRIPT] Loading of scripts after initial map load is not allowed.\n");
Warning("[SCRIPT] Loading of scripts after initial map load is not allowed.\n");
return false;
}
@ -74,7 +74,7 @@ bool CFFScriptManager::LoadFile( lua_State *L, const char *filename)
if (!hFile)
{
Msg("[SCRIPT] %s either does not exist or could not be opened.\n", filename);
Warning("[SCRIPT] %s either does not exist or could not be opened.\n", filename);
return false;
}
@ -103,11 +103,11 @@ bool CFFScriptManager::LoadFile( lua_State *L, const char *filename)
const char *error = lua_tostring(L, -1);
if (error)
{
Msg("Error loading %s: %s\n", filename, error);
Warning("Error loading %s: %s\n", filename, error);
lua_pop( L, 1 );
}
else
Msg("Unknown Syntax Error loading %s\n", filename);
Warning("Unknown Syntax Error loading %s\n", filename);
}
else
{

View file

@ -1132,10 +1132,10 @@ void CFFSentryGun::SetFocusPoint( Vector &origin )
// NDebugOverlay::Line( EyePosition(), origin, 255, 0, 255, false, 5.0f );
#endif
CFFPlayer *pOwner = static_cast<CFFPlayer *>( m_hOwner.Get() );
CFFPlayer *pOwner = static_cast<CFFPlayer*>(m_hOwner.Get());
if(pOwner && pOwner->IsBot())
{
Omnibot::Notify_SentryAimed(pOwner);
Omnibot::Notify_SentryAimed(pOwner, this, dir);
}
}
@ -1154,31 +1154,6 @@ int CFFSentryGun::TakeEmp( void )
return ammodmg;
}
void CFFSentryGun::SendStatsToBot( void )
{
VPROF_BUDGET( "CFFSentryGun::SendStatsTobot", VPROF_BUDGETGROUP_FF_BUILDABLE );
CFFPlayer *pOwner = static_cast<CFFPlayer *>( m_hOwner.Get() );
if (pOwner && pOwner->IsBot())
{
Omnibot::BotUserData bud;
bud.DataType = Omnibot::BotUserData::dt6_2byteFlags;
bud.udata.m_2ByteFlags[0] = m_iHealth;
bud.udata.m_2ByteFlags[1] = m_iMaxHealth;
bud.udata.m_2ByteFlags[2] = m_iShells;
bud.udata.m_2ByteFlags[3] = m_iMaxShells;
bud.udata.m_2ByteFlags[4] = m_iRockets | (m_iMaxRockets << 16);
bud.udata.m_2ByteFlags[5] = m_iLevel;
int iGameId = pOwner->entindex() -1;
Omnibot::omnibot_interface::Bot_Interface_SendEvent(
Omnibot::TF_MSG_SENTRY_STATS,
iGameId, 0, 0, &bud);
}
}
//-----------------------------------------------------------------------------
// Purpose: If already sabotaged then don't try and sabotage again
//-----------------------------------------------------------------------------

View file

@ -809,6 +809,8 @@ bool CServerGameDLL::LevelInit( const char *pMapName, char const *pMapEntities,
_scheduleman.Init();
_scriptman.LevelInit(pMapName);
Omnibot::omnibot_interface::LevelInit();
// IGameSystem::LevelInitPreEntityAllSystems() is called when the world is precached
// That happens either in LoadGameState() or in MapEntity_ParseAllEntities()
if ( loadGame )

View file

@ -151,7 +151,10 @@ public:
protected:
bool UpdateHealth( int iNewHealth, CBaseEntity *pActivator );
virtual void OnBreak( const Vector &vecVelocity, const AngularImpulse &angVel, CBaseEntity *pBreaker ) {}
virtual void OnBreak( const Vector &vecVelocity, const AngularImpulse &angVel, CBaseEntity *pBreaker )
{
}
protected:

View file

@ -3864,6 +3864,21 @@
<File
RelativePath="..\omnibot\BotExports.h">
</File>
<File
RelativePath="..\omnibot\BotLoadLibrary.cpp">
<FileConfiguration
Name="Release FF|Win32">
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"/>
</FileConfiguration>
<FileConfiguration
Name="Debug FF|Win32">
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"/>
</FileConfiguration>
</File>
<File
RelativePath="..\omnibot\FF_Config.h">
</File>
@ -3871,7 +3886,7 @@
RelativePath="..\omnibot\Functions_Bot.h">
</File>
<File
RelativePath="..\omnibot\Functions_Engine.h">
RelativePath="..\omnibot\IEngineInterface.h">
</File>
<File
RelativePath="..\omnibot\MessageHelper.h">

File diff suppressed because it is too large Load diff

View file

@ -1059,6 +1059,18 @@ void CTriggerMultiple::MultiWaitOver( void )
// ##################################################################################
LINK_ENTITY_TO_CLASS( trigger_ff_script, CFuncFFScript );
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
CFuncFFScript::CFuncFFScript()
{
m_iGoalState = GS_INACTIVE;
// bot info
m_BotTeamFlags = 0;
m_BotGoalType = Omnibot::kNone;
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
@ -1117,7 +1129,8 @@ void CFuncFFScript::Spawn( void )
//-----------------------------------------------------------------------------
void CFuncFFScript::SetBotGoalInfo(int _type, int _team)
{
int iTeamFlags = 0;
m_BotGoalType = _type;
m_BotTeamFlags = 0;
const int iAllTeams =
(1<<Omnibot::TF_TEAM_BLUE)|
(1<<Omnibot::TF_TEAM_RED)|
@ -1126,22 +1139,22 @@ void CFuncFFScript::SetBotGoalInfo(int _type, int _team)
switch(_team)
{
case 0:
iTeamFlags = iAllTeams;
m_BotTeamFlags = iAllTeams;
break;
case TEAM_BLUE:
iTeamFlags = iAllTeams & ~(1<<Omnibot::TF_TEAM_BLUE);
m_BotTeamFlags = iAllTeams & ~(1<<Omnibot::TF_TEAM_BLUE);
break;
case TEAM_RED:
iTeamFlags = iAllTeams & ~(1<<Omnibot::TF_TEAM_RED);
m_BotTeamFlags = iAllTeams & ~(1<<Omnibot::TF_TEAM_RED);
break;
case TEAM_YELLOW:
iTeamFlags = iAllTeams & ~(1<<Omnibot::TF_TEAM_YELLOW);
m_BotTeamFlags = iAllTeams & ~(1<<Omnibot::TF_TEAM_YELLOW);
break;
case TEAM_GREEN:
iTeamFlags = iAllTeams & ~(1<<Omnibot::TF_TEAM_GREEN);
m_BotTeamFlags = iAllTeams & ~(1<<Omnibot::TF_TEAM_GREEN);
break;
}
Omnibot::Notify_GoalInfo(this, _type, iTeamFlags);
Omnibot::Notify_GoalInfo(this, m_BotGoalType, m_BotTeamFlags);
}
// ##################################################################################

View file

@ -161,7 +161,7 @@ class CFuncFFScript : public CTriggerMultiple
enum { GS_INACTIVE = 0, GS_ACTIVE = 1, GS_REMOVED = -1 };
public:
CFuncFFScript( void ) { m_iGoalState = GS_INACTIVE; }
CFuncFFScript() ;
virtual bool IsActive( void ) const { return m_iGoalState == GS_ACTIVE; }
virtual bool IsInactive( void ) const { return m_iGoalState == GS_INACTIVE; }
@ -181,9 +181,16 @@ public:
virtual void SetRemoved( void );
virtual void SetRestored( void );
// bot info accessors
int GetBotTeamFlags() const { return m_BotTeamFlags; }
int GetBotGoalType() const { return m_BotGoalType; }
protected:
int m_iGoalState;
int m_iClipMask;
// cached information for bot use
int m_BotTeamFlags;
int m_BotGoalType;
};
#endif // TRIGGERS_H

View file

@ -18,7 +18,6 @@
#ifdef GAME_DLL
#include "smoke_trail.h"
#include "omnibot_interface.h"
//=============================================================================
// CFFProjectileGrenade tables
@ -282,14 +281,6 @@ CFFProjectileGrenade * CFFProjectileGrenade::CreateGrenade(const CBaseEntity *pS
pGrenade->SetLocalAngularVelocity(RandomAngle(-400, 400));
#ifdef GAME_DLL
{
CBasePlayer *pPlayer = ToBasePlayer(pentOwner);
if(pPlayer->IsBot())
Omnibot::Notify_PlayerShootProjectile(pPlayer, pGrenade->edict());
}
#endif
return pGrenade;
}

View file

@ -20,7 +20,6 @@
#ifdef GAME_DLL
#include "smoke_trail.h"
#include "ff_buildableobjects_shared.h"
#include "omnibot_interface.h"
#include "soundent.h"
#endif
@ -249,14 +248,6 @@ CFFProjectileIncendiaryRocket * CFFProjectileIncendiaryRocket::CreateRocket(cons
pRocket->m_flDamage = iDamage;
pRocket->m_DmgRadius = pRocket->m_flDamage * 2.0f;
#ifdef GAME_DLL
{
CBasePlayer *pPlayer = ToBasePlayer(pentOwner);
if(pPlayer->IsBot())
Omnibot::Notify_PlayerShootProjectile(pPlayer, pRocket->edict());
}
#endif
return pRocket;
}

View file

@ -16,8 +16,7 @@
#ifdef GAME_DLL
#include "ff_utils.h"
#include "soundent.h"
#include "omnibot_interface.h"
#include "soundent.h"
#endif
extern short g_sModelIndexFireball; // (in combatweapon.cpp) holds the index for the fireball
@ -281,13 +280,5 @@ CFFProjectilePipebomb * CFFProjectilePipebomb::CreatePipebomb(const CBaseEntity
pOldestPipe->DetonatePipe();
#endif
#ifdef GAME_DLL
{
CBasePlayer *pPlayer = ToBasePlayer(pentOwner);
if(pPlayer->IsBot())
Omnibot::Notify_PlayerShootProjectile(pPlayer, pPipebomb->edict());
}
#endif
return pPipebomb;
}

View file

@ -119,14 +119,6 @@ CFFProjectileRail *CFFProjectileRail::CreateRail( const CBaseEntity *pSource, co
pRail->m_flDamage = iDamage;
#ifdef GAME_DLL
/*
CBasePlayer *pPlayer = ToBasePlayer(pentOwner);
if(pPlayer && pPlayer->IsBot())
Omnibot::Notify_PlayerShootProjectile(pPlayer, pRail->edict());
*/
#endif
return pRail;
}

View file

@ -18,7 +18,6 @@
#ifdef GAME_DLL
#include "smoke_trail.h"
#include "omnibot_interface.h"
#else
#define RocketTrail C_RocketTrail
#include "c_smoke_trail.h"
@ -163,14 +162,5 @@ CFFProjectileRocket * CFFProjectileRocket::CreateRocket(const CBaseEntity *pSour
//pRocket->EmitSound("rocket.fly");
// this is being swapped over to the client -mirv
#ifdef GAME_DLL
{
// CRASH! CRASH! CRASH! When SG fires a rocket this was crashing
CBasePlayer *pPlayer = ToBasePlayer(pentOwner);
if(pPlayer && pPlayer->IsBot())
Omnibot::Notify_PlayerShootProjectile(pPlayer, pRocket->edict());
}
#endif
return pRocket;
}

View file

@ -21,6 +21,7 @@
#include "ff_utils.h"
#include "soundenvelope.h"
#else
#include "omnibot_interface.h"
#include "ff_player.h"
#endif
@ -333,6 +334,12 @@ void CFFWeaponAssaultCannon::Fire()
pPlayer->FireBullets(info);
#ifdef GAME_DLL
{
if(pPlayer->IsBot())
Omnibot::Notify_PlayerShoot(pPlayer, Omnibot::TF_WP_MINIGUN, 0);
}
#endif
}
void CFFWeaponAssaultCannon::UpdateChargeTime()

View file

@ -20,6 +20,7 @@
#define CFFWeaponAutoRifle C_FFWeaponAutoRifle
#include "c_ff_player.h"
#else
#include "omnibot_interface.h"
#include "ff_player.h"
#include "ff_statslog.h"
#endif
@ -163,4 +164,10 @@ void CFFWeaponAutoRifle::Fire()
pPlayer->FireBullets(info);
#ifdef GAME_DLL
{
if(pPlayer->IsBot())
Omnibot::Notify_PlayerShoot(pPlayer, Omnibot::TF_WP_AUTORIFLE, 0);
}
#endif
}

View file

@ -15,9 +15,10 @@
#include "ff_weapon_basemelee.h"
#ifdef CLIENT_DLL
#include "c_ff_player.h"
#include "c_ff_player.h"
#else
#include "ilagcompensationmanager.h"
#include "omnibot_interface.h"
#include "ilagcompensationmanager.h"
#endif
#define MELEE_HULL_DIM 16
@ -368,4 +369,11 @@ void CFFWeaponMeleeBase::Swing()
#ifdef GAME_DLL
lagcompensation->FinishLagCompensation(pOwner);
#endif
#ifdef GAME_DLL
{
if(pOwner->IsBot())
Omnibot::Notify_PlayerShoot(pOwner, Omnibot::obUtilGetBotWeaponFromGameWeapon(GetWeaponID()), 0);
}
#endif
}

View file

@ -25,6 +25,7 @@
#include "ff_utils.h"
#else
#include "omnibot_interface.h"
#include "ff_player.h"
#include "ff_env_flamejet.h"
@ -258,6 +259,13 @@ void CFFWeaponFlamethrower::Fire()
lagcompensation->FinishLagCompensation(pPlayer);
#endif
#ifdef GAME_DLL
{
if(pPlayer->IsBot())
Omnibot::Notify_PlayerShoot(pPlayer, Omnibot::TF_WP_FLAMETHROWER, 0);
}
#endif
}
//----------------------------------------------------------------------------

View file

@ -21,6 +21,7 @@
#include "c_ff_player.h"
#include "ff_utils.h"
#else
#include "omnibot_interface.h"
#include "ff_player.h"
#endif
@ -105,7 +106,15 @@ void CFFWeaponGrenadeLauncher::Fire()
else if( tr.fraction != 1.0f )
vecSrc += ( vForward * -24.0f );
CFFProjectileGrenade::CreateGrenade(this, vecSrc, angAiming, pPlayer, pWeaponInfo.m_iDamage, pWeaponInfo.m_iSpeed);
CFFProjectileGrenade *pGrenade = CFFProjectileGrenade::CreateGrenade(this, vecSrc, angAiming, pPlayer, pWeaponInfo.m_iDamage, pWeaponInfo.m_iSpeed);
pGrenade;
#ifdef GAME_DLL
{
if(pPlayer->IsBot())
Omnibot::Notify_PlayerShoot(pPlayer, Omnibot::TF_WP_GRENADE_LAUNCHER, pGrenade);
}
#endif
// Synchronise with pipelauncher
Synchronise();

View file

@ -21,6 +21,7 @@
#include "c_ff_player.h"
#include "ff_utils.h"
#else
#include "omnibot_interface.h"
#include "ff_player.h"
#endif
@ -110,7 +111,15 @@ void CFFWeaponIC::Fire()
// 0000936 - added cvar for testing. Keep line below commented out.
//CFFProjectileIncendiaryRocket::CreateRocket(this, vecSrc, angAiming, pPlayer, pWeaponInfo.m_iDamage, pWeaponInfo.m_iSpeed);
CFFProjectileIncendiaryRocket::CreateRocket(this, vecSrc, angAiming, pPlayer, ffdev_ic_damage.GetFloat(), pWeaponInfo.m_iSpeed);
CFFProjectileIncendiaryRocket *pRocket = CFFProjectileIncendiaryRocket::CreateRocket(this, vecSrc, angAiming, pPlayer, ffdev_ic_damage.GetFloat(), pWeaponInfo.m_iSpeed);
pRocket;
#ifdef GAME_DLL
{
if(pPlayer->IsBot())
Omnibot::Notify_PlayerShoot(pPlayer, Omnibot::TF_WP_NAPALMCANNON, pRocket);
}
#endif
// Push player but don't add to upwards force
// 0000936 - reduce the blast push

View file

@ -21,6 +21,7 @@
#define CFFWeaponNailgun C_FFWeaponNailgun
#include "c_ff_player.h"
#else
#include "omnibot_interface.h"
#include "ff_player.h"
#endif
@ -90,5 +91,14 @@ void CFFWeaponNailgun::Fire()
//QAngle angAiming;
//VectorAngles(pPlayer->GetAutoaimVector(0), angAiming);
CFFProjectileNail::CreateNail(this, vecSrc, pPlayer->EyeAngles(), pPlayer, pWeaponInfo.m_iDamage, pWeaponInfo.m_iSpeed);
CFFProjectileNail *pNail = CFFProjectileNail::CreateNail(this, vecSrc, pPlayer->EyeAngles(), pPlayer, pWeaponInfo.m_iDamage, pWeaponInfo.m_iSpeed);
pNail;
#ifdef GAME_DLL
{
if(pPlayer->IsBot())
Omnibot::Notify_PlayerShoot(pPlayer, Omnibot::TF_WP_NAILGUN, pNail);
}
#endif
}

View file

@ -22,6 +22,7 @@
#include "ff_utils.h"
#include "c_ff_hint_timers.h"
#else
#include "omnibot_interface.h"
#include "ff_player.h"
#endif
@ -127,7 +128,15 @@ void CFFWeaponPipeLauncher::Fire()
else if( tr.fraction != 1.0f )
vecSrc += ( vForward * -24.0f );
CFFProjectilePipebomb::CreatePipebomb(this, vecSrc, angAiming, pPlayer, pWeaponInfo.m_iDamage, pWeaponInfo.m_iSpeed);
CFFProjectilePipebomb *pPipe = CFFProjectilePipebomb::CreatePipebomb(this, vecSrc, angAiming, pPlayer, pWeaponInfo.m_iDamage, pWeaponInfo.m_iSpeed);
pPipe;
#ifdef GAME_DLL
{
if(pPlayer->IsBot())
Omnibot::Notify_PlayerShoot(pPlayer, Omnibot::TF_WP_PIPELAUNCHER, pPipe);
}
#endif
#ifdef CLIENT_DLL
// This is so we know how many pipebombs we have out at a time

View file

@ -30,6 +30,7 @@
extern void FormatViewModelAttachment( Vector &vOrigin, bool bInverse );
//extern void DrawHalo(IMaterial* pMaterial, const Vector &source, float scale, float const *color, float flHDRColorScale);
#else
#include "omnibot_interface.h"
#include "ff_player.h"
#include "te_effect_dispatch.h"
#endif
@ -282,7 +283,15 @@ void CFFWeaponRailgun::Fire( void )
// Now determine damage the same way
float flDamage = ffdev_rail_damage_min.GetFloat() + ( (ffdev_rail_damage_max.GetFloat() - ffdev_rail_damage_min.GetFloat()) * flPercent );
CFFProjectileRail::CreateRail( this, vecSrc, angAiming, pPlayer, flDamage, flSpeed, m_flClampedChargeTime );
CFFProjectileRail *pRail = CFFProjectileRail::CreateRail( this, vecSrc, angAiming, pPlayer, flDamage, flSpeed, m_flClampedChargeTime );
pRail;
#ifdef GAME_DLL
{
if(pPlayer->IsBot())
Omnibot::Notify_PlayerShoot(pPlayer, Omnibot::TF_WP_RAILGUN, pRail);
}
#endif
// play a different sound for a fully charged shot
if ( m_flClampedChargeTime < ffdev_railgun_maxchargetime.GetFloat() )

View file

@ -20,6 +20,7 @@
#define CFFWeaponRPG C_FFWeaponRPG
#include "c_ff_player.h"
#else
#include "omnibot_interface.h"
#include "ff_player.h"
#endif
@ -90,7 +91,15 @@ void CFFWeaponRPG::Fire()
QAngle angAiming;
VectorAngles(pPlayer->GetAutoaimVector(0), angAiming);
CFFProjectileRocket::CreateRocket(this, vecSrc, angAiming, pPlayer, pWeaponInfo.m_iDamage, pWeaponInfo.m_iSpeed);
CFFProjectileRocket *pRocket = CFFProjectileRocket::CreateRocket(this, vecSrc, angAiming, pPlayer, pWeaponInfo.m_iDamage, pWeaponInfo.m_iSpeed);
pRocket;
#ifdef GAME_DLL
{
if(pPlayer->IsBot())
Omnibot::Notify_PlayerShoot(pPlayer, Omnibot::TF_WP_ROCKET_LAUNCHER, pRocket);
}
#endif
}
//----------------------------------------------------------------------------

View file

@ -19,6 +19,7 @@
#define CFFWeaponShotgun C_FFWeaponShotgun
#include "c_ff_player.h"
#else
#include "omnibot_interface.h"
#include "ff_player.h"
#endif
@ -85,4 +86,11 @@ void CFFWeaponShotgun::Fire()
info.m_iTracerFreq = 0;
pPlayer->FireBullets(info);
#ifdef GAME_DLL
{
if(pPlayer->IsBot())
Omnibot::Notify_PlayerShoot(pPlayer, Omnibot::TF_WP_SHOTGUN, 0);
}
#endif
}

View file

@ -17,6 +17,8 @@ static int g_iBeam, g_iHalo;
#ifdef CLIENT_DLL
ConVar laser_beam_angle("ffdev_laserbeamangle", "0.01");
#else
#include "omnibot_interface.h"
#endif
ConVar sniperrifle_laserdot_scale("ffdev_sniperrifle_laserdot_scale", "0.15", FCVAR_REPLICATED, "Scale of the sniper rifle laser dot");
@ -471,6 +473,13 @@ void CFFWeaponSniperRifle::Fire()
// TODO: Maybe FX_FireBullets is not a good idea
//WeaponSound(SINGLE);
#ifdef GAME_DLL
{
if(pPlayer->IsBot())
Omnibot::Notify_PlayerShoot(pPlayer, Omnibot::TF_WP_SNIPER_RIFLE, 0);
}
#endif
}
//-----------------------------------------------------------------------------

View file

@ -21,6 +21,7 @@
#define CFFWeaponSuperNailgun C_FFWeaponSuperNailgun
#include "c_ff_player.h"
#else
#include "omnibot_interface.h"
#include "ff_player.h"
#endif
@ -90,5 +91,14 @@ void CFFWeaponSuperNailgun::Fire()
//QAngle angAiming;
//VectorAngles(pPlayer->GetAutoaimVector(0), angAiming);
CFFProjectileNail::CreateNail(this, vecSrc, pPlayer->EyeAngles(), pPlayer, pWeaponInfo.m_iDamage, pWeaponInfo.m_iSpeed);
CFFProjectileNail *pNail = CFFProjectileNail::CreateNail(this, vecSrc, pPlayer->EyeAngles(), pPlayer, pWeaponInfo.m_iDamage, pWeaponInfo.m_iSpeed);
pNail;
#ifdef GAME_DLL
{
if(pPlayer->IsBot())
Omnibot::Notify_PlayerShoot(pPlayer, Omnibot::TF_WP_SUPERNAILGUN, pNail);
}
#endif
}

View file

@ -19,6 +19,7 @@
#define CFFWeaponSuperShotgun C_FFWeaponSuperShotgun
#include "c_ff_player.h"
#else
#include "omnibot_interface.h"
#include "ff_player.h"
#endif
@ -85,4 +86,11 @@ void CFFWeaponSuperShotgun::Fire()
info.m_iTracerFreq = 0;
pPlayer->FireBullets(info);
#ifdef GAME_DLL
{
if(pPlayer->IsBot())
Omnibot::Notify_PlayerShoot(pPlayer, Omnibot::TF_WP_SUPERSHOTGUN, 0);
}
#endif
}

View file

@ -21,6 +21,7 @@
#define CFFWeaponTommygun C_FFWeaponTommygun
#include "c_ff_player.h"
#else
#include "omnibot_interface.h"
#include "ff_player.h"
#endif
@ -102,4 +103,11 @@ void CFFWeaponTommygun::Fire()
info.m_iDamage = pWeaponInfo.m_iDamage;
pPlayer->FireBullets(info);
#ifdef GAME_DLL
{
if(pPlayer->IsBot())
Omnibot::Notify_PlayerShoot(pPlayer, Omnibot::TF_WP_TOMMYGUN, 0);
}
#endif
}

View file

@ -22,6 +22,7 @@
#include "c_ff_player.h"
#include "ff_utils.h"
#else
#include "omnibot_interface.h"
#include "ff_player.h"
#endif
@ -105,5 +106,12 @@ void CFFWeaponTranquiliser::Fire()
QAngle angAiming;
VectorAngles(pPlayer->GetAutoaimVector(0), angAiming);
CFFProjectileDart::CreateDart(this, vecSrc, angAiming, pPlayer, pWeaponInfo.m_iDamage, pWeaponInfo.m_iSpeed);
CFFProjectileDart *pDart = CFFProjectileDart::CreateDart(this, vecSrc, angAiming, pPlayer, pWeaponInfo.m_iDamage, pWeaponInfo.m_iSpeed);
pDart;
#ifdef GAME_DLL
{
if(pPlayer->IsBot())
Omnibot::Notify_PlayerShoot(pPlayer, Omnibot::TF_WP_DARTGUN, pDart);
}
#endif
}

View file

@ -1,129 +1,94 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="shaderlib-2005"
Version="7.10"
Name="shaderlib"
ProjectGUID="{524F280F-2300-4B72-A6EB-6EF08C0DE615}"
>
SccProjectName=""
SccAuxPath=""
SccLocalPath=""
SccProvider="">
<Platforms>
<Platform
Name="Win32"
/>
Name="Win32"/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
GlobalOptimizations="TRUE"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
EnableIntrinsicFunctions="TRUE"
ImproveFloatingPointConsistency="FALSE"
FavorSizeOrSpeed="1"
OptimizeForProcessor="3"
AdditionalIncludeDirectories="./,../,../../public,../../public/tier1"
PreprocessorDefinitions="NDEBUG;_WINDOWS;fopen=dont_use_fopen;_WIN32"
StringPooling="true"
ExceptionHandling="0"
StringPooling="TRUE"
ExceptionHandling="FALSE"
RuntimeLibrary="0"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
BufferSecurityCheck="FALSE"
EnableFunctionLevelLinking="TRUE"
PrecompiledHeaderFile=".\Release/shaderlib.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="4"
SuppressStartupBanner="true"
SuppressStartupBanner="TRUE"
DebugInformationFormat="0"
CompileAs="0"
/>
CompileAs="0"/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\lib-vc7\public\shaderlib.lib"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"
CommandLine="if exist ..\..\lib-vc7\public\shaderlib.lib attrib -r ..\..\lib-vc7\public\shaderlib.lib"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
Culture="1033"/>
<Tool
Name="VCPreLinkEventTool"
CommandLine="if exist ..\..\lib\public\shaderlib.lib attrib -r ..\..\lib\public\shaderlib.lib"
/>
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\lib\public\shaderlib.lib"
SuppressStartupBanner="true"
/>
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCALinkTool"
/>
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
ImproveFloatingPointConsistency="TRUE"
OptimizeForProcessor="2"
AdditionalIncludeDirectories="./,../,../../public,../../public/tier1"
PreprocessorDefinitions="_DEBUG;_WINDOWS;fopen=dont_use_fopen;_WIN32"
ExceptionHandling="0"
ExceptionHandling="FALSE"
BasicRuntimeChecks="0"
RuntimeLibrary="1"
PrecompiledHeaderFile=".\Debug/shaderlib.pch"
@ -132,42 +97,36 @@
ProgramDataBaseFileName=".\Debug/"
BrowseInformation="1"
WarningLevel="4"
SuppressStartupBanner="true"
SuppressStartupBanner="TRUE"
DebugInformationFormat="1"
CompileAs="0"
/>
CompileAs="0"/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\lib-vc7\public\shaderlib.lib"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"
CommandLine="if exist ..\..\lib-vc7\public\shaderlib.lib attrib -r ..\..\lib-vc7\public\shaderlib.lib"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
Culture="1033"/>
<Tool
Name="VCPreLinkEventTool"
CommandLine="if exist ..\..\lib\public\shaderlib.lib attrib -r ..\..\lib\public\shaderlib.lib"
/>
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\lib\public\shaderlib.lib"
SuppressStartupBanner="true"
/>
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCALinkTool"
/>
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
@ -175,176 +134,133 @@
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath="BaseShader.cpp"
>
RelativePath="BaseShader.cpp">
</File>
<File
RelativePath="ShaderDLL.cpp"
>
RelativePath="ShaderDLL.cpp">
</File>
<File
RelativePath="shaderDLL_Global.h"
>
RelativePath="shaderDLL_Global.h">
</File>
<File
RelativePath="shaderlib_cvar.cpp"
>
RelativePath="shaderlib_cvar.cpp">
</File>
<File
RelativePath="shaderlib_cvar.h"
>
RelativePath="shaderlib_cvar.h">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl"
>
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="..\..\public\shaderlib\BaseShader.h"
>
RelativePath="..\..\public\shaderlib\BaseShader.h">
</File>
<File
RelativePath="..\..\Public\tier0\basetypes.h"
>
RelativePath="..\..\Public\tier0\basetypes.h">
</File>
<File
RelativePath="..\..\Public\commonmacros.h"
>
RelativePath="..\..\Public\commonmacros.h">
</File>
<File
RelativePath="..\..\public\shaderlib\cshader.h"
>
RelativePath="..\..\public\shaderlib\cshader.h">
</File>
<File
RelativePath="..\..\public\tier0\dbg.h"
>
RelativePath="..\..\public\tier0\dbg.h">
</File>
<File
RelativePath="..\..\public\tier0\fasttimer.h"
>
RelativePath="..\..\public\tier0\fasttimer.h">
</File>
<File
RelativePath="..\..\public\appframework\IAppSystem.h"
>
RelativePath="..\..\public\appframework\IAppSystem.h">
</File>
<File
RelativePath="..\..\public\vstdlib\ICommandLine.h"
>
RelativePath="..\..\public\vstdlib\ICommandLine.h">
</File>
<File
RelativePath="..\..\Public\icvar.h"
>
RelativePath="..\..\Public\icvar.h">
</File>
<File
RelativePath="..\..\Public\ImageLoader.h"
>
RelativePath="..\..\Public\ImageLoader.h">
</File>
<File
RelativePath="..\..\public\materialsystem\imaterial.h"
>
RelativePath="..\..\public\materialsystem\imaterial.h">
</File>
<File
RelativePath="..\..\public\materialsystem\imaterialsystem.h"
>
RelativePath="..\..\public\materialsystem\imaterialsystem.h">
</File>
<File
RelativePath="..\..\public\materialsystem\imaterialsystemhardwareconfig.h"
>
RelativePath="..\..\public\materialsystem\imaterialsystemhardwareconfig.h">
</File>
<File
RelativePath="..\..\public\materialsystem\imaterialvar.h"
>
RelativePath="..\..\public\materialsystem\imaterialvar.h">
</File>
<File
RelativePath="..\..\public\materialsystem\imesh.h"
>
RelativePath="..\..\public\materialsystem\imesh.h">
</File>
<File
RelativePath="..\..\public\materialsystem\IShader.h"
>
RelativePath="..\..\public\materialsystem\IShader.h">
</File>
<File
RelativePath="..\..\public\materialsystem\ishaderapi.h"
>
RelativePath="..\..\public\materialsystem\ishaderapi.h">
</File>
<File
RelativePath="..\IShaderSystem.h"
>
RelativePath="..\IShaderSystem.h">
</File>
<File
RelativePath="..\..\public\materialsystem\itexture.h"
>
RelativePath="..\..\public\materialsystem\itexture.h">
</File>
<File
RelativePath="..\..\public\materialsystem\materialsystem_config.h"
>
RelativePath="..\..\public\materialsystem\materialsystem_config.h">
</File>
<File
RelativePath="..\..\Public\MATHLIB.H"
>
RelativePath="..\..\Public\MATHLIB.H">
</File>
<File
RelativePath="..\..\public\tier0\memdbgoff.h"
>
RelativePath="..\..\public\tier0\memdbgoff.h">
</File>
<File
RelativePath="..\..\public\tier0\memdbgon.h"
>
RelativePath="..\..\public\tier0\memdbgon.h">
</File>
<File
RelativePath="..\..\public\tier0\platform.h"
>
RelativePath="..\..\public\tier0\platform.h">
</File>
<File
RelativePath="..\..\public\protected_things.h"
>
RelativePath="..\..\public\protected_things.h">
</File>
<File
RelativePath="..\..\public\shaderlib\ShaderDLL.h"
>
RelativePath="..\..\public\shaderlib\ShaderDLL.h">
</File>
<File
RelativePath="..\..\public\string_t.h"
>
RelativePath="..\..\public\string_t.h">
</File>
<File
RelativePath="..\..\public\vstdlib\strtools.h"
>
RelativePath="..\..\public\vstdlib\strtools.h">
</File>
<File
RelativePath="..\..\public\tier1\utlmemory.h"
>
RelativePath="..\..\public\tier1\utlmemory.h">
</File>
<File
RelativePath="..\..\public\tier1\utlvector.h"
>
RelativePath="..\..\public\tier1\utlvector.h">
</File>
<File
RelativePath="..\..\Public\vector.h"
>
RelativePath="..\..\Public\vector.h">
</File>
<File
RelativePath="..\..\Public\vector2d.h"
>
RelativePath="..\..\Public\vector2d.h">
</File>
<File
RelativePath="..\..\Public\vector4d.h"
>
RelativePath="..\..\Public\vector4d.h">
</File>
<File
RelativePath="..\..\Public\vmatrix.h"
>
RelativePath="..\..\Public\vmatrix.h">
</File>
<File
RelativePath="..\..\Public\vplane.h"
>
RelativePath="..\..\Public\vplane.h">
</File>
<File
RelativePath="..\..\public\vstdlib\vstdlib.h"
>
RelativePath="..\..\public\vstdlib\vstdlib.h">
</File>
</Filter>
</Files>

View file

@ -1,162 +1,121 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Version="7.10"
Name="mathlib"
ProjectGUID="{E1DA9FB8-FB4C-4B14-91A6-98BCED6B9720}"
Keyword="Win32Proj"
>
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"
/>
Name="Win32"/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
ImproveFloatingPointConsistency="TRUE"
OptimizeForProcessor="3"
AdditionalIncludeDirectories="..\common,..\public,..\public\mathlib"
PreprocessorDefinitions="_WIN32;_DEBUG;_LIB"
MinimalRebuild="true"
ExceptionHandling="1"
MinimalRebuild="TRUE"
ExceptionHandling="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
BufferSecurityCheck="true"
ForceConformanceInForLoopScope="true"
RuntimeTypeInfo="true"
BufferSecurityCheck="TRUE"
ForceConformanceInForLoopScope="TRUE"
RuntimeTypeInfo="TRUE"
UsePrecompiledHeader="0"
ProgramDataBaseFileName="$(IntDir)/"
WarningLevel="4"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
/>
Detect64BitPortabilityProblems="FALSE"
DebugInformationFormat="4"/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
CommandLine="if exist ..\lib\public\mathlib.lib attrib -r ..\lib\public\mathlib.lib&#x0D;&#x0A;if exist ..\lib\public\mathlib.pdb attrib -r ..\lib\public\mathlib.pdb&#x0D;&#x0A;"
/>
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\lib\public\mathlib.lib"
/>
OutputFile="..\lib-vc7\public\mathlib.lib"/>
<Tool
Name="VCALinkTool"
/>
Name="VCMIDLTool"/>
<Tool
Name="VCXDCMakeTool"
/>
Name="VCPostBuildEventTool"/>
<Tool
Name="VCBscMakeTool"
/>
Name="VCPreBuildEventTool"/>
<Tool
Name="VCFxCopTool"
/>
Name="VCPreLinkEventTool"
CommandLine="if exist ..\lib\public\mathlib.lib attrib -r ..\lib\public\mathlib.lib
if exist ..\lib\public\mathlib.pdb attrib -r ..\lib\public\mathlib.pdb
"/>
<Tool
Name="VCPostBuildEventTool"
/>
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
GlobalOptimizations="TRUE"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
EnableIntrinsicFunctions="TRUE"
ImproveFloatingPointConsistency="FALSE"
FavorSizeOrSpeed="1"
OptimizeForProcessor="3"
AdditionalIncludeDirectories="..\common,..\public,..\public\mathlib"
PreprocessorDefinitions="_WIN32;NDEBUG;_LIB"
StringPooling="true"
ExceptionHandling="1"
StringPooling="TRUE"
ExceptionHandling="TRUE"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
ForceConformanceInForLoopScope="true"
RuntimeTypeInfo="true"
EnableFunctionLevelLinking="TRUE"
ForceConformanceInForLoopScope="TRUE"
RuntimeTypeInfo="TRUE"
UsePrecompiledHeader="0"
ProgramDataBaseFileName="$(IntDir)/"
WarningLevel="4"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="1"
/>
Detect64BitPortabilityProblems="FALSE"
DebugInformationFormat="2"/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
CommandLine="if exist ..\lib\public\mathlib.lib attrib -r ..\lib\public\mathlib.lib&#x0D;&#x0A;if exist ..\lib\public\mathlib.pdb attrib -r ..\lib\public\mathlib.pdb&#x0D;&#x0A;"
/>
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\lib\public\mathlib.lib"
/>
OutputFile="..\lib-vc7\public\mathlib.lib"/>
<Tool
Name="VCALinkTool"
/>
Name="VCMIDLTool"/>
<Tool
Name="VCXDCMakeTool"
/>
Name="VCPostBuildEventTool"/>
<Tool
Name="VCBscMakeTool"
/>
Name="VCPreBuildEventTool"/>
<Tool
Name="VCFxCopTool"
/>
Name="VCPreLinkEventTool"
CommandLine="if exist ..\lib\public\mathlib.lib attrib -r ..\lib\public\mathlib.lib
if exist ..\lib\public\mathlib.pdb attrib -r ..\lib\public\mathlib.pdb
"/>
<Tool
Name="VCPostBuildEventTool"
/>
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
@ -165,37 +124,29 @@
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4F4837F1-C7A5-4276-A066-2A32D752A2FF}"
>
UniqueIdentifier="{4F4837F1-C7A5-4276-A066-2A32D752A2FF}">
<File
RelativePath=".\halton.cpp"
>
RelativePath=".\halton.cpp">
</File>
<File
RelativePath=".\lightdesc.cpp"
>
RelativePath=".\lightdesc.cpp">
</File>
<File
RelativePath=".\mathlib_base.cpp"
>
RelativePath=".\mathlib_base.cpp">
</File>
<File
RelativePath=".\powsse.cpp"
>
RelativePath=".\powsse.cpp">
</File>
<File
RelativePath=".\sseconst.cpp"
>
RelativePath=".\sseconst.cpp">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93795370-89BD-4b04-88EB-625FBE52EBFB}"
>
UniqueIdentifier="{93795370-89BD-4b04-88EB-625FBE52EBFB}">
<File
RelativePath="..\public\mathlib\math_base.h"
>
RelativePath="..\public\mathlib\math_base.h">
</File>
</Filter>
</Files>

View file

@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////////////////////////
//
// $LastChangedBy: DrEvil $
// $LastChangedDate: 2006-11-16 21:34:50 -0800 (Thu, 16 Nov 2006) $
// $LastChangedRevision: 1320 $
// $LastChangedDate: 2007-07-23 20:42:20 -0700 (Mon, 23 Jul 2007) $
// $LastChangedRevision: 2119 $
//
////////////////////////////////////////////////////////////////////////////////
@ -16,61 +16,78 @@
//////////////////////////////////////////////////////////////////////////
typedef struct
struct Msg_Addbot
{
int m_Team;
int m_Class;
char m_Name[64];
int m_ModelId;
int m_SkinId;
};
struct Msg_PlayerChooseEquipment
{
enum { NumItems = 16 };
int m_WeaponChoice[NumItems];
int m_ItemChoice[NumItems];
};
struct Msg_PlayerHealthArmor
{
int m_CurrentHealth;
int m_MaxHealth;
int m_CurrentArmor;
int m_MaxArmor;
} Msg_PlayerHealthArmor;
};
typedef struct
struct Msg_PlayerMaxSpeed
{
float m_MaxSpeed;
} Msg_PlayerMaxSpeed;
};
typedef struct
struct Msg_IsAlive
{
obBool m_IsAlive;
} Msg_IsAlive;
};
typedef struct
struct Msg_IsAllied
{
GameEntity m_TargetEntity;
obBool m_IsAllied;
} Msg_IsAllied;
};
typedef struct
struct Msg_IsOutside
{
obBool m_IsHuman;
} Msg_IsHuman;
float m_Position[3];
obBool m_IsOutside;
};
typedef struct
struct Msg_ChangeName
{
char m_NewName[32];
};
struct Msg_PointContents
{
int m_Contents;
float x,y,z;
} Msg_PointContents;
};
typedef struct
{
int m_Weapon;
} Msg_EquippedWeapon;
typedef struct
struct Msg_ReadyToFire
{
obBool m_Ready;
} Msg_ReadyToFire;
};
typedef struct
struct Msg_Reloading
{
obBool m_Reloading;
} Msg_Reloading;
};
typedef struct
struct Msg_FlagState
{
FlagState m_FlagState;
GameEntity m_Owner;
} Msg_FlagState;
};
typedef struct
{
@ -78,34 +95,245 @@ typedef struct
float m_TimeLeft;
} Msg_GameState;
typedef struct
struct Msg_EntityStat
{
char m_StatName[64];
BotUserData m_Result;
} Msg_EntityStat;
obUserData m_Result;
};
typedef struct
struct Msg_TeamStat
{
int m_Team;
char m_StatName[64];
BotUserData m_Result;
} Msg_TeamStat;
obUserData m_Result;
};
typedef struct
struct Msg_ServerCommand
{
char m_Command[256];
};
struct WeaponCharging
{
int m_Weapon;
FireMode m_FireMode;
obBool m_IsCharged;
} WeaponCharged;
};
typedef struct
struct WeaponCharged
{
int m_Weapon;
FireMode m_FireMode;
obBool m_IsCharged;
};
struct WeaponHeatLevel
{
FireMode m_FireMode;
float m_CurrentHeat;
float m_MaxHeat;
} WeaponHeatLevel;
};
struct ControllingTeam
{
int m_ControllingTeam;
};
struct WeaponStatus
{
int m_WeaponId;
//FireMode m_FireMode;
WeaponStatus() : m_WeaponId(0) {}
bool operator==(const WeaponStatus &_w2)
{
return m_WeaponId == _w2.m_WeaponId;
}
bool operator!=(const WeaponStatus &_w2)
{
return !(*this == _w2);
}
};
struct WeaponLimits
{
float m_CenterFacing[3];
float m_MinHorizontalArc, m_MaxHorizontalArc;
float m_MinVerticalArc, m_MaxVerticalArc;
int m_WeaponId;
obBool m_Limited;
};
struct Msg_KillEntity
{
GameEntity m_WhoToKill;
};
//////////////////////////////////////////////////////////////////////////
// Events
struct Event_SystemThreadCreated
{
int m_ThreadId;
};
struct Event_SystemThreadDestroyed
{
int m_ThreadId;
};
struct Event_SystemClientConnected
{
int m_GameId;
obBool m_IsBot;
int m_DesiredClass;
int m_DesiredTeam;
Event_SystemClientConnected()
: m_GameId(-1)
, m_IsBot(False)
, m_DesiredClass(RANDOM_CLASS_IF_NO_CLASS)
, m_DesiredTeam(RANDOM_TEAM_IF_NO_TEAM)
{
}
};
struct Event_SystemClientDisConnected
{
int m_GameId;
};
struct Event_SystemGravity
{
float m_Gravity;
};
struct Event_SystemCheats
{
obBool m_Enabled;
};
struct Event_EntityCreated
{
GameEntity m_Entity;
BitFlag32 m_EntityCategory;
int m_EntityClass;
};
struct EntityInstance
{
GameEntity m_Entity;
BitFlag32 m_EntityCategory;
int m_EntityClass;
};
struct Event_EntityDeleted
{
GameEntity m_Entity;
};
//////////////////////////////////////////////////////////////////////////
struct Event_Death
{
GameEntity m_WhoKilledMe;
char m_MeansOfDeath[32];
};
struct Event_KilledSomeone
{
GameEntity m_WhoIKilled;
char m_MeansOfDeath[32];
};
struct Event_TakeDamage
{
GameEntity m_Inflictor;
};
struct Event_Healed
{
GameEntity m_WhoHealedMe;
};
struct Event_Revived
{
GameEntity m_WhoRevivedMe;
};
struct Event_ChangeTeam
{
int m_NewTeam;
};
struct Event_WeaponChanged
{
int m_WeaponId;
};
struct Event_ChangeClass
{
int m_NewClass;
};
struct Event_Spectated
{
int m_WhoSpectatingMe;
};
struct Event_AddWeapon
{
int m_WeaponId;
};
struct Event_RemoveWeapon
{
int m_WeaponId;
};
struct Event_WeaponFire
{
int m_WeaponId;
FireMode m_FireMode;
GameEntity m_Projectile;
};
struct Event_WeaponChange
{
int m_WeaponId;
};
struct Event_ChatMessage
{
GameEntity m_WhoSaidIt;
char m_Message[512];
};
struct Event_VoiceMacro
{
GameEntity m_WhoSaidIt;
char m_MacroString[64];
};
struct Event_PlayerUsed
{
GameEntity m_WhoDidIt;
};
struct Event_HearSound
{
char m_SoundName[32];
float m_Origin[3];
GameEntity m_Source;
int m_SoundType;
};
struct Event_EntitySensed
{
int m_EntityClass;
GameEntity m_Entity;
};
#pragma pack(pop)

View file

@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////////////////////////
//
// $LastChangedBy: DrEvil $
// $LastChangedDate: 2006-08-03 00:47:21 -0700 (Thu, 03 Aug 2006) $
// $LastChangedRevision: 1241 $
// $LastChangedDate: 2007-05-16 16:53:29 -0700 (Wed, 16 May 2007) $
// $LastChangedRevision: 1924 $
//
// Title: BotExports
// In order for the game to call functions from the bot, we must export
@ -14,9 +14,9 @@
#define __BOTEXPORTS_H__
#include "Functions_Bot.h"
#include "Functions_Engine.h"
#include "Omni-Bot_Types.h"
#include "Omni-Bot_Events.h"
#include "IEngineInterface.h"
//////////////////////////////////////////////////////////////////////////
// Export the function on platforms that require it.
@ -27,7 +27,7 @@
#endif
// Typedef for the only exported bot function.
typedef int (*pfnGetFunctionsFromDLL)(Bot_EngineFuncs_t *_pBotFuncs, int _size);
typedef eomnibot_error (*pfnGetFunctionsFromDLL)(Bot_EngineFuncs_t *_pBotFuncs, int _size);
// note: Export Functions with C Linkage
// Export with C Linkage so the game interface can acccess it easier.
@ -40,162 +40,26 @@ extern "C"
// function: ExportBotFunctionsFromDLL
// Allow the bot dll to fill in a struct of bot functions the interface
// can then call.
OMNIBOT_API int ExportBotFunctionsFromDLL(Bot_EngineFuncs_t *_pBotFuncs, int _size);
OMNIBOT_API eomnibot_error ExportBotFunctionsFromDLL(Bot_EngineFuncs_t *_pBotFuncs, int _size);
#ifdef __cplusplus
}
#endif
//////////////////////////////////////////////////////////////////////////
// Helpers for Interfaces
// Interfaces
static const char *BOTERRORS[BOT_NUM_ERRORS] =
{
"None",
"Bot Library not found",
"Unable to get Bot Functions from DLL",
"Error Initializing the Bot",
"Invalid Interface Functions",
"Wrong Version",
};
extern Bot_EngineFuncs_t g_BotFunctions;
extern IEngineInterface *g_InterfaceFunctions;
// Macro: BOT_ERR_MSG
// Translates an error code into an error string.
#define BOT_ERR_MSG(iMsg) \
(((iMsg) >= BOT_ERROR_NONE) && ((iMsg) < BOT_NUM_ERRORS)) ? BOTERRORS[(iMsg)] : ""
Bot_EngineFuncs_t g_BotFunctions = {0};
Game_EngineFuncs_t g_InterfaceFunctions = {0};
// Platform stuff for loading the bot dll and getting the interface set up.
#ifdef WIN32
#define WIN32_LEAN_AND_MEAN
#define NOWINRES
#define NOSERVICE
#define NOMCX
#define NOIME
#include <windows.h>
#undef GetClassName // stupidass windows
//////////////////////////////////////////////////////////////////////////
HINSTANCE g_BotLibrary = NULL;
// Macro: INITBOTLIBRARY
// Initializes the bot library by attempting to load the bot from several
// expected bot locations. If found, it verifies a version before returning 0
// on success, or an error code on failure, which can be used with <BOT_ERR_MSG>
#define INITBOTLIBRARY(version, navid, win, lin, custompath, result) \
{ \
result = BOT_ERROR_NONE; \
char szBuffer[1024] = {0}; \
OB_snprintf(szBuffer, 1024, "%s/%s", custompath, win); \
g_BotLibrary = LoadLibrary( szBuffer ); \
if(g_BotLibrary == 0) \
g_BotLibrary = LoadLibrary( ".\\omni-bot\\" win ); \
if(g_BotLibrary == 0) \
g_BotLibrary = LoadLibrary( win ); \
if(g_BotLibrary == 0) \
result = BOT_ERROR_CANTLOADDLL; \
else \
{ \
pfnGetFunctionsFromDLL pfnGetBotFuncs = 0; \
memset(&g_BotFunctions, 0, sizeof(g_BotFunctions)); \
pfnGetBotFuncs = (pfnGetFunctionsFromDLL)GetProcAddress(g_BotLibrary, "ExportBotFunctionsFromDLL"); \
if(pfnGetBotFuncs == 0) \
{ \
result = BOT_ERROR_CANTGETBOTFUNCTIONS; \
} else \
{ \
result = pfnGetBotFuncs(&g_BotFunctions, sizeof(g_BotFunctions)); \
if(result == BOT_ERROR_NONE) \
{ \
result = g_BotFunctions.pfnBotInitialise(navid, &g_InterfaceFunctions, version); \
} \
} \
} \
} \
// Macro: SHUTDOWNBOTLIBRARY
// Handles shutting down and free'ing the bot library.
#define SHUTDOWNBOTLIBRARY \
if(g_BotLibrary) { FreeLibrary(g_BotLibrary); g_BotLibrary = 0; memset(&g_BotFunctions, 0, sizeof(g_BotFunctions)); }
//////////////////////////////////////////////////////////////////////////
#elif defined __linux__
#include <dlfcn.h>
#define GetProcAddress dlsym
#define NULL 0
//////////////////////////////////////////////////////////////////////////
void *g_BotLibrary = NULL;
#define INITBOTLIBRARY(version, navid, win, lin, custompath, result) \
{ \
result = BOT_ERROR_NONE; \
const char *pError = 0; \
char szBuffer[1024] = {0}; \
OB_snprintf(szBuffer, 1024, "%s/%s", custompath, lin); \
g_BotLibrary = dlopen(szBuffer, RTLD_NOW); \
if(pError = dlerror()) \
{ \
OB_snprintf(szBuffer, 1024, "failed loading: %s", pError); \
pfnPrintError(szBuffer); \
OB_snprintf(szBuffer, 1024, "./omni-bot/%s", lin); \
g_BotLibrary = dlopen(szBuffer, RTLD_NOW); \
} \
if(pError = dlerror()) \
{ \
char *homeDir = getenv("HOME"); \
OB_snprintf(szBuffer, 1024, "failed loading: %s", pError); \
pfnPrintError(szBuffer); \
if(homeDir && *homeDir) \
{ \
OB_snprintf(szBuffer, 1024, "%s/omni-bot/%s", homeDir, lin); \
g_BotLibrary = dlopen(szBuffer, RTLD_NOW); \
} \
} \
if(pError = dlerror()) \
{ \
OB_snprintf(szBuffer, 1024, "failed loading: %s", pError); \
pfnPrintError(szBuffer); \
g_BotLibrary = dlopen(lin, RTLD_NOW); \
} \
if(pError = dlerror()) \
{ \
OB_snprintf(szBuffer, 1024, "failed loading: %s", pError); \
pfnPrintError(szBuffer); \
result = BOT_ERROR_CANTLOADDLL; \
} \
else \
{ \
pfnGetFunctionsFromDLL pfnGetBotFuncs = 0; \
memset(&g_BotFunctions, 0, sizeof(g_BotFunctions)); \
pfnGetBotFuncs = (pfnGetFunctionsFromDLL)GetProcAddress(g_BotLibrary, "ExportBotFunctionsFromDLL"); \
if(dlerror()) \
{ \
result = BOT_ERROR_CANTGETBOTFUNCTIONS; \
} \
else \
{ \
result = pfnGetBotFuncs(&g_BotFunctions, sizeof(g_BotFunctions)); \
if(result == BOT_ERROR_NONE) \
{ \
result = g_BotFunctions.pfnBotInitialise(navid, &g_InterfaceFunctions, version); \
} \
} \
} \
} \
#define SHUTDOWNBOTLIBRARY \
if(g_BotLibrary) { dlclose(g_BotLibrary); g_BotLibrary = 0; memset(&g_BotFunctions, 0, sizeof(g_BotFunctions)); }
//////////////////////////////////////////////////////////////////////////
#else
// get a mac somewhere and do support...
void *g_BotLibrary = NULL;
#define INITBOTLIBRARY(version, navid, win, lin, custom, result) \
result = BOT_ERROR_CANTLOADDLL;
#define SHUTDOWNBOTLIBRARY \
g_BotLibrary = 0;
#endif
//////////////////////////////////////////////////////////////////////////
// Utility Function
extern "C" const char *OB_VA(const char* _msg, ...);
//////////////////////////////////////////////////////////////////////////
eomnibot_error Omnibot_LoadLibrary(int version, const char *lib, const char *path);
void Omnibot_FreeLibrary();
bool IsOmnibotLoaded();
const char *Omnibot_ErrorString(eomnibot_error err);
const char *Omnibot_GetLibraryPath();
const char *Omnibot_FixPath(const char *_path);
#endif

341
omnibot/BotLoadLibrary.cpp Normal file
View file

@ -0,0 +1,341 @@
////////////////////////////////////////////////////////////////////////////////
//
// $LastChangedBy: DrEvil $
// $LastChangedDate: 2007-02-14 09:28:05 -0800 (Wed, 14 Feb 2007) $
// $LastChangedRevision: 1635 $
//
////////////////////////////////////////////////////////////////////////////////
#include "BotExports.h"
#pragma warning(disable:4530) //C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
#pragma warning(disable:4706) //assignment within conditional expression
#include <string>
//////////////////////////////////////////////////////////////////////////
bool g_IsOmnibotLoaded = false;
Bot_EngineFuncs_t g_BotFunctions = {0};
IEngineInterface *g_InterfaceFunctions = 0;
std::string g_OmnibotLibPath;
void Omnibot_Load_PrintMsg(const char *_msg);
void Omnibot_Load_PrintErr(const char *_msg);
bool IsOmnibotLoaded()
{
return g_IsOmnibotLoaded;
}
const char *Omnibot_GetLibraryPath()
{
return g_OmnibotLibPath.c_str();
}
//////////////////////////////////////////////////////////////////////////
static const char *BOTERRORS[BOT_NUM_ERRORS] =
{
"None",
"Bot Library not found",
"Unable to get Bot Functions from DLL",
"Error Initializing the Bot",
"Invalid Interface Functions",
"Wrong Version",
"Error Initializing File System",
};
void Omnibot_strncpy(char *dest, const char *source, int count)
{
// Only doing this because some engines(HL2), think it a good idea to fuck up the
// defines of all basic string functions throughout the entire project.
while (count && (*dest++ = *source++)) /* copy string */
count--;
if (count) /* pad out with zeroes */
while (--count)
*dest++ = '\0';
}
const char *Omnibot_ErrorString(eomnibot_error err)
{
return ((err >= BOT_ERROR_NONE) && (err < BOT_NUM_ERRORS)) ? BOTERRORS[err] : "";
}
const char *Omnibot_FixPath(const char *_path)
{
const int iBufferSize = 512;
static char pathstr[iBufferSize] = {0};
Omnibot_strncpy(pathstr, _path, iBufferSize);
// unixify the path slashes
char *pC = pathstr;
while(*pC)
{
if(*pC == '\\')
*pC = '/';
++pC;
}
// trim any trailing slash
while(int iLen = strlen(pathstr))
{
if(pathstr[iLen-1] == '/')
pathstr[iLen-1] = 0;
else
break;
}
return pathstr;
}
//////////////////////////////////////////////////////////////////////////
#if defined WIN32 || defined _WINDOWS || defined _WIN32
//////////////////////////////////////////////////////////////////////////
// Windows
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#ifndef NOWINRES
#define NOWINRES
#endif
#ifndef NOSERVICE
#define NOSERVICE
#endif
#ifndef NOMCX
#define NOMCX
#endif
#ifndef NOIME
#define NOIME
#endif
#include <stdio.h>
#include <windows.h>
//////////////////////////////////////////////////////////////////////////
// Utilities
const char *OB_VA(const char* _msg, ...)
{
static char buffer[1024] = {0};
va_list list;
va_start(list, _msg);
_vsnprintf(buffer, 8192, _msg, list);
va_end(list);
return buffer;
}
//////////////////////////////////////////////////////////////////////////
HINSTANCE g_BotLibrary = NULL;
bool OB_ShowLastError(const char *context)
{
LPVOID lpMsgBuf;
DWORD dw = GetLastError();
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
dw,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &lpMsgBuf,
0, NULL );
//////////////////////////////////////////////////////////////////////////
// Strip Newlines
char *pMessage = (char*)lpMsgBuf;
int i = strlen(pMessage)-1;
while(pMessage[i] == '\n' || pMessage[i] == '\r')
pMessage[i--] = 0;
//////////////////////////////////////////////////////////////////////////
Omnibot_Load_PrintErr(OB_VA("%s Failed with Error: %s", context, pMessage));
LocalFree(lpMsgBuf);
return true;
}
HINSTANCE Omnibot_LL(const char *file)
{
//////////////////////////////////////////////////////////////////////////
// Parse Variables
// $(ProgramFiles)
// $(OMNIBOT)
//////////////////////////////////////////////////////////////////////////
g_OmnibotLibPath = file;
HINSTANCE hndl = LoadLibrary(g_OmnibotLibPath.c_str());
if(!hndl)
OB_ShowLastError("LoadLibrary");
Omnibot_Load_PrintMsg(OB_VA("Looking for %s, ", g_OmnibotLibPath.c_str(), hndl ? "found." : "not found"));
return hndl;
}
eomnibot_error Omnibot_LoadLibrary(int version, const char *lib, const char *path)
{
eomnibot_error r = BOT_ERROR_NONE;
g_BotLibrary = Omnibot_LL( OB_VA("%s\\%s.dll", path ? path : ".", lib) );
if(g_BotLibrary == 0)
g_BotLibrary = Omnibot_LL( OB_VA(".\\omni-bot\\%s.dll", lib) );
if(g_BotLibrary == 0)
g_BotLibrary = Omnibot_LL( OB_VA("%s.dll", lib) );
if(g_BotLibrary == 0)
{
g_OmnibotLibPath.clear();
r = BOT_ERROR_CANTLOADDLL;
}
else
{
Omnibot_Load_PrintMsg(OB_VA("Found Omni-bot: %s, Attempting to Initialize", g_OmnibotLibPath.c_str()));
pfnGetFunctionsFromDLL pfnGetBotFuncs = 0;
memset(&g_BotFunctions, 0, sizeof(g_BotFunctions));
pfnGetBotFuncs = (pfnGetFunctionsFromDLL)GetProcAddress(g_BotLibrary, "ExportBotFunctionsFromDLL");
if(pfnGetBotFuncs == 0)
{
r = BOT_ERROR_CANTGETBOTFUNCTIONS;
}
else
{
r = pfnGetBotFuncs(&g_BotFunctions, sizeof(g_BotFunctions));
if(r == BOT_ERROR_NONE)
{
Omnibot_Load_PrintMsg("Omni-bot Loaded Successfully");
r = g_BotFunctions.pfnBotInitialise(g_InterfaceFunctions, version);
g_IsOmnibotLoaded = (r == BOT_ERROR_NONE);
}
else
{
Omnibot_Load_PrintErr(OB_VA("Omni-bot Failed with Error: %s", Omnibot_ErrorString(r)));
Omnibot_FreeLibrary();
}
}
}
return r;
}
void Omnibot_FreeLibrary()
{
if(g_BotLibrary)
{
FreeLibrary(g_BotLibrary);
g_BotLibrary = 0;
}
memset(&g_BotFunctions, 0, sizeof(g_BotFunctions));
delete g_InterfaceFunctions;
g_InterfaceFunctions = 0;
g_IsOmnibotLoaded = false;
}
#elif defined __linux__
#include <stdarg.h>
//////////////////////////////////////////////////////////////////////////
// Utilities
const char *OB_VA(const char* _msg, ...)
{
static char buffer[1024] = {0};
va_list list;
va_start(list, _msg);
vsnprintf(buffer, 8192, _msg, list);
va_end(list);
return buffer;
}
#include <dlfcn.h>
#define GetProcAddress dlsym
#define NULL 0
//////////////////////////////////////////////////////////////////////////
void *g_BotLibrary = NULL;
bool OB_ShowLastError(const char *context, const char *errormsg)
{
Omnibot_Load_PrintErr(OB_VA("%s Failed with Error: %s", context, errormsg?errormsg:"<unknown error>"));
return true;
}
void *Omnibot_LL(const char *file)
{
g_OmnibotLibPath = file;
Omnibot_Load_PrintMsg(OB_VA("Looking for %s", g_OmnibotLibPath.c_str()));
void *pLib = dlopen(g_OmnibotLibPath.c_str(), RTLD_NOW);
if(!pLib)
OB_ShowLastError("LoadLibrary", dlerror());
return pLib;
}
eomnibot_error Omnibot_LoadLibrary(int version, const char *lib, const char *path)
{
eomnibot_error r = BOT_ERROR_NONE;
const char *pError = 0;
g_BotLibrary = Omnibot_LL(OB_VA("%s/%s.so", path ? path : ".", lib));
if(!g_BotLibrary)
{
g_BotLibrary = Omnibot_LL(OB_VA("./%s.so", lib));
}
if(!g_BotLibrary)
{
char *homeDir = getenv("HOME");
if(homeDir)
g_BotLibrary = Omnibot_LL(OB_VA("%s/omni-bot/%s.so", homeDir, lib));
}
if(!g_BotLibrary)
{
char *homeDir = getenv("HOME");
if(homeDir)
g_BotLibrary = Omnibot_LL(OB_VA("%s.so", lib));
}
if(!g_BotLibrary)
{
g_OmnibotLibPath.clear();
r = BOT_ERROR_CANTLOADDLL;
}
else
{
Omnibot_Load_PrintMsg(OB_VA("Found Omni-bot: %s, Attempting to Initialize", g_OmnibotLibPath.c_str()));
pfnGetFunctionsFromDLL pfnGetBotFuncs = 0;
memset(&g_BotFunctions, 0, sizeof(g_BotFunctions));
pfnGetBotFuncs = (pfnGetFunctionsFromDLL)GetProcAddress(g_BotLibrary, "ExportBotFunctionsFromDLL");
if(!pfnGetBotFuncs)
{
OB_ShowLastError("GetProcAddress", dlerror());
r = BOT_ERROR_CANTGETBOTFUNCTIONS;
}
else
{
r = pfnGetBotFuncs(&g_BotFunctions, sizeof(g_BotFunctions));
if(r == BOT_ERROR_NONE)
{
Omnibot_Load_PrintMsg("Omni-bot Loaded Successfully");
r = g_BotFunctions.pfnBotInitialise(&g_InterfaceFunctions, version);
g_IsOmnibotLoaded = (r == BOT_ERROR_NONE);
}
}
}
return r;
}
void Omnibot_FreeLibrary()
{
if(g_BotLibrary)
{
dlclose(g_BotLibrary);
g_BotLibrary = 0;
}
memset(&g_BotFunctions, 0, sizeof(g_BotFunctions));
memset(&g_InterfaceFunctions, 0, sizeof(g_InterfaceFunctions));
g_IsOmnibotLoaded = false;
}
//////////////////////////////////////////////////////////////////////////
#else
#error "Unsupported Platform or Missing platform #defines";
#endif

View file

@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////////////////////////
//
// $LastChangedBy: DrEvil $
// $LastChangedDate: 2006-11-16 21:34:50 -0800 (Thu, 16 Nov 2006) $
// $LastChangedRevision: 1320 $
// $LastChangedDate: 2007-05-16 16:53:29 -0700 (Wed, 16 May 2007) $
// $LastChangedRevision: 1924 $
//
////////////////////////////////////////////////////////////////////////////////
@ -28,6 +28,8 @@ typedef enum eFF_Version
FF_VERSION_0_10,
FF_VERSION_0_11,
FF_VERSION_0_12,
FF_VERSION_0_13,
FF_VERSION_0_14,
FF_VERSION_LAST,
FF_VERSION_LATEST = FF_VERSION_LAST - 1
} FF_Version;

View file

@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////////////////////////
//
// $LastChangedBy: DrEvil $
// $LastChangedDate: 2006-09-19 19:31:58 -0700 (Tue, 19 Sep 2006) $
// $LastChangedRevision: 1277 $
// $LastChangedDate: 2007-06-07 09:51:52 -0700 (Thu, 07 Jun 2007) $
// $LastChangedRevision: 1973 $
//
////////////////////////////////////////////////////////////////////////////////
@ -12,8 +12,8 @@
#include "Omni-Bot.h"
#include "Omni-Bot_Types.h"
#include "Omni-Bot_Events.h"
#include "Functions_Engine.h"
#include "MessageHelper.h"
#include "IEngineInterface.h"
// Title: Functions Bot
@ -23,28 +23,19 @@
// suite of functions at once from the bot.
typedef struct
{
omnibot_error (*pfnBotInitialise)(const NavigatorID _navid, const Game_EngineFuncs_t *_pEngineFuncs, int _version);
omnibot_error (*pfnBotInitialise)(IEngineInterface *_pEngineFuncs, int _version);
void (*pfnBotUpdate)();
void (*pfnBotShutdown)();
int (*pfnBotConsoleCommand)(const char *_cmd, int _size);
void (*pfnBotSendEvent)(int _eid, int _dest, int _source, int _msdelay, BotUserData *_data);
void (*pfnBotSendGlobalEvent)(int _eid, int _source, int _msdelay, BotUserData *_data);
obint32 (*pfnBotAddGoal)(const GameEntity _ent, int _goaltype, int _team, const char *_tag, BotUserData *_bud);
void (*pfnBotAddGoal)(const GameEntity _ent, int _goaltype, int _team, const char *_tag, obUserData *_bud);
void (*pfnBotSendTrigger)(TriggerInfo *_triggerInfo);
void (*pfnBotAddBBRecord)(BlackBoard_Key _type, int _posterID, int _targetID, BotUserData *_data);
void (*pfnBotAddEntityInfo)(GameEntity _ent, EntityInfo *_info);
void (*pfnBotAddBBRecord)(BlackBoard_Key _type, int _posterID, int _targetID, obUserData *_data);
void (*pfnBotEntityAdded)(GameEntity _ent, EntityInfo *_info);
// New message stuff.
void (*pfnBotSendEventEx)(const MessageHelper &_message);
void (*pfnBotSendGlobalEventEx)(const MessageHelper &_message);
/*SubscriberHandle (*pfnSubscribeToMsg)(int _msg, pfnMessageFunction _func);
void (*pfnUnsubscribe)(const SubscriberHandle _handle);
MessageHelper (*pfnBeginMessage)(int _msgId, obuint32 _messageSize);
MessageHelper (*pfnBeginMessageEx)(int _msgId, void *_mem, obuint32 _messageSize);
void (*pfnEndMessage)(const MessageHelper &_helper);
void (*pfnEndMessageEx)(const MessageHelper &_helper);*/
void (*pfnBotSendEvent)(int _dest, const MessageHelper &_message);
void (*pfnBotSendGlobalEvent)(const MessageHelper &_message);
} Bot_EngineFuncs_t;
#endif

View file

@ -1,315 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
//
// $LastChangedBy: DrEvil $
// $LastChangedDate: 2006-10-30 20:29:29 -0800 (Mon, 30 Oct 2006) $
// $LastChangedRevision: 1312 $
//
////////////////////////////////////////////////////////////////////////////////
#ifndef __FUNCTIONS_ENGINE_H__
#define __FUNCTIONS_ENGINE_H__
#include "Omni-Bot_Types.h"
#include "Omni-Bot_BitFlags.h"
#include "Omni-Bot_Color.h"
#include "MessageHelper.h"
// Title: Functions Engine
// struct: EntityInfo
// Used to store information about an entity
typedef struct
{
// BitFlag32: m_Team
// If this != 0, this entity should only be visible to certain teams.
BitFlag32 m_Team;
// int: m_EntityClass
// The specific classification of this entity
int m_EntityClass;
// BitFlag64: m_EntityCategoty
// Current category of this entity, see <EntityCategory>
BitFlag64 m_EntityCategory;
// BitFlag64: m_EntityFlags
// Current flags of this entity, see <EntityFlags>
BitFlag64 m_EntityFlags;
// BitFlag64: m_EntityPowerups
// Current power-ups of this entity, see <Powerups>
BitFlag64 m_EntityPowerups;
} EntityInfo;
// struct: ClientInput
// Generic data structure representing the bots input and movement states
// Game is responsible for translating this into a format suitable for use
// by the game.
typedef struct
{
// float: m_Facing
// The direction the bot is facing/aiming
float m_Facing[3];
// float: m_MoveDir
// The direction the bot is moving
float m_MoveDir[3];
// int: m_ButtonFlags
// 32 bit int of bits representing bot keypresses, see <ButtonFlags>
BitFlag32 m_ButtonFlags;
// int: m_CurrentWeapon
// The current weapon Id this bot wants to use.
int m_CurrentWeapon;
} ClientInput;
// class: BotTraceResult
// This file defines all the common structures used by the game and bot alike.
class BotTraceResult
{
public:
// float: m_Fraction
// 0.0 - 1.0 how far the trace went
float m_Fraction;
// float: m_Normal
// The plane normal that was struck
float m_Normal[3];
// float: m_Endpos
// The end point the trace ended at
float m_Endpos[3];
// var: m_HitEntity
// The entity that was hit by the trace
GameEntity m_HitEntity;
// int: m_StartSolid
// Did the trace start inside a solid?
int m_StartSolid;
// int: m_Contents
// Content flags.
int m_Contents;
// int: m_iUser1
// Extra user info from the trace
int m_iUser1;
BotTraceResult() :
m_Fraction (0.f),
m_HitEntity (0),
m_StartSolid(0),
m_Contents (0),
m_iUser1 (0)
{
}
};
// typedef: Game_EngineFuncs_t
// This struct defines all the function pointers that the
// game will fill in and give to the bot so that the bot may perform generic
// actions without caring about the underlying engine or game. It is
// _ABSOLUTELY REQUIRED_ that the game not leave any of the function pointers
// set to null, even if that means using empty functions in the interface
// to set the pointers.
typedef struct
{
// Function: pfnAddBot
// This function should add a bot to the game with the name specified,
// and return the bots GameID
int (*pfnAddBot)(const char *_name, const MessageHelper *_data);
// Function: pfnRemoveBot
// This function should remove/kick a bot from the game by its name
int (*pfnRemoveBot)(const char *_name);
// Function: pfnChangeTeam
// This function should force a bot to a certain team
obResult (*pfnChangeTeam)(int _client, int _newteam, const MessageHelper *_data);
// Function: pfnChangeClass
// This function should force a bot to change to a certain class
obResult (*pfnChangeClass)(int _client, int _newclass, const MessageHelper *_data);
// Function: pfnUpdateBotInput
// This function should interpret and handle the bots input
void (*pfnUpdateBotInput)(int _client, const ClientInput *_input);
// Function: pfnBotCommand
// This function should perform a bot 'console command'
void (*pfnBotCommand)(int _client, const char *_cmd);
// Function: pfnTraceLine
// This bot should intepret and perform a traceline, returning
// the results into the <BotTraceResult> parameter.
obResult (*pfnTraceLine)(BotTraceResult *_result, const float _start[3], const float _end[3], const AABB *_pBBox , int _mask, int _user, obBool _bUsePVS);
// Function: pfnGetPointContents
// Gets the content bitflags for a location.
int (*pfnGetPointContents)(const float _pos[3]);
// Function: pfnFindEntityByClassName
// This function should return entities matching the classname, and should be
// compatible with a while loop using the _pStart and returning 0 at the end of search
GameEntity (*pfnFindEntityByClassName)(GameEntity _pStart, const char *_name);
// Function: pfnFindEntityByClassId
// This function should return entities matching the class id, and should be
// compatible with a while loop using the _pStart and returning 0 at the end of search
GameEntity (*pfnFindEntityByClassId)(GameEntity _pStart, int _classId);
// Function: pfnFindEntityInSphere
// This function should return entities matching the classname, and in a radius, and should be
// compatible with a while loop using the _pStart and returning 0 at the end of search
GameEntity (*pfnFindEntityInSphere)(const float _pos[3], float _radius, GameEntity _pStart, const char *_name);
// Function: pfnFindEntityInSphereId
// This function should return entities matching the class id, and in a radius, and should be
// compatible with a while loop using the _pStart and returning 0 at the end of search
GameEntity (*pfnFindEntityInSphereId)(const float _pos[3], float _radius, GameEntity _pStart, int classId);
// Function: pfnGetEntityFlags
// This function should return the entity flags for an entity
obResult (*pfnGetEntityFlags)(const GameEntity _ent, BitFlag64 &_flags);
// Function: pfnGetEntityPowerups
// This function should return the powerup flags for an entity.
obResult (*pfnGetEntityPowerups)(const GameEntity _ent, BitFlag64 &_flags);
// Function: pfnGetEntityEyePosition
// This function should return the eye position of an entity
obResult (*pfnGetEntityEyePosition)(const GameEntity _ent, float _pos[3]);
// Function: pfnGetEntityEyePosition
// This function should return the bone position of an entity
obResult (*pfnGetEntityBonePosition)(const GameEntity _ent, int _boneid, float _pos[3]);
// Function: pfnGetEntityOrientation
// This function should return the orientation of a <GameEntity> as fwd, right, up vectors
obResult (*pfnGetEntityOrientation)(const GameEntity _ent, float _fwd[3], float _right[3], float _up[3]);
// Function: pfnGetEntityVelocity
// This function should return the velocity of a <GameEntity> in world space
obResult (*pfnGetEntityVelocity)(const GameEntity _ent, float _velocity[3]);
// Function: pfnGetEntityPosition
// This function should return the position of a <GameEntity> in world space
obResult (*pfnGetEntityPosition)(const GameEntity _ent, float _pos[3]);
// Function: pfnGetEntityWorldAABB
// This function should return the axis aligned box of a <GameEntity> in world space
obResult (*pfnGetEntityWorldAABB)(const GameEntity _ent, AABB *_aabb);
// Function: pfnGetEntityOwner
// This function should return the <GameID> of a client that owns this item
int (*pfnGetEntityOwner)(const GameEntity _ent);
// Function: pfnGetEntityTeam
// This function should return the bot team of the entity.
int (*pfnGetEntityTeam)(const GameEntity _ent);
// Function: pfnGetEntityClass
// This function should return the bot class of the entity.
int (*pfnGetEntityClass)(const GameEntity _ent);
// Function: pfnEntityFromID
// This function should return the <GameEntity> that matches the provided Id
GameEntity (*pfnEntityFromID)(const int _id);
// Function: pfnIDFromEntity
// This function should return the Id that matches the provided <GameEntity>
int (*pfnIDFromEntity)(const GameEntity _ent);
// Function: pfnGetClientPosition
// This function should return the position of a client in world space
obResult (*pfnGetClientPosition)(int _client, float _pos[3]);
// Function: pfnGetClientOrientation
// This function should return the orientation of a <GameEntity> as fwd, right, up vectors
obResult (*pfnGetClientOrientation)(int _client, float _fwd[3], float _right[3], float _up[3]);
// Function: pfnGetClientName
// This function should give access to the in-game name of the client
const char *(*pfnGetClientName)(int _client);
// Function: pfnBotGetCurrentWeaponClip
// This function should update weapon clip count for the current weapon
obResult (*pfnBotGetCurrentWeaponClip)(int _client, FireMode _mode, int &_curclip, int &_maxclip);
// Function: pfnBotGetCurrentAmmo
// This function should update ammo stats for a client and ammotype
obResult (*pfnBotGetCurrentAmmo)(int _client, int _ammotype, int &_cur, int &_max);
// Function: pfnGetGameTime
// This function should return the current game time in milli-seconds
int (*pfnGetGameTime)();
// Function: pfnGetGoals
// This function should tell the game to register all <MapGoal>s with the bot
obResult (*pfnGetGoals)();
// Function: pfnGetThreats
// This function should tell the game to register all potential threats with the bot
// Threats include potential targets, projectiles, or other entities of interest to the bot
obResult (*pfnGetThreats)();
// Function: pfnGetMaxNumPlayers
// Gets the currently set maximum number of players from the game
int (*pfnGetMaxNumPlayers)();
// Function: pfnGetCurNumPlayers
// Gets the current number of players from the game. Combine with above?
int (*pfnGetCurNumPlayers)();
// Function: pfnInterfaceSendMessage
// This function sends a message to the game with optional <MessageHelper> in/out parameters
// to request additional or mod specific info from the game
obResult (*pfnInterfaceSendMessage)(const MessageHelper &_data, const GameEntity _ent);
// Function: pfnAddDisplayPath
// Adds a line to display between 2 positions, with a specific color, and type that determines how it is drawn
void (*pfnAddDisplayLine)(int _type, const float _start[3], const float _end[3], const obColor &_color);
// Function: pfnAddTempDisplayLine
// Adds a line to immediately display between 2 positions, with a specific color
void (*pfnAddTempDisplayLine)(const float _start[3], const float _end[3], const obColor &_color, float _time);
// Function: pfnAddDisplayRadius
// Adds a radius indicator to be displayed at a certain position with radius and color
void (*pfnAddDisplayRadius)(const float _pos[3], const float _radius, const obColor &_color, float _time);
// Function: pfnClearDebugLines
// This function tells the interface to potentially clear prior navigation or radius indicators
void (*pfnClearDebugLines)(obBool _navViewEnabled, const BitFlag32 &_flags);
// Function: pfnPrintError
// This function should print an error the the game however desired,
// whether it be to the console, messagebox,...
void (*pfnPrintError)(const char *_error);
// Function: pfnPrintMessage
// This function should print a message the the game however desired,
// whether it be to the console, messagebox,...
void (*pfnPrintMessage)(const char *_msg);
// Function: pfnPrintScreenMessage
// This function should print a message the the game screen if possible
void (*pfnPrintScreenText)(const int _client, const float _pos[3], float _duration, const obColor &_color, const char *_msg);
// Function: pfnGetMapName
// This function should give access to the name of the currently loaded map
const char *(*pfnGetMapName)();
// Function: pfnGetMapExtents
// This function gets the extents of the current map.
void (*pfnGetMapExtents)(AABB *_aabb);
// Function: pfnGetGameName
// This function should give access to the name of the currently loaded game
const char *(*pfnGetGameName)();
// Function: pfnGetModName
// This function should give access to the name of the currently loaded mod
const char *(*pfnGetModName)();
// Function: pfnGetModVers
// This function should give access to the version of the currently loaded mod
const char *(*pfnGetModVers)();
// Function: pfnGetBotPath
// This function should get the bot path to the bot dll and base path to supplemental files.
const char *(*pfnGetBotPath)();
} Game_EngineFuncs_t;
#endif

397
omnibot/IEngineInterface.h Normal file
View file

@ -0,0 +1,397 @@
////////////////////////////////////////////////////////////////////////////////
//
// $LastChangedBy: DrEvil $
// $LastChangedDate: 2007-04-04 19:17:05 -0700 (Wed, 04 Apr 2007) $
// $LastChangedRevision: 1766 $
//
////////////////////////////////////////////////////////////////////////////////
#ifndef __ENGINE_INTERFACE_H__
#define __ENGINE_INTERFACE_H__
#include "Omni-Bot_Types.h"
#include "Omni-Bot_BitFlags.h"
#include "Omni-Bot_Color.h"
#include "MessageHelper.h"
// Title: Engine Interface
// struct: EntityInfo
// Used to store information about an entity
typedef struct
{
// BitFlag32: m_Team
// If this != 0, this entity should only be visible to certain teams.
BitFlag32 m_Team;
// int: m_EntityClass
// The specific classification of this entity
int m_EntityClass;
// BitFlag64: m_EntityCategoty
// Current category of this entity, see <EntityCategory>
BitFlag64 m_EntityCategory;
// BitFlag64: m_EntityFlags
// Current flags of this entity, see <EntityFlags>
BitFlag64 m_EntityFlags;
// BitFlag64: m_EntityPowerups
// Current power-ups of this entity, see <Powerups>
BitFlag64 m_EntityPowerups;
} EntityInfo;
// struct: ClientInput
// Generic data structure representing the bots input and movement states
// Game is responsible for translating this into a format suitable for use
// by the game.
typedef struct
{
// float: m_Facing
// The direction the bot is facing/aiming
float m_Facing[3];
// float: m_MoveDir
// The direction the bot is moving
float m_MoveDir[3];
// int: m_ButtonFlags
// 64 bit int of bits representing bot keypresses, see <ButtonFlags>
BitFlag64 m_ButtonFlags;
// int: m_CurrentWeapon
// The current weapon Id this bot wants to use.
int m_CurrentWeapon;
} ClientInput;
// class: obTraceResult
// This file defines all the common structures used by the game and bot alike.
class obTraceResult
{
public:
// float: m_Fraction
// 0.0 - 1.0 how far the trace went
float m_Fraction;
// float: m_Normal
// The plane normal that was struck
float m_Normal[3];
// float: m_Endpos
// The end point the trace ended at
float m_Endpos[3];
// var: m_HitEntity
// The entity that was hit by the trace
GameEntity m_HitEntity;
// int: m_StartSolid
// Did the trace start inside a solid?
int m_StartSolid;
// int: m_Contents
// Content flags.
int m_Contents;
// int: m_Surface;
// Flags representing the surface struct by the trace.
int m_Surface;
obTraceResult() :
m_Fraction (0.f),
m_StartSolid(0),
m_Contents (0),
m_Surface (0)
{
}
};
// typedef: IEngineInterface
// This struct defines all the function pointers that the
// game will fill in and give to the bot so that the bot may perform generic
// actions without caring about the underlying engine or game. It is
// _ABSOLUTELY REQUIRED_ that the game not leave any of the function pointers
// set to null, unless otherwise noted, even if that means using empty functions in the interface
// to set the pointers.
class IEngineInterface
{
public:
// Function: AddBot
// This function should add a bot to the game with the name specified,
// and return the bots GameID
virtual int AddBot(const MessageHelper &_data) = 0;
// Function: RemoveBot
// This function should remove/kick a bot from the game by its name
virtual int RemoveBot(const char *_name) = 0;
// Function: ChangeTeam
// This function should force a bot to a certain team
virtual obResult ChangeTeam(int _client, int _newteam, const MessageHelper *_data) = 0;
// Function: ChangeClass
// This function should force a bot to change to a certain class
virtual obResult ChangeClass(int _client, int _newclass, const MessageHelper *_data) = 0;
// Function: UpdateBotInput
// This function should interpret and handle the bots input
virtual void UpdateBotInput(int _client, const ClientInput &_input) = 0;
// Function: BotCommand
// This function should perform a bot 'console command'
virtual void BotCommand(int _client, const char *_cmd) = 0;
// Function: IsInPVS
// This function should check if a target position is within pvs of another position.
virtual obBool IsInPVS(const float _pos[3], const float _target[3]) = 0;
// Function: TraceLine
// This bot should intepret and perform a traceline, returning
// the results into the <BotTraceResult> parameter.
virtual obResult TraceLine(obTraceResult &_result, const float _start[3], const float _end[3], const AABB *_pBBox , int _mask, int _user, obBool _bUsePVS) = 0;
// Function: GetPointContents
// Gets the content bitflags for a location.
virtual int GetPointContents(const float _pos[3]) = 0;
// Function: FindEntityInSphere
// This function should return entities matching the class id, and in a radius, and should be
// compatible with a while loop using the _pStart and returning 0 at the end of search
virtual GameEntity FindEntityInSphere(const float _pos[3], float _radius, GameEntity _pStart, int classId) = 0;
// Function: GetEntityClass
// This function should return the bot class of the entity.
virtual int GetEntityClass(const GameEntity _ent) = 0;
// Function: GetEntityCategory
// This function should return the bot class of the entity.
virtual obResult GetEntityCategory(const GameEntity _ent, BitFlag32 &_category) = 0;
// Function: GetEntityFlags
// This function should return the entity flags for an entity
virtual obResult GetEntityFlags(const GameEntity _ent, BitFlag64 &_flags) = 0;
// Function: GetEntityPowerups
// This function should return the powerup flags for an entity.
virtual obResult GetEntityPowerups(const GameEntity _ent, BitFlag64 &_flags) = 0;
// Function: GetEntityEyePosition
// This function should return the eye position of an entity
virtual obResult GetEntityEyePosition(const GameEntity _ent, float _pos[3]) = 0;
// Function: GetEntityEyePosition
// This function should return the bone position of an entity
virtual obResult GetEntityBonePosition(const GameEntity _ent, int _boneid, float _pos[3]) = 0;
// Function: GetEntityOrientation
// This function should return the orientation of a <GameEntity> as fwd, right, up vectors
virtual obResult GetEntityOrientation(const GameEntity _ent, float _fwd[3], float _right[3], float _up[3]) = 0;
// Function: GetEntityVelocity
// This function should return the velocity of a <GameEntity> in world space
virtual obResult GetEntityVelocity(const GameEntity _ent, float _velocity[3]) = 0;
// Function: GetEntityPosition
// This function should return the position of a <GameEntity> in world space
virtual obResult GetEntityPosition(const GameEntity _ent, float _pos[3]) = 0;
// Function: GetEntityWorldAABB
// This function should return the axis aligned box of a <GameEntity> in world space
virtual obResult GetEntityWorldAABB(const GameEntity _ent, AABB &_aabb) = 0;
// Function: GetEntityOwner
// This function should return the <GameID> of a client that owns this item
virtual int GetEntityOwner(const GameEntity _ent) = 0;
// Function: GetEntityTeam
// This function should return the bot team of the entity.
virtual int GetEntityTeam(const GameEntity _ent) = 0;
// Function: GetClientName
// This function should give access to the in-game name of the client
virtual const char *GetEntityName(const GameEntity _ent) = 0;
// Function: GetCurrentWeaponClip
// This function should update weapon clip count for the current weapon
virtual obResult GetCurrentWeaponClip(const GameEntity _ent, FireMode _mode, int &_curclip, int &_maxclip) = 0;
// Function: BotGetCurrentAmmo
// This function should update ammo stats for a client and ammotype
virtual obResult GetCurrentAmmo(const GameEntity _ent, int _ammotype, int &_cur, int &_max) = 0;
// Function: GetGameTime
// This function should return the current game time in milli-seconds
virtual int GetGameTime() = 0;
// Function: GetGoals
// This function should tell the game to register all <MapGoal>s with the bot
virtual void GetGoals() = 0;
// Function: GetMaxNumPlayers
// Gets the currently set maximum number of players from the game
virtual int GetMaxNumPlayers() = 0;
// Function: GetCurNumPlayers
// Gets the current number of players from the game. Combine with above?
virtual int GetCurNumPlayers() = 0;
// Function: InterfaceSendMessage
// This function sends a message to the game with optional <MessageHelper> in/out parameters
// to request additional or mod specific info from the game
virtual obResult InterfaceSendMessage(const MessageHelper &_data, const GameEntity _ent) = 0;
// Function: AddTempDisplayLine
// Adds a line to immediately display between 2 positions, with a specific color
virtual bool DebugLine(const float _start[3], const float _end[3], const obColor &_color, float _time)
{ _start; _end; _color; _time; return false; }
// Function: DebugRadius
// Adds a radius indicator to be displayed at a certain position with radius and color
virtual bool DebugRadius(const float _pos[3], const float _radius, const obColor &_color, float _time)
{ _pos; _radius; _color; _time; return false; }
// Function: PrintError
// This function should print an error the the game however desired,
// whether it be to the console, messagebox,...
virtual void PrintError(const char *_error) = 0;
// Function: PrintMessage
// This function should print a message the the game however desired,
// whether it be to the console, messagebox,...
virtual void PrintMessage(const char *_msg) = 0;
// Function: PrintScreenMessage
// This function should print a message the the game screen if possible
virtual void PrintScreenText(const float _pos[3], float _duration, const obColor &_color, const char *_msg) = 0;
// Function: GetMapName
// This function should give access to the name of the currently loaded map
virtual const char *GetMapName() = 0;
// Function: GetMapExtents
// This function gets the extents of the current map.
virtual void GetMapExtents(AABB &_aabb) = 0;
// Function: EntityFromID
// This function should return the <GameEntity> that matches the provided Id
virtual GameEntity EntityFromID(const int _gameId) = 0;
// Function: IDFromEntity
// This function should return the Id that matches the provided <GameEntity>
virtual int IDFromEntity(const GameEntity _ent) = 0;
// Function: DoesEntityStillExist
// Checks to see if the entity that corresponds to a handle still exists.
virtual bool DoesEntityStillExist(const GameEntity &_hndl) = 0;
// Function: GetAutoNavFeatures
// Gets information from the game that is used to automatically place navigation.
virtual int GetAutoNavFeatures(AutoNavFeature *_feature, int _max) = 0;
// Function: GetGameName
// This function should give access to the name of the currently loaded game
virtual const char *GetGameName() = 0;
// Function: GetModName
// This function should give access to the name of the currently loaded mod
virtual const char *GetModName() = 0;
// Function: GetModVers
// This function should give access to the version of the currently loaded mod
virtual const char *GetModVers() = 0;
// Function: GetBotPath
// This function should get the bot path to the bot dll and base path to supplemental files.
virtual const char *GetBotPath() = 0;
// Function: GetLogPath
// This function should get the log path to the bot dll and base path to supplemental files.
virtual const char *GetLogPath() = 0;
};
//class SkeletonInterface : public IEngineInterface
//{
//public:
// virtual int AddBot(const MessageHelper &_data) = 0;
//
// virtual int RemoveBot(const char *_name) = 0;
//
// virtual obResult ChangeTeam(int _client, int _newteam, const MessageHelper *_data) = 0;
//
// virtual obResult ChangeClass(int _client, int _newclass, const MessageHelper *_data) = 0;
//
// virtual void UpdateBotInput(int _client, const ClientInput &_input) = 0;
//
// virtual void BotCommand(int _client, const char *_cmd) = 0;
//
// virtual obBool IsInPVS(const float _pos[3], const float _target[3]) = 0;
//
// virtual obResult TraceLine(obTraceResult &_result, const float _start[3], const float _end[3], const AABB *_pBBox , int _mask, int _user, obBool _bUsePVS) = 0;
//
// virtual int GetPointContents(const float _pos[3]) = 0;
//
// virtual GameEntity FindEntityInSphere(const float _pos[3], float _radius, GameEntity _pStart, int classId) = 0;
//
// virtual int GetEntityClass(const GameEntity _ent) = 0;
//
// virtual obResult GetEntityCategory(const GameEntity _ent, BitFlag32 &_category) = 0;
//
// virtual obResult GetEntityFlags(const GameEntity _ent, BitFlag64 &_flags) = 0;
//
// virtual obResult GetEntityPowerups(const GameEntity _ent, BitFlag64 &_flags) = 0;
//
// virtual obResult GetEntityEyePosition(const GameEntity _ent, float _pos[3]) = 0;
//
// virtual obResult GetEntityBonePosition(const GameEntity _ent, int _boneid, float _pos[3]) = 0;
//
// virtual obResult GetEntityOrientation(const GameEntity _ent, float _fwd[3], float _right[3], float _up[3]) = 0;
//
// virtual obResult GetEntityVelocity(const GameEntity _ent, float _velocity[3]) = 0;
//
// virtual obResult GetEntityPosition(const GameEntity _ent, float _pos[3]) = 0;
//
// virtual obResult GetEntityWorldAABB(const GameEntity _ent, AABB &_aabb) = 0;
//
// virtual int GetEntityOwner(const GameEntity _ent) = 0;
//
// virtual int GetEntityTeam(const GameEntity _ent) = 0;
//
// virtual const char *GetEntityName(const GameEntity _ent) = 0;
//
// virtual obResult GetCurrentWeaponClip(const GameEntity _ent, FireMode _mode, int &_curclip, int &_maxclip) = 0;
//
// virtual obResult GetCurrentAmmo(const GameEntity _ent, int _ammotype, int &_cur, int &_max) = 0;
//
// virtual int GetGameTime() = 0;
//
// virtual void GetGoals() = 0;
//
// virtual void GetThreats() = 0;
//
// virtual int GetMaxNumPlayers() = 0;
//
// virtual int GetCurNumPlayers() = 0;
//
// virtual obResult InterfaceSendMessage(const MessageHelper &_data, const GameEntity _ent) = 0;
//
// virtual bool DebugLine(const float _start[3], const float _end[3], const obColor &_color, float _time)
// {
// }
//
// virtual bool DebugRadius(const float _pos[3], const float _radius, const obColor &_color, float _time)
// {
// }
//
// virtual void PrintError(const char *_error) = 0;
//
// virtual void PrintMessage(const char *_msg) = 0;
//
// virtual void PrintScreenText(const float _pos[3], float _duration, const obColor &_color, const char *_msg) = 0;
//
// virtual const char *GetMapName() = 0;
//
// virtual void GetMapExtents(AABB &_aabb) = 0;
//
// virtual GameEntity EntityFromID(const int _gameId) = 0;
//
// virtual int IDFromEntity(const GameEntity _ent) = 0;
//
// virtual const char *GetGameName() = 0;
//
// virtual const char *GetModName() = 0;
//
// virtual const char *GetModVers() = 0;
//
// virtual const char *GetBotPath() = 0;
//
// virtual const char *GetLogPath() = 0;
//};
#endif

View file

@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////////////////////////
//
// $LastChangedBy: DrEvil $
// $LastChangedDate: 2006-04-14 21:53:05 -0400 (Fri, 14 Apr 2006) $
// $LastChangedRevision: 1171 $
// $LastChangedDate: 2007-03-07 08:28:59 -0800 (Wed, 07 Mar 2007) $
// $LastChangedRevision: 1697 $
//
////////////////////////////////////////////////////////////////////////////////
@ -38,12 +38,12 @@ public:
return static_cast<Type*>(m_pVoid);
}
/*template<class Type>
const Type *Get() const
template<class Type>
void Get2(Type *&_p) const
{
assert(sizeof(Type) <= m_BlockSize && "Memory Block Too Small!");
return static_cast<const Type*>(m_pVoid);
}*/
assert(sizeof(Type) == m_BlockSize && "Memory Block Doesn't match!");
_p = static_cast<Type*>(m_pVoid);
}
int GetMessageId() const { return m_MessageId; }
@ -52,7 +52,7 @@ public:
return (m_MessageId != 0);
}
MessageHelper(int _msgId, void *_void, obuint32 _size) :
MessageHelper(int _msgId, void *_void = 0, obuint32 _size = 0) :
m_MessageId (_msgId),
m_pVoid (_void),
m_BlockSize (_size)

View file

@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////////////////////////
//
// $LastChangedBy: DrEvil $
// $LastChangedDate: 2006-09-19 19:31:58 -0700 (Tue, 19 Sep 2006) $
// $LastChangedRevision: 1277 $
// $LastChangedDate: 2007-06-07 09:51:52 -0700 (Thu, 07 Jun 2007) $
// $LastChangedRevision: 1973 $
//
// about: Exported function definitions
// In order for the game to call functions from the bot, we must export
@ -14,52 +14,40 @@
#define __OMNIBOT_H__
#include "Functions_Bot.h"
#include "Functions_Engine.h"
#include "Omni-Bot_Types.h"
#include "Omni-Bot_Events.h"
#include "MessageHelper.h"
#include "IEngineInterface.h"
// function: Bot_Initialise
// function: BotInitialise
// Initializes the bot library and sets the bot up with the callbacks to
// the game in the form of function pointers to functions within the game.
omnibot_error BotInitialise(const NavigatorID _navid, const Game_EngineFuncs_t *_pEngineFuncs, int _version);
// function: Bot_Shutdown
omnibot_error BotInitialise(IEngineInterface *_pEngineFuncs, int _version);
// function: BotShutdown
// Shuts down and frees memory from the bot system
void BotShutdown();
// function: Bot_Update
// function: BotUpdate
// Called regularly by the game in order for the bots to perform their "thinking"
void BotUpdate();
// function: Bot_ConsoleCommand
// function: BotConsoleCommand
// Any time commands from the game are executed, this will get called
// to allow the bot to process it and perform any necessary actions.
int BotConsoleCommand(const char *_cmd, int _size);
// function: Bot_AddGoal
// function: BotAddGoal
// Allows the game to register a goal with the bot that the bots can use
obint32 BotAddGoal(const GameEntity _ent, int _goaltype, int _team, const char *_tag, BotUserData *_bud);
// function: Bot_AddBBRecord
void BotAddGoal(const GameEntity _ent, int _goaltype, int _team, const char *_tag, obUserData *_bud);
// function: BotAddBBRecord
// Allows the game to enter blackboard records into the bots knowledge database.
void BotAddBBRecord(BlackBoard_Key _type, int _posterID, int _targetID, BotUserData *_data);
// function: Bot_AddTargetEntity
// This adds the provided entity to the bots threat list.
// This could be other bots/clients/projectiles
void BotAddThreatEntity(GameEntity _ent, EntityInfo *_info);
// function: Bot_SendEvent
// Allows the game to send generic events to the bots to signal game events
void BotSendEvent(int _eid, int _dest, int _source, int _msdelay, BotUserData *_data);
// function: Bot_SendGlobalEvent
// Allows the game to send generic events to everyone
void BotSendGlobalEvent(int _eid, int _source, int _msdelay, BotUserData *_data);
// function: Bot_SendTrigger
void BotAddBBRecord(BlackBoard_Key _type, int _posterID, int _targetID, obUserData *_data);
// function: BotSendTrigger
// Allows the game to notify the bot of triggered events.
void BotSendTrigger(TriggerInfo *_triggerInfo);
// function: BotSendEventEx
// function: BotSendEvent
// New Messagehelper based event handler.
void BotSendEventEx(const MessageHelper &_message);
// function: BotSendGlobalEventEx
void BotSendEvent(int _dest, const MessageHelper &_message);
// function: BotSendGlobalEvent
// New Messagehelper based event handler.
void BotSendGlobalEventEx(const MessageHelper &_message);
void BotSendGlobalEvent(const MessageHelper &_message);
//SubscriberHandle Message_SubscribeToMsg(int _msg, pfnMessageFunction _func);
//void Message_Unsubscribe(const SubscriberHandle _handle);

View file

@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////////////////////////
//
// $LastChangedBy: DrEvil $
// $LastChangedDate: 2006-10-09 21:51:59 -0700 (Mon, 09 Oct 2006) $
// $LastChangedRevision: 1304 $
// $LastChangedDate: 2007-07-15 13:06:41 -0700 (Sun, 15 Jul 2007) $
// $LastChangedRevision: 2094 $
//
////////////////////////////////////////////////////////////////////////////////
@ -52,10 +52,21 @@ public:
bf &= rhs;
return bf;
}
bool operator<(obint32 _rhs) const
{
return m_Flags < _rhs;
}
bool operator==(const BitFlag32& r) const
{
return m_Flags==r.m_Flags;
}
bool operator!=(const BitFlag32& r) const
{
return m_Flags!=r.m_Flags;
}
explicit BitFlag32(obint32 flgs = 0) : m_Flags(flgs) {}
private:
obint32 m_Flags;
//obint32 m_Persistant;
};
class BitFlag64
@ -100,10 +111,32 @@ public:
bf &= rhs;
return bf;
}
BitFlag64& operator|=(const BitFlag64& rhs)
{
m_Flags |= rhs.m_Flags;
return *this;
}
BitFlag64 operator|(const BitFlag64& rhs) const
{
BitFlag64 bf(*this);
bf |= rhs;
return bf;
}
bool operator<(obint64 _rhs) const
{
return m_Flags < _rhs;
}
bool operator==(const BitFlag64& r) const
{
return m_Flags==r.m_Flags;
}
bool operator!=(const BitFlag64& r) const
{
return m_Flags!=r.m_Flags;
}
explicit BitFlag64(obint64 flgs = 0) : m_Flags(flgs) {}
private:
obint64 m_Flags;
//obint64 m_Persistant;
};

View file

@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////////////////////////
//
// $LastChangedBy: DrEvil $
// $LastChangedDate: 2006-08-11 09:08:58 -0700 (Fri, 11 Aug 2006) $
// $LastChangedRevision: 1243 $
// $LastChangedDate: 2007-01-06 17:41:11 -0800 (Sat, 06 Jan 2007) $
// $LastChangedRevision: 1491 $
//
////////////////////////////////////////////////////////////////////////////////
@ -24,7 +24,7 @@ public:
cdata.m_RGBA[2] = 255;
cdata.m_RGBA[3] = 255; // 255 is opaque, 0 is transparent
}
obColor(unsigned int _color)
obColor(obint32 _color)
{
cdata.m_RGBAi = _color;
}

View file

@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////////////////////////
//
// $LastChangedBy: DrEvil $
// $LastChangedDate: 2006-11-16 21:34:50 -0800 (Thu, 16 Nov 2006) $
// $LastChangedRevision: 1320 $
// $LastChangedDate: 2007-07-16 08:13:17 -0700 (Mon, 16 Jul 2007) $
// $LastChangedRevision: 2099 $
//
// about: Generic Bot Events
//
@ -19,9 +19,6 @@ typedef enum
EVENT_ID_UNDEFINED = 0,
SYSTEM_ID_FIRST,
SYSTEM_INIT,
SYSTEM_UPDATE,
SYSTEM_SHUTDOWN,
SYSTEM_THREAD_CREATED,
SYSTEM_THREAD_DESTROYED,
SYSTEM_ID_LAST,
@ -31,19 +28,19 @@ typedef enum
GAME_ID_ENDGAME,
GAME_ID_NEWROUND,
GAME_ID_ENDROUND,
GAME_ID_BOTCONNECTED,
GAME_ID_BOTDISCONNECTED,
GAME_ID_CLIENTCONNECTED,
GAME_ID_CLIENTDISCONNECTED,
GAME_ID_ENTITYCREATED,
GAME_ID_ENTITYDELETED,
GAME_ID_START_TRAINING,
GAME_ID_GRAVITY,
GAME_ID_CHEATS,
GAME_ID_LAST,
EVENT_ID_FIRST,
// Actions
ACTION_ID_FIRST,
ACTION_WEAPON_FIRE,
ACTION_WEAPON_FIRE_PROJECTILE,
ACTION_WEAPON_CHANGE,
ACTION_ID_LAST,
@ -51,6 +48,10 @@ typedef enum
GOAL_SUCCESS,
GOAL_FAILED,
GOAL_ABORTED,
PATH_SUCCESS,
PATH_FAILED,
AIM_SUCCESS,
GOAL_ID_LAST,
// Messages that are passed around between any objects
@ -60,40 +61,30 @@ typedef enum
MESSAGE_INVALIDTEAM,
MESSAGE_INVALIDCLASS,
MESSAGE_CHANGECLASS,
MESSAGE_NEEDITEM,
MESSAGE_TRIGGER, // passed to a "behavior" to indicate it's sensor has triggered
MESSAGE_DAMAGE, // inform the object that it has to take damage
MESSAGE_DEATH,
MESSAGE_HEAL,
MESSAGE_CHAT, // used to send text msg between objects
MESSAGE_POWERUP, // power up was picked up
MESSAGE_HEALED,
MESSAGE_REVIVED,
MESSAGE_KILLEDSOMEONE,
MESSAGE_ADDWEAPON, // gives a weapon to the bot, should add to list to be evaluated for use
MESSAGE_REMOVEWEAPON, // remove a weapon from the bots inventory
MESSAGE_RESETWEAPONS, // tells the bot to clear out all the weapons
MESSAGE_SPECTATED,
MESSAGE_KILLEDSOMEONE,
MESSAGE_REFRESHWEAPONPTRS,
MESSAGE_SPECTATED,
MESSAGE_AIMCOMPLETED,
MESSAGE_ID_LAST,
COMMAND_ID_FIRST,
COMMAND_GOTO,
COMMAND_DEFEND,
COMMAND_ATTACK,
COMMAND_ID_LAST,
// Percepts (senses: feel, see, hear, smell, )
PERCEPT_ID_FIRST,
PERCEPT_FEEL_PLAYER_USE,
PERCEPT_FEEL_TOUCH_PLAYER,
PERCEPT_FEEL_PAIN,
PERCEPT_SEE_ENEMY_FOOT_PRINT,
PERCEPT_HEAR_SOUND,
PERCEPT_HEAR_GLOBALVOICEMACRO,
PERCEPT_HEAR_TEAMVOICEMACRO,
PERCEPT_HEAR_PRIVATEVOICEMACRO,
PERCEPT_HEAR_GLOBALCHATMSG,
PERCEPT_HEAR_TEAMCHATMSG,
PERCEPT_HEAR_PRIVCHATMSG,
PERCEPT_HEAR_SOUND,
PERCEPT_SENSE_ENTITY,
PERCEPT_ID_LAST,
EVENT_ID_LAST,
EVENT_NUM_EVENTS
@ -103,12 +94,14 @@ typedef enum
// enumerations: GameMessage
// GEN_MSG_NONE - Invalid message reserved as 0.
// GEN_MSG_ADDBOT - Bot adding info.
// GEN_MSG_ISALIVE - Is the entity alive?
// GEN_MSG_ISRELOADING - Is the entity reloading?
// GEN_MSG_ISREADYTOFIRE - Is the entity ready to fire?
// GEN_MSG_ISALLIED - Is the entity allied with another?
// GEN_MSG_ISHUMAN - Is the entity a human player?
// GEN_MSG_ISOUTSIDE - Is this position outdoors?
// GEN_MSG_GETEQUIPPEDWEAPON - Get the currently equipped weapon id for an entity.
// GEN_MSG_GETMOUNTEDWEAPON - Gets the weapon id for any weapon the bot is mounted and controlling.
// GEN_MSG_GETHEALTHARMOR - Get health and armor for an entity.
// GEN_MSG_GETMAXSPEED - Get the max speed of the entity.
// GEN_MSG_GETFLAGSTATE - Get the current state of the flag.
@ -117,19 +110,26 @@ typedef enum
// GEN_MSG_TEAMSCORE - Get current team score of a team.
// GEN_MSG_WPCHARGED - Is the weapon charged?
// GEN_MSG_WPHEATLEVEL - Get the weapon heat level.
// GEN_MSG_ENTITYKILL - Kill a passed in entity, cheat protected.
// GEN_MSG_SERVERCOMMAND - Execute a server command.
typedef enum
{
GEN_MSG_NONE = 0,
GEN_MSG_ADDBOT,
GEN_MSG_ISALIVE,
GEN_MSG_ISRELOADING,
GEN_MSG_ISREADYTOFIRE,
GEN_MSG_ISALLIED,
GEN_MSG_ISHUMAN,
GEN_MSG_ISOUTSIDE,
GEN_MSG_CHANGENAME,
GEN_MSG_GETEQUIPPEDWEAPON,
GEN_MSG_GETMOUNTEDWEAPON,
GEN_MSG_GETWEAPONLIMITS,
GEN_MSG_GETHEALTHARMOR,
GEN_MSG_GETMAXSPEED,
GEN_MSG_GETFLAGSTATE,
GEN_MSG_GETCONTROLLINGTEAM,
GEN_MSG_GAMESTATE,
GEN_MSG_ENTITYSTAT,
@ -138,6 +138,9 @@ typedef enum
GEN_MSG_WPCHARGED,
GEN_MSG_WPHEATLEVEL,
GEN_MSG_ENTITYKILL,
GEN_MSG_SERVERCOMMAND,
// This must stay last.
GEN_MSG_END
} GEN_GameMessage;
@ -149,9 +152,12 @@ typedef enum
{
bbk_All = 0,
bbk_DelayGoal,
bbk_IsTaken,
bbk_RunAway,
// This must stay last.
bbk_LastKey,
bbk_FirstScript,
} BlackBoard_Key;
#endif

View file

@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////////////////////////
//
// $LastChangedBy: DrEvil $
// $LastChangedDate: 2006-11-08 09:31:09 -0800 (Wed, 08 Nov 2006) $
// $LastChangedRevision: 1316 $
// $LastChangedDate: 2007-07-23 20:42:20 -0700 (Mon, 23 Jul 2007) $
// $LastChangedRevision: 2119 $
//
////////////////////////////////////////////////////////////////////////////////
@ -26,6 +26,7 @@ typedef enum eomnibot_error
BOT_ERROR_CANTINITBOT,
BOT_ERROR_BAD_INTERFACE,
BOT_ERROR_WRONGVERSION,
BOT_ERROR_FILESYSTEM,
// THIS MUST STAY LAST
BOT_NUM_ERRORS
@ -42,7 +43,51 @@ typedef enum eMessageType
// typedef: GameEntity
// Represents an entity to the bot for every game.
typedef obvoidp GameEntity;
class GameEntity
{
public:
obint16 GetIndex() const { return udata.m_Short[0]; }
obint16 GetSerial() const { return udata.m_Short[1]; }
obint32 AsInt() const { return udata.m_Int; }
void FromInt(obint32 _n) { udata.m_Int = _n; }
void Reset()
{
*this = GameEntity();
}
bool IsValid() const
{
return udata.m_Short[0] >= 0;
}
bool operator!=(const GameEntity& _2) const
{
return udata.m_Int != _2.udata.m_Int;
}
bool operator==(const GameEntity& _2) const
{
return udata.m_Int == _2.udata.m_Int;
}
explicit GameEntity(obint16 _index, obint16 _serial)
{
udata.m_Short[0] = _index;
udata.m_Short[1] = _serial;
}
GameEntity()
{
udata.m_Short[0] = -1;
udata.m_Short[1] = 0;
}
private:
union udatatype
{
obint32 m_Int;
obint16 m_Short[2];
} udata;
};
// typedef: GameId
// A numeric value for an entities game id. Usually an array index of some sort.
@ -82,7 +127,8 @@ typedef enum eobResult
OutOfPVS,
UnableToAddBot,
InvalidEntity,
InvalidParameter
InvalidParameter,
UnknownMessageType,
} obResult;
#ifdef __cplusplus
@ -112,38 +158,34 @@ typedef enum eFireMode
InvalidFireMode
} FireMode;
// enumerations: WeaponType
// INVALID_WEAPON - Used for invalid weapon id.
typedef enum eWeaponType
{
INVALID_WEAPON = 0,
} WeaponType;
// enumerations: Q4_AmmoType
// Q4_AMMO_ROCKETS - Rockets for RPG
// enumerations: AmmoType
// INVALID_AMMO - Used for invalid ammo types.
typedef enum eAmmoType
{
AMMO_NONE = -1,
INVALID_AMMO = 0,
} AmmoType;
// enumerations: BotDebugFlag
// BOT_DEBUG_LOG - Debug log for this bot.
// BOT_DEBUG_MOVEVEC - Draw the move vector.
// BOT_DEBUG_AIMPOINT - Draw a line to the aim point.
// BOT_DEBUG_GOALS - Output info about the bot goals.
// BOT_DEBUG_SENSORY - Draw lines to sensed entities.
// BOT_DEBUG_BRAIN - Output info from the bot brain.
// BOT_DEBUG_WEAPON - Output info about weapon system.
// BOT_DEBUG_SCRIPT - Output info about bot script events/signals.
// BOT_DEBUG_EVENTS - Output Event info.
// BOT_DEBUG_FPINFO - Output first person info.
// BOT_DEBUG_EVENTS - Print out events bot recieves.
typedef enum eBotDebugFlag
{
BOT_DEBUG_LOG = 0,
BOT_DEBUG_MOVEVEC,
BOT_DEBUG_AIMPOINT,
BOT_DEBUG_GOALS,
BOT_DEBUG_SENSORY,
BOT_DEBUG_BRAIN,
BOT_DEBUG_WEAPON,
BOT_DEBUG_SCRIPT,
BOT_DEBUG_EVENTS,
BOT_DEBUG_FPINFO,
BOT_DEBUG_PLANNER,
BOT_DEBUG_EVENTS,
// THIS MUST STAY LAST
NUM_BOT_DEBUG_FLAGS = 16,
@ -162,23 +204,6 @@ typedef enum eHelpers
RANDOM_TEAM_IF_NO_TEAM = -2,
} Helpers;
// enumerations: obLineTypes
// LINE_NONE - Null line
// LINE_NORMAL - Normal line.
// LINE_WAYPOINT - Waypoint line.
// LINE_PATH - Path line.
// LINE_BLOCKABLE - Blockable line.
// LINE_FACING - The facing of a waypoint.
typedef enum eLineType
{
LINE_NONE,
LINE_NORMAL,
LINE_WAYPOINT,
LINE_PATH,
LINE_BLOCKABLE,
LINE_FACING,
} LineType;
// typedef: AABB
// Represents the axis aligned bounding box of an object
typedef struct AABB_t
@ -199,6 +224,17 @@ typedef struct AABB_t
DIR_ALL,
};
bool IsZero() const
{
for(int i = 0; i < 3; ++i)
{
if(m_Mins[i] != 0.f ||
m_Maxs[i] != 0.f)
return false;
}
return true;
}
void Set(const float _pt[3])
{
for(int i = 0; i < 3; ++i)
@ -211,8 +247,10 @@ typedef struct AABB_t
{
for(int i = 0; i < 3; ++i)
{
m_Mins[i] = _min[i];
m_Maxs[i] = _max[i];
m_Mins[i] = _min[i] < _max[i] ? _min[i] : _max[i];
m_Maxs[i] = _min[i] > _max[i] ? _min[i] : _max[i];
/*m_Mins[i] = _min[i];
m_Maxs[i] = _max[i];*/
}
}
void CenterPoint(float _out[3]) const
@ -252,7 +290,6 @@ typedef struct AABB_t
m_Maxs[i] = _pt[i];
}
}
bool Intersects(const AABB_t &_bbox) const
{
for (int i = 0; i < 3; i++)
@ -262,8 +299,7 @@ typedef struct AABB_t
}
return true;
}
bool Intersects(const float _pt[3]) const
bool Contains(const float _pt[3]) const
{
for (int i = 0; i < 3; i++)
{
@ -272,7 +308,6 @@ typedef struct AABB_t
}
return true;
}
bool FindIntersection(const AABB_t &_bbox, AABB_t& _overlap) const
{
if(Intersects(_bbox))
@ -293,12 +328,22 @@ typedef struct AABB_t
}
return false;
}
float GetAxisLength(int _axis) const
{
return m_Maxs[_axis] - m_Mins[_axis];
}
float GetArea() const
{
return GetAxisLength(0) * GetAxisLength(1) * GetAxisLength(2);
}
float DistanceFromBottom(const float _pt[3]) const
{
return -(m_Mins[2] - _pt[2]);
}
float DistanceFromTop(const float _pt[3]) const
{
return (m_Maxs[2] - _pt[2]);
}
void Scale(float _scale)
{
for(int i = 0; i < 3; ++i)
@ -307,26 +352,46 @@ typedef struct AABB_t
m_Maxs[i] *= _scale;
}
}
void Expand(float _expand)
{
for(int i = 0; i < 3; ++i)
{
m_Mins[i] -= _expand;
m_Maxs[i] += _expand;
}
}
void ExpandAxis(int _axis, float _expand)
{
m_Mins[_axis] -= _expand;
m_Maxs[_axis] += _expand;
}
void FlipHorizontalAxis()
{
for(int i = 0; i < 2; ++i)
{
float tmp = m_Mins[i];
m_Mins[i] = m_Maxs[i];
m_Maxs[i] = tmp;
}
}
void GetBottomCorners(float _bl[3], float _tl[3], float _tr[3], float _br[3])
{
_bl[0] = m_Mins[0];
_bl[1] = m_Mins[1];
_bl[2] = m_Mins[2];
_bl[2] = m_Mins[0];
_tl[0] = m_Mins[0];
_tl[1] = m_Maxs[1];
_tl[2] = m_Mins[2];
_tl[2] = m_Mins[0];
_tr[0] = m_Maxs[0];
_tr[1] = m_Maxs[1];
_tr[2] = m_Mins[2];
_tr[2] = m_Mins[0];
_br[0] = m_Maxs[0];
_br[1] = m_Mins[1];
_br[2] = m_Mins[2];
_br[2] = m_Mins[0];
}
void GetTopCorners(float _bl[3], float _tl[3], float _tr[3], float _br[3])
{
GetBottomCorners(_bl, _tl, _tr, _br);
@ -335,7 +400,6 @@ typedef struct AABB_t
_tr[2] = m_Maxs[2];
_br[2] = m_Maxs[2];
}
void Translate(const float _pos[3])
{
for(int i = 0; i < 3; ++i)
@ -344,7 +408,14 @@ typedef struct AABB_t
m_Maxs[i] += _pos[i];
}
}
void UnTranslate(const float _pos[3])
{
for(int i = 0; i < 3; ++i)
{
m_Mins[i] -= _pos[i];
m_Maxs[i] -= _pos[i];
}
}
AABB_t TranslateCopy(const float _pos[3]) const
{
AABB_t aabb = *this;
@ -355,7 +426,6 @@ typedef struct AABB_t
}
return aabb;
}
AABB_t(const float _mins[3], const float _maxs[3])
{
Set(_mins, _maxs);
@ -366,6 +436,11 @@ typedef struct AABB_t
}
AABB_t()
{
for(int i = 0; i < 3; ++i)
{
m_Mins[i] = 0.f;
m_Maxs[i] = 0.f;
}
}
#endif
} AABB;
@ -388,6 +463,7 @@ typedef struct AABB_t
// BOT_BUTTON_LEANLEFT - If the bot wants to lean left.
// BOT_BUTTON_LEANRIGHT - If the bot wants to lean right.
// BOT_BUTTON_AIM - If the bot wants to drop current item.
// BOT_BUTTON_RESPAWN - Bot wants to respawn.
typedef enum eButtonFlags
{
BOT_BUTTON_ATTACK1 = 0,
@ -407,6 +483,7 @@ typedef enum eButtonFlags
BOT_BUTTON_LEANLEFT,
BOT_BUTTON_LEANRIGHT,
BOT_BUTTON_AIM,
BOT_BUTTON_RESPAWN,
// THIS MUST BE LAST
BOT_BUTTUN_FIRSTUSER
@ -421,9 +498,10 @@ typedef enum eButtonFlags
// GOAL_ATTACK - The bot should just go to this goal and hunt for targets.
// GOAL_SNIPE - The bot should snipe from this point.
// GOAL_CTF_FLAG - The bot should attempt to grab this flag and return it to a capture point.
// GOAL_CTF_RETURN_FLAG - The bot should attempt to touch this flag to 'return' it.
// GOAL_CTF_FLAGCAP - The bot should take GOAL_CTF_FLAG to this point.
// GOAL_CTF_RETURN_FLAG - The bot should attempt to touch this flag to 'return' it.
// GOAL_SCRIPT - A script should be ran for this goal.
// GOAL_ROUTEPT - A start region for a route point.
typedef enum eGoalType
{
GOAL_NONE = 0,
@ -435,9 +513,12 @@ typedef enum eGoalType
GOAL_ATTACK,
GOAL_SNIPE,
GOAL_CTF_FLAG,
GOAL_CTF_RETURN_FLAG,
GOAL_CTF_FLAGCAP,
GOAL_CTF_HOLDCAP,
GOAL_CTF_RETURN_FLAG,
GOAL_SCRIPT,
GOAL_ROUTEPT,
GOAL_TRAININGSPAWN,
// THIS MUST BE LAST
BASE_GOAL_NUM = 1000
@ -465,7 +546,6 @@ typedef enum eBasicGoals
goal_defend,
goal_attack,
goal_ride_movable,
goal_hunt_target,
/*goal_think,
goal_explore,
@ -494,6 +574,7 @@ typedef enum eBasicGoals
// ENT_FLAG_TEAM2 - This entity is only available/visible for team 2
// ENT_FLAG_TEAM3 - This entity is only available/visible for team 3
// ENT_FLAG_TEAM4 - This entity is only available/visible for team 4
// ENT_FLAG_VISTEST - The entity should be vis tested. Otherwise uses disabled flag.
// ENT_FLAG_DISABLED - Entity is disabled
// ENT_FLAG_PRONED - This entity is prone
// ENT_FLAG_CROUCHED - This entity is crouched
@ -505,13 +586,16 @@ typedef enum eBasicGoals
// ENT_FLAG_ONLADDER - This entity is on a ladder.
// ENT_FLAG_ONGROUND - Entity is standing on the ground
// ENT_FLAG_RELOADING - Entity is currently reloading
// ENT_FLAG_ON_ICE - Entity on slippery surface.
// ENT_FLAG_HUMANCONTROLLED - Human player controls this entity.
typedef enum eEntityFlag
{
ENT_FLAG_TEAM1,
ENT_FLAG_TEAM2,
ENT_FLAG_TEAM3,
ENT_FLAG_TEAM4,
ENT_FLAG_DISABLED,
ENT_FLAG_VISTEST,
ENT_FLAG_DISABLED,
ENT_FLAG_PRONED,
ENT_FLAG_CROUCHED,
ENT_FLAG_CARRYABLE,
@ -522,6 +606,8 @@ typedef enum eEntityFlag
ENT_FLAG_ONLADDER,
ENT_FLAG_ONGROUND,
ENT_FLAG_RELOADING,
ENT_FLAG_ON_ICE,
ENT_FLAG_HUMANCONTROLLED,
// THIS MUST BE LAST
ENT_FLAG_FIRST_USER = 32
@ -540,6 +626,7 @@ typedef enum ePowerups
// enumerations: EntityCategory
// ENT_CAT_PLAYER - This entity is a player of some sort.
// ENT_CAT_VEHICLE - Vehicle entity.
// ENT_CAT_PROJECTILE - This entity is a projectile of some sort.
// ENT_CAT_SHOOTABLE - This entity is shootable.
// ENT_CAT_PICKUP - This entity is a pickup/powerup of some sort.
@ -552,6 +639,7 @@ typedef enum ePowerups
typedef enum eEntityCategory
{
ENT_CAT_PLAYER,
ENT_CAT_VEHICLE,
ENT_CAT_PROJECTILE,
ENT_CAT_SHOOTABLE,
ENT_CAT_PICKUP,
@ -571,16 +659,26 @@ typedef enum eEntityCategory
// Class values for generic entities.
typedef enum eEntityClassGeneric
{
ENT_CLASS_GENERIC_START = 10000,
ENT_CLASS_GENERIC_SPECTATOR = 10000,
ENT_CLASS_GENERIC_START,
ENT_CLASS_GENERIC_PLAYERSTART,
ENT_CLASS_GENERIC_PLAYERSTART_TEAM1,
ENT_CLASS_GENERIC_PLAYERSTART_TEAM2,
ENT_CLASS_GENERIC_PLAYERSTART_TEAM3,
ENT_CLASS_GENERIC_PLAYERSTART_TEAM4,
ENT_CLASS_GENERIC_BUTTON,
ENT_CLASS_GENERIC_HEALTH,
ENT_CLASS_GENERIC_AMMO,
ENT_CLASS_GENERIC_ARMOR,
ENT_CLASS_GENERIC_LADDER,
ENT_CLASS_GENERIC_FLAG,
ENT_CLASS_GENERIC_FLAGCAPPOINT,
ENT_CLASS_GENERIC_TELEPORTER,
ENT_CLASS_GENERIC_LIFT,
ENT_CLASS_GENERIC_MOVER,
ENT_CLASS_GENERIC_JUMPPAD,
ENT_CLASS_GENERIC_JUMPPAD_TARGET,
ENT_CLASS_EXPLODING_BARREL,
} EntityClassGeneric;
// enumerations: SoundType
@ -642,6 +740,15 @@ typedef enum eContents
CONT_START_USER = (1<<24)
} Contents;
// enumerations: SurfaceFlags
// SURFACE_SLICK - Low friction surface.
typedef enum eSurfaceFlags
{
SURFACE_SLICK = (1<<0),
// THIS MUST BE LAST
SURFACE_START_USER = (1<<24)
} SurfaceFlags;
// enumerations: SkeletonBone
// BONE_TORSO - Torso bone
// BONE_PELVIS - Pelvis bone
@ -713,7 +820,7 @@ typedef enum eTraceMasks
// struct: BotUserData
// Generic data structure that uses a union to hold various types
// of information.
typedef struct BotUserData_t
typedef struct obUserData_t
{
// enum: DataType
// This allows a small level of type safety with the messages
@ -730,38 +837,38 @@ typedef struct BotUserData_t
const char * m_String;
int m_Int;
float m_Float;
GameEntity m_Entity;
int m_Entity;
int m_4ByteFlags[3];
short m_2ByteFlags[6];
char m_1ByteFlags[12];
} udata;
// Easy Constructors for C++
#ifdef __cplusplus
BotUserData_t() : DataType(dtNone) {};
BotUserData_t(const char * _str) : DataType(dtString) { udata.m_String = _str; };
BotUserData_t(int _int) : DataType(dtInt) { udata.m_Int = _int; };
BotUserData_t(float _float) : DataType(dtFloat) { udata.m_Float = _float; };
BotUserData_t(const GameEntity &_ent) : DataType(dtEntity) { udata.m_Entity = _ent; };
BotUserData_t(float _x, float _y, float _z) :
obUserData_t() : DataType(dtNone) {};
obUserData_t(const char * _str) : DataType(dtString) { udata.m_String = _str; };
obUserData_t(int _int) : DataType(dtInt) { udata.m_Int = _int; };
obUserData_t(float _float) : DataType(dtFloat) { udata.m_Float = _float; };
obUserData_t(const GameEntity &_ent) : DataType(dtEntity) { udata.m_Entity = _ent.AsInt(); };
obUserData_t(float _x, float _y, float _z) :
DataType(dtVector)
{
udata.m_Vector[0] = _x;
udata.m_Vector[1] = _y;
udata.m_Vector[2] = _z;
};
BotUserData_t(int _0, int _1, int _2) : DataType(dt3_4byteFlags)
obUserData_t(int _0, int _1, int _2) : DataType(dt3_4byteFlags)
{
udata.m_4ByteFlags[0] = _0;
udata.m_4ByteFlags[1] = _1;
udata.m_4ByteFlags[2] = _2;
};
BotUserData_t(char *_0, char *_1, char *_2) : DataType(dt3_Strings)
obUserData_t(char *_0, char *_1, char *_2) : DataType(dt3_Strings)
{
udata.m_CharPtrs[0] = _0;
udata.m_CharPtrs[1] = _1;
udata.m_CharPtrs[2] = _2;
};
BotUserData_t(short _0, short _1, short _2, short _3, short _4, short _5) :
obUserData_t(short _0, short _1, short _2, short _3, short _4, short _5) :
DataType(dt6_2byteFlags)
{
udata.m_2ByteFlags[0] = _0;
@ -771,7 +878,7 @@ typedef struct BotUserData_t
udata.m_2ByteFlags[4] = _4;
udata.m_2ByteFlags[5] = _5;
};
BotUserData_t(char _0, char _1, char _2, char _3, char _4, char _5, char _6, char _7, char _8, char _9, char _10, char _11) :
obUserData_t(char _0, char _1, char _2, char _3, char _4, char _5, char _6, char _7, char _8, char _9, char _10, char _11) :
DataType(dt12_1byteFlags)
{
udata.m_1ByteFlags[0] = _0;
@ -824,7 +931,7 @@ typedef struct BotUserData_t
inline const char *GetString() const { return udata.m_String; };
inline int GetInt() const { return udata.m_Int; };
inline float GetFloat() const { return udata.m_Float; };
inline GameEntity GetEntity() const { return udata.m_Entity; };
inline GameEntity GetEntity() const { GameEntity e; e.FromInt(udata.m_Entity); return e; };
inline const char *GetStrings(int _index) const { return udata.m_CharPtrs[_index]; };
inline const float *GetVector() const { return udata.m_Vector; };
inline const int *Get4ByteFlags() const { return udata.m_4ByteFlags; };
@ -849,33 +956,59 @@ typedef struct BotUserData_t
#endif
} BotUserData;
} obUserData;
// struct: TriggerInfo
enum { TriggerBufferSize = 72 };
typedef struct TriggerInfo_t
{
// ptr: m_TagName
// The tagname of this trigger, usually a name given by the mapper.
const char *m_TagName;
char m_TagName[TriggerBufferSize];
// ptr: m_Action
// The name of the action this trigger is performing, mod specific
const char *m_Action;
char m_Action[TriggerBufferSize];
// ptr: m_Entity
// The entity of this trigger, if available
GameEntity m_Entity;
GameEntity m_Entity;
// ptr: m_Activator
// The entity that activated this trigger
GameEntity m_Activator;
// ptr: m_UserData
// Extra info.
BotUserData m_UserData;
GameEntity m_Activator;
#ifdef __cplusplus
TriggerInfo_t() : m_TagName(0), m_Action(0), m_Entity(0), m_Activator(0) {}
TriggerInfo_t(const char *_name, const char *_action, GameEntity _ent, GameEntity _activator) :
m_TagName(_name), m_Action(_action), m_Entity(_ent), m_Activator(_activator) {}
TriggerInfo_t()
{
for(int i = 0; i < TriggerBufferSize; ++i)
m_TagName[i] = m_Action[i] = 0;
}
TriggerInfo_t(TriggerInfo_t *_ti)
{
m_Entity = _ti->m_Entity;
m_Activator = _ti->m_Activator;
for(int i = 0; i < TriggerBufferSize; ++i)
{
m_TagName[i] = _ti->m_TagName[i];
m_Action[i] = _ti->m_Action[i];
}
}
TriggerInfo_t(GameEntity _ent, GameEntity _activator) :
m_Entity(_ent), m_Activator(_activator)
{
m_TagName[0] = m_Action[0] = 0;
}
#endif
} TriggerInfo;
typedef struct AutoNavFeature_t
{
int m_Type;
float m_Position[3];
float m_Facing[3];
float m_TargetPosition[3];
AABB m_TargetBounds;
float m_TravelTime;
AABB m_Bounds;
} AutoNavFeature;
// Generic Enumerations
// enumerations: PlayerState
@ -918,15 +1051,65 @@ typedef enum eFlagState
// GAME_STATE_INTERMISSION - Game is currently in intermission, between rounds.
// GAME_STATE_WAITINGFORPLAYERS - Game is awaiting more players before starting.
// GAME_STATE_PAUSED - Game is currently paused.
// GAME_STATE_SUDDENDEATH - Sudden Death Overtime.
// GAME_STATE_SCOREBOARD - Game finished, looking at scoreboard.
typedef enum eGameState
{
GAME_STATE_INVALID = 0,
GAME_STATE_PLAYING,
GAME_STATE_WARMUP,
GAME_STATE_WARMUP_COUNTDOWN,
GAME_STATE_INTERMISSION,
GAME_STATE_WAITINGFORPLAYERS,
GAME_STATE_WARMUP,
GAME_STATE_WARMUP_COUNTDOWN,
GAME_STATE_PLAYING,
GAME_STATE_SUDDENDEATH,
GAME_STATE_SCOREBOARD,
GAME_STATE_PAUSED,
} GameState;
//////////////////////////////////////////////////////////////////////////
typedef enum
{
DRAW_LINE,
DRAW_RADIUS,
DRAW_BOUNDS,
} DebugMsgType;
typedef float vector_t;
typedef vector_t vector3_t[3];
typedef struct
{
vector3_t m_Start, m_End;
int m_Color;
} IPC_DebugLineMessage;
typedef struct
{
vector3_t m_Pos;
float m_Radius;
int m_Color;
} IPC_DebugRadiusMessage;
typedef struct
{
vector3_t m_Mins, m_Maxs;
int m_Color;
int m_Sides;
} IPC_DebugAABBMessage;
typedef struct
{
union
{
IPC_DebugLineMessage m_Line;
IPC_DebugRadiusMessage m_Radius;
IPC_DebugAABBMessage m_AABB;
} data;
int m_Duration;
DebugMsgType m_Debugtype;
} IPC_DebugDrawMsg;
//////////////////////////////////////////////////////////////////////////
#endif

View file

@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////////////////////////
//
// $LastChangedBy: DrEvil $
// $LastChangedDate: 2006-10-28 22:15:24 -0700 (Sat, 28 Oct 2006) $
// $LastChangedRevision: 1311 $
// $LastChangedDate: 2007-07-14 16:27:55 -0700 (Sat, 14 Jul 2007) $
// $LastChangedRevision: 2089 $
//
// Title: TF Config
//
@ -35,18 +35,60 @@
// TF_BOT_BUTTON_GREN_THROW - Throw primed grenade.
// TF_BOT_BUTTON_DROPITEM - Drop carried item(flag).
// TF_BOT_BUTTON_DROPAMMO - Drop ammo(discard).
// TF_BOT_BUTTON_BUILDSENTRY - Build sentry
// TF_BOT_BUTTON_BUILDDISPENSER - Build dispenser.
// TF_BOT_BUTTON_BUILDDETPACK_5 - Build detpack, 5 seconds.
// TF_BOT_BUTTON_BUILDDETPACK_10 - Build detpack, 10 seconds.
// TF_BOT_BUTTON_BUILDDETPACK_20 - Build detpack, 20 seconds.
// TF_BOT_BUTTON_BUILDDETPACK_30 - Build detpack, 30 seconds.
// TF_BOT_BUTTON_AIMSENTRY - Aim sentry along current facing.
// TF_BOT_BUTTON_DETSENTRY - Detonate sentry gun.
// TF_BOT_BUTTON_DETDISPENSER - Detonate dispenser.
// TF_BOT_BUTTON_DETPIPES - Detonate deployed pipes.
// TF_BOT_BUTTON_CALLFORMEDIC - Calls for medic.
// TF_BOT_BUTTON_CALLFORENGY - Calls for engineer.
// TF_BOT_BUTTON_DISCARD - Drops spare ammo.
// TF_BOT_BUTTON_SABOTAGE_SENTRY - Detonate enemy dispenser.
// TF_BOT_BUTTON_SABOTAGE_DISPENSER - Detonate enemy dispenser.
typedef enum eTF_ButtonFlags
{
TF_BOT_BUTTON_GREN1 = BOT_BUTTUN_FIRSTUSER,
TF_BOT_BUTTON_GREN2,
TF_BOT_BUTTON_GREN_THROW,
TF_BOT_BUTTON_DROPITEM,
TF_BOT_BUTTON_DROPAMMO,
TF_BOT_BUTTON_DROPAMMO,
TF_BOT_BUTTON_BUILDSENTRY,
TF_BOT_BUTTON_BUILDDISPENSER,
TF_BOT_BUTTON_BUILDDETPACK_5,
TF_BOT_BUTTON_BUILDDETPACK_10,
TF_BOT_BUTTON_BUILDDETPACK_20,
TF_BOT_BUTTON_BUILDDETPACK_30,
TF_BOT_BUTTON_AIMSENTRY,
TF_BOT_BUTTON_DETSENTRY,
TF_BOT_BUTTON_DETDISPENSER,
TF_BOT_BUTTON_DETPIPES,
TF_BOT_BUTTON_CALLFORMEDIC,
TF_BOT_BUTTON_CALLFORENGY,
TF_BOT_BUTTON_DISCARD,
TF_BOT_BUTTON_SABOTAGE_SENTRY,
TF_BOT_BUTTON_SABOTAGE_DISPENSER,
TF_BOT_BUTTON_CLOAK,
TF_BOT_BUTTON_SILENT_CLOAK,
// THIS MUST BE LAST
TF_BOT_BUTTUN_FIRSTUSER
} TF_ButtonFlags;
// enumerations: TF_EntityCategory
// TF_ENT_CAT_BUILDABLE - Buildable entities
typedef enum eTF_EntityCategory
{
TF_ENT_CAT_BUILDABLE = ENT_CAT_MAX,
// THIS MUST BE LAST
TF_ENT_CAT_MAX,
} TF_EntityCategory;
// enumerations: TF_EntityClass
// TF_CLASS_SCOUT - Scout player class.
// TF_CLASS_SNIPER - Sniper player class.
@ -91,6 +133,7 @@ typedef enum eTF_EntityClass
TF_CLASS_ENGINEER,
TF_CLASS_CIVILIAN,
TF_CLASS_MAX,
TF_CLASS_ANY = TF_CLASS_MAX,
// Other values to identify the "class"
TF_CLASSEX_SENTRY,
TF_CLASSEX_DISPENSER,
@ -123,6 +166,8 @@ typedef enum eTF_EntityClass
// TF_ENT_FLAG_ARMORME - This entity has called for armor.
// TF_ENT_FLAG_BURNING - This entity is on fire.
// TF_ENT_FLAG_TRANQED - This entity is tranquilized.
// TF_ENT_FLAG_INFECTED - This entity is infected.
// TF_ENT_FLAG_GASSED - This entity is gassed(hallucinating).
// TF_ENT_SNIPERAIMING - This entity is aiming a scoped weapon.
// TF_ENT_ASSAULTFIRING - This entity is shooting an assault weapon.
// TF_ENT_LEGSHOT - This entity is suffering from a leg shot.
@ -136,10 +181,12 @@ typedef enum eTF_EntityClass
// TF_ENT_FLAG_BUILDING_DETP - Entity is building a detpack.
typedef enum eTF_EntityFlags
{
TF_ENT_FLAG_SAVEME = (ENT_FLAG_FIRST_USER),
TF_ENT_FLAG_SAVEME = ENT_FLAG_FIRST_USER,
TF_ENT_FLAG_ARMORME,
TF_ENT_FLAG_BURNING,
TF_ENT_FLAG_TRANQED,
TF_ENT_FLAG_INFECTED,
TF_ENT_FLAG_GASSED,
TF_ENT_FLAG_SNIPERAIMING,
TF_ENT_FLAG_ASSAULTFIRING,
TF_ENT_FLAG_LEGSHOT,
@ -206,7 +253,6 @@ typedef enum eTF_Powerups
// WP_GRENADE_LAUNCHER - Grenade Launcher.
// WP_ROCKET_LAUNCHER - Rocket Launcher.
// WP_SNIPER_RIFLE - Sniper Rifle.
// WP_RADIOTAG_RIFLE - Radio Tag Rifle.
// WP_RAILGUN - Railgun.
// WP_FLAMETHROWER - Flamethrower.
// WP_MINIGUN - Minigun/Assault cannon.
@ -214,9 +260,10 @@ typedef enum eTF_Powerups
// WP_DARTGUN - Dart gun.
// WP_PIPELAUNCHER - Pipe Launcher.
// WP_NAPALMCANNON - Napalm Cannon.
// TF_WP_GRENADE - Offhand Grenade.
typedef enum eTF_Weapon
{
TF_WP_NONE = 0,
TF_WP_NONE = INVALID_WEAPON,
TF_WP_UMBRELLA,
TF_WP_AXE,
TF_WP_CROWBAR,
@ -230,7 +277,6 @@ typedef enum eTF_Weapon
TF_WP_GRENADE_LAUNCHER,
TF_WP_ROCKET_LAUNCHER,
TF_WP_SNIPER_RIFLE,
TF_WP_RADIOTAG_RIFLE,
TF_WP_RAILGUN,
TF_WP_FLAMETHROWER,
TF_WP_MINIGUN,
@ -243,6 +289,8 @@ typedef enum eTF_Weapon
TF_WP_DEPLOY_DISP,
TF_WP_DEPLOY_DETP,
TF_WP_FLAG,
TF_WP_GRENADE1,
TF_WP_GRENADE2,
// THIS MUST STAY LAST
TF_WP_MAX
@ -259,6 +307,7 @@ typedef enum eTF_Weapon
// TF_AMMO_GRENADE2 - Grenade 2.
typedef enum eTF_AmmoType
{
TF_AMMO_NONE = INVALID_AMMO,
TF_AMMO_SHELLS,
TF_AMMO_NAILS,
TF_AMMO_ROCKETS,
@ -355,6 +404,7 @@ typedef enum eTF_Events
// Game Events
TF_MSG_DETPACK_BUILDING,
TF_MSG_DETPACK_BUILT,
TF_MSG_DETPACK_BUILDCANCEL,
TF_MSG_DETPACK_NOTENOUGHAMMO,
TF_MSG_DETPACK_CANTBUILD,
TF_MSG_DETPACK_ALREADYBUILT,
@ -408,6 +458,7 @@ typedef enum eTF_Events
TF_MSG_SENTRY_CANTBUILD,
TF_MSG_SENTRY_BUILDING,
TF_MSG_SENTRY_BUILT,
TF_MSG_SENTRY_BUILDCANCEL,
TF_MSG_SENTRY_DESTROYED,
TF_MSG_SENTRY_SPOTENEMY,
TF_MSG_SENTRY_AIMED,
@ -426,6 +477,7 @@ typedef enum eTF_Events
TF_MSG_DISPENSER_CANTBUILD,
TF_MSG_DISPENSER_BUILDING,
TF_MSG_DISPENSER_BUILT,
TF_MSG_DISPENSER_BUILDCANCEL,
TF_MSG_DISPENSER_DESTROYED,
TF_MSG_DISPENSER_ENEMYUSED,
TF_MSG_DISPENSER_DAMAGED,
@ -477,10 +529,7 @@ typedef enum eTF_GameMessage
// This enum defines the identifiers for goal entity types the game can register with the bot.
typedef enum eTF_GoalType
{
TF_GOAL_FLAG = BASE_GOAL_NUM,
TF_GOAL_CAPPOINT,
TF_GOAL_SNIPEPOINT,
TF_GOAL_SENTRYPOINT,
TF_GOAL_SENTRYPOINT = BASE_GOAL_NUM,
TF_GOAL_DISPENSERPOINT,
TF_GOAL_PIPETRAPPOINT,
TF_GOAL_DETPACK,

View file

@ -1,8 +1,8 @@
////////////////////////////////////////////////////////////////////////////////
//
// $LastChangedBy: DrEvil $
// $LastChangedDate: 2006-10-28 22:15:24 -0700 (Sat, 28 Oct 2006) $
// $LastChangedRevision: 1311 $
// $LastChangedDate: 2007-07-23 20:42:20 -0700 (Mon, 23 Jul 2007) $
// $LastChangedRevision: 2119 $
//
// Title: TF Message Structure Definitions
//
@ -18,81 +18,74 @@
//////////////////////////////////////////////////////////////////////////
// struct: TF_WeaponCharging
// m_IsCharging - true if the weapon is charging.
typedef struct
{
obBool m_IsCharging;
} TF_WeaponCharging;
// struct: TF_BuildInfo
// m_Sentry - Sentry Entity.
// m_Dispenser - Dispenser Entity.
// m_Detpack - Detpack Entity.
typedef struct
struct TF_BuildInfo
{
GameEntity m_Sentry;
GameEntity m_Dispenser;
GameEntity m_Detpack;
} TF_BuildInfo;
};
// struct: TF_PlayerPipeCount
// m_NumPipes - Current number of player pipes.
// m_MaxPipes - Max player pipes.
typedef struct
struct TF_PlayerPipeCount
{
obint32 m_NumPipes;
obint32 m_MaxPipes;
} TF_PlayerPipeCount;
};
// struct: TF_TeamPipeInfo
// m_NumTeamPipes - Current number of team pipes.
// m_NumTeamPipers - Current number of team pipers(demo-men).
// m_MaxPipesPerPiper - Max pipes per piper
typedef struct
struct TF_TeamPipeInfo
{
obint32 m_NumTeamPipes;
obint32 m_NumTeamPipers;
obint32 m_MaxPipesPerPiper;
} TF_TeamPipeInfo;
};
// struct: TF_DisguiseOptions
// m_CheckTeam - team to check class disguises with.
// m_Team - true/false if each team is available to be disguised as.
// m_DisguiseClass - true/false if each class is available to be disguised as.
typedef struct
struct TF_DisguiseOptions
{
int m_CheckTeam;
obBool m_Team[TF_TEAM_MAX];
obBool m_Class[TF_CLASS_MAX];
} TF_DisguiseOptions;
};
// struct: TF_Disguise
// m_DisguiseTeam - Team disguised as.
// m_DisguiseClass - Class disguised as.
typedef struct
struct TF_Disguise
{
obint32 m_DisguiseTeam;
obint32 m_DisguiseClass;
} TF_Disguise;
};
// struct: TF_FeignDeath
// m_SilentFeign - Silent feign or not.
typedef struct
struct TF_FeignDeath
{
obBool m_Silent;
} TF_FeignDeath;
};
// struct: TF_HudHint
// m_TargetPlayer - Target player entity for the hint.
// m_Id - Id for the hint.
// m_Message[1024] - Hint message.
typedef struct
struct TF_HudHint
{
GameId m_TargetPlayer;
GameEntity m_TargetPlayer;
obint32 m_Id;
char m_Message[1024];
} TF_HudHint;
};
// struct: TF_HudMenu
// m_TargetPlayer - Target player entity for the hint.
@ -105,7 +98,7 @@ typedef struct
// m_Level - Menu level.
// m_TimeOut - Duration of the menu.
// m_Color - Text color.
typedef struct
struct TF_HudMenu
{
enum GuiType
{
@ -113,7 +106,7 @@ typedef struct
GuiMenu,
GuiTextBox,
};
GameId m_TargetPlayer;
GameEntity m_TargetPlayer;
GuiType m_MenuType;
char m_Title[32];
char m_Caption[32];
@ -123,36 +116,163 @@ typedef struct
int m_Level;
float m_TimeOut;
obColor m_Color;
} TF_HudMenu;
};
// struct: TF_HudText
// m_TargetPlayer - Target player entity for the message.
// m_Message - Text to display.
typedef struct
struct TF_HudText
{
enum MsgType
{
MsgConsole,
MsgHudCenter,
};
GameId m_TargetPlayer;
GameEntity m_TargetPlayer;
MsgType m_MessageType;
char m_Message[512];
} TF_HudText;
};
// struct: TF_LockPosition
// m_TargetPlayer - Target player entity for the hint.
// m_Lock - Lock the player or not.
// m_Succeeded - Status result.
typedef struct
struct TF_LockPosition
{
GameEntity m_TargetPlayer;
obBool m_Lock;
obBool m_Succeeded;
} TF_LockPosition;
};
//////////////////////////////////////////////////////////////////////////
struct Event_RadioTagUpdate_TF
{
GameEntity m_Detected;
};
struct Event_RadarUpdate_TF
{
GameEntity m_Detected;
};
struct Event_CantDisguiseTeam_TF
{
int m_TeamId;
};
struct Event_CantDisguiseClass_TF
{
int m_ClassId;
};
struct Event_Disguise_TF
{
int m_TeamId;
int m_ClassId;
};
struct Event_SentryBuilding_TF
{
GameEntity m_Sentry;
};
struct Event_SentryBuilt_TF
{
GameEntity m_Sentry;
};
struct Event_SentryAimed_TF
{
GameEntity m_Sentry;
float m_Direction[3];
};
struct Event_SentrySpotEnemy_TF
{
GameEntity m_SpottedEnemy;
};
struct Event_SentryTakeDamage_TF
{
GameEntity m_Inflictor;
};
struct Event_SentryUpgraded_TF
{
int m_Level;
};
struct Event_SentryStatus_TF
{
GameEntity m_Entity;
float m_Position[3];
float m_Facing[3];
int m_Level;
int m_Health;
int m_MaxHealth;
int m_Shells[2];
int m_Rockets[2];
};
struct Event_DispenserStatus_TF
{
GameEntity m_Entity;
float m_Position[3];
float m_Facing[3];
int m_Health;
int m_Cells;
int m_Nails;
int m_Rockets;
int m_Shells;
int m_Armor;
};
struct Event_DispenserBuilding_TF
{
GameEntity m_Dispenser;
};
struct Event_DispenserBuilt_TF
{
GameEntity m_Dispenser;
};
struct Event_DispenserEnemyUsed_TF
{
GameEntity m_Enemy;
};
struct Event_DispenserTakeDamage_TF
{
GameEntity m_Inflictor;
};
struct Event_DetpackBuilding_TF
{
GameEntity m_Detpack;
};
struct Event_DetpackBuilt_TF
{
GameEntity m_Detpack;
};
struct Event_BuildableDamaged_TF
{
GameEntity m_Buildable;
};
struct Event_BuildableDestroyed_TF
{
GameEntity m_WhoDoneIt;
};
struct Event_BuildableSabotaged_TF
{
GameEntity m_WhoDoneIt;
};
#pragma pack(pop)
#endif

View file

@ -38,7 +38,7 @@ void event_ServerPlayerRemoveItem(IGameEvent *_event);
void event_GameTeamInfo(IGameEvent *_event);
void event_GameTeamScore(IGameEvent *_event);
void event_GamePlayerScore(IGameEvent *_event);
void event_GamePlayerShoot(IGameEvent *_event);
//void event_GamePlayerShoot(IGameEvent *_event);
void event_GamePlayerUse(IGameEvent *_event);
void event_GamePlayerChangeName(IGameEvent *_event);
void event_GameNewMap(IGameEvent *_event);
@ -90,7 +90,7 @@ const EventCallback EVENT_CALLBACKS[] =
{ "team_info", event_GameTeamInfo },
{ "team_score", event_GameTeamScore },
{ "player_score", event_GamePlayerScore },
{ "player_shoot", event_GamePlayerShoot },
//{ "player_shoot", event_GamePlayerShoot },
{ "player_use", event_GamePlayerUse },
{ "player_changename", event_GamePlayerChangeName },
{ "game_newmap", event_GameNewMap },
@ -107,7 +107,7 @@ const EventCallback EVENT_CALLBACKS[] =
{ "player_team", event_Team },
{ "player_hurt", event_Hurt },
{ "player_death", event_Death },
{ "player_spawn", event_Spawn },
//{ "player_spawn", event_Spawn },
{ "build_dispenser", event_DispenserBuilt },
{ "build_sentrygun", event_SentryBuilt },
{ "build_detpack", event_DetpackBuilt },
@ -177,7 +177,7 @@ void omnibot_eventhandler::ExtractEvents()
// loop through all events in this file and record ourselves as listener for each
for (KeyValues *pEvent = g_pGameEvents->GetFirstSubKey(); pEvent; pEvent = pEvent->GetNextKey())
{
Msg("Event: %s\n", pEvent->GetName());
//Msg("Event: %s\n", pEvent->GetName());
gameeventmanager->AddListener(this, pEvent->GetName(), true);
}
}
@ -190,7 +190,7 @@ void omnibot_eventhandler::ExtractEvents()
// loop through all events in this file and record ourselves as listener for each
for (KeyValues *pEvent = g_pEngineEvents->GetFirstSubKey(); pEvent; pEvent = pEvent->GetNextKey())
{
Msg("Event: %s\n", pEvent->GetName());
//Msg("Event: %s\n", pEvent->GetName());
gameeventmanager->AddListener(this, pEvent->GetName(), true);
}
}
@ -203,7 +203,7 @@ void omnibot_eventhandler::ExtractEvents()
// loop through all events in this file and record ourselves as listener for each
for (KeyValues *pEvent = g_pModEvents->GetFirstSubKey(); pEvent; pEvent = pEvent->GetNextKey())
{
Msg("Event: %s\n", pEvent->GetName());
//Msg("Event: %s\n", pEvent->GetName());
gameeventmanager->AddListener(this, pEvent->GetName(), true);
}
}
@ -446,14 +446,14 @@ void event_GamePlayerScore(IGameEvent *_event)
Msg(__FUNCTION__);
}
void event_GamePlayerShoot(IGameEvent *_event)
{
CBasePlayer *pPlayer = UTIL_PlayerByUserId(_event->GetInt("userid"));
if(pPlayer && pPlayer->IsBot())
{
Omnibot::Notify_PlayerShoot(pPlayer, _event->GetInt("weapon"));
}
}
//void event_GamePlayerShoot(IGameEvent *_event)
//{
// CBasePlayer *pPlayer = UTIL_PlayerByUserId(_event->GetInt("userid"));
// if(pPlayer && pPlayer->IsBot())
// {
// Omnibot::Notify_PlayerShoot(pPlayer, _event->GetInt("weapon"), 0);
// }
//}
void event_GamePlayerUse(IGameEvent *_event)
{
@ -532,36 +532,36 @@ void event_Team(IGameEvent *_event)
void event_Hurt(IGameEvent *_event)
{
CBasePlayer *pPlayer = UTIL_PlayerByUserId(_event->GetInt("userid"));
CBasePlayer *pAttacker = UTIL_PlayerByUserId(_event->GetInt("attacker"));
CBasePlayer *pAttacker = UTIL_PlayerByUserId(_event->GetInt("attacker")); // FIXME
if(pPlayer && pPlayer->IsBot())
{
Omnibot::Notify_Hurt(pPlayer, pAttacker ? pAttacker->edict() : 0);
Omnibot::Notify_Hurt(pPlayer, pAttacker ? pAttacker : 0);
}
}
void event_Death(IGameEvent *_event)
{
CBasePlayer *pPlayer = UTIL_PlayerByUserId(_event->GetInt("userid"));
CBasePlayer *pAttacker = UTIL_PlayerByUserId(_event->GetInt("attacker"));
CBasePlayer *pAttacker = UTIL_PlayerByUserId(_event->GetInt("attacker")); // FIXME
const char *pWeapon = _event->GetString("weapon");
if(pPlayer && pPlayer->IsBot())
{
Omnibot::Notify_Death(pPlayer, pAttacker ? pAttacker->edict() : 0, pWeapon);
Omnibot::Notify_Death(pPlayer, pAttacker ? pAttacker : 0, pWeapon);
}
if(pAttacker && pAttacker->IsBot())
{
Omnibot::Notify_KilledSomeone(pAttacker, pPlayer ? pPlayer->edict() : 0, pWeapon);
Omnibot::Notify_KilledSomeone(pAttacker, pPlayer ? pPlayer : 0, pWeapon);
}
}
void event_Spawn(IGameEvent *_event)
{
CBasePlayer *pPlayer = UTIL_PlayerByUserId(_event->GetInt("userid"));
if(pPlayer && pPlayer->IsBot())
{
Omnibot::Notify_Spawned(pPlayer);
}
}
//void event_Spawn(IGameEvent *_event)
//{
// CBasePlayer *pPlayer = UTIL_PlayerByUserId(_event->GetInt("userid"));
// if(pPlayer && pPlayer->IsBot())
// {
// Omnibot::Notify_Spawned(pPlayer);
// }
//}
void event_SentryBuilt(IGameEvent *_event)
{
@ -573,7 +573,7 @@ void event_SentryBuilt(IGameEvent *_event)
CFFSentryGun *pBuildable = pFFPlayer->GetSentryGun();
if(pBuildable)
{
Omnibot::Notify_SentryBuilt(pPlayer, pBuildable->edict());
Omnibot::Notify_SentryBuilt(pPlayer, pBuildable);
}
}
}
@ -588,7 +588,7 @@ void event_DispenserBuilt(IGameEvent *_event)
CFFDispenser *pBuildable = pFFPlayer->GetDispenser();
if(pBuildable)
{
Omnibot::Notify_DispenserBuilt(pPlayer, pBuildable->edict());
Omnibot::Notify_DispenserBuilt(pPlayer, pBuildable);
}
}
}
@ -603,7 +603,7 @@ void event_DetpackBuilt(IGameEvent *_event)
CFFDetpack *pBuildable = pFFPlayer->GetDetpack();
if(pBuildable)
{
Omnibot::Notify_DetpackBuilt(pPlayer, pBuildable->edict());
Omnibot::Notify_DetpackBuilt(pPlayer, pBuildable);
}
}
}
@ -614,7 +614,7 @@ void event_SentryKilled(IGameEvent *_event)
CBasePlayer *pAttacker = UTIL_PlayerByUserId(_event->GetInt("attacker"));
if(pPlayer && pPlayer->IsBot())
{
Omnibot::Notify_SentryDestroyed(pPlayer, pAttacker ? pAttacker->edict() : 0);
Omnibot::Notify_SentryDestroyed(pPlayer, pAttacker ? pAttacker : 0);
}
}
@ -625,7 +625,7 @@ void event_DispenserKilled(IGameEvent *_event)
if(pPlayer && pPlayer->IsBot())
{
Omnibot::Notify_DispenserDestroyed(pPlayer, pAttacker ? pAttacker->edict() : 0);
Omnibot::Notify_DispenserDestroyed(pPlayer, pAttacker ? pAttacker : 0);
}
}
@ -677,10 +677,10 @@ void event_SpyCloaked(IGameEvent *_event)
void event_DispenserEnemyUsed(IGameEvent *_event)
{
CBasePlayer *pPlayer = UTIL_PlayerByUserId(_event->GetInt("userid"));
CBasePlayer *pEnemy = UTIL_PlayerByUserId(_event->GetInt("saboteur"));
CBasePlayer *pEnemy = UTIL_PlayerByUserId(_event->GetInt("enemyid"));
if(pPlayer && pPlayer->IsBot())
{
Omnibot::Notify_DispenserEnemyUsed(pPlayer, pEnemy ? pEnemy->edict() : 0);
Omnibot::Notify_DispenserEnemyUsed(pPlayer, pEnemy ? pEnemy : 0);
}
}
@ -690,7 +690,7 @@ void event_DispenserSabotaged(IGameEvent *_event)
CBasePlayer *pEnemy = UTIL_PlayerByUserId(_event->GetInt("saboteur"));
if(pPlayer && pPlayer->IsBot())
{
Omnibot::Notify_DispenserSabotaged(pPlayer, pEnemy ? pEnemy->edict() : 0);
Omnibot::Notify_DispenserSabotaged(pPlayer, pEnemy ? pEnemy : 0);
}
}
@ -700,7 +700,7 @@ void event_SentrySabotaged(IGameEvent *_event)
CBasePlayer *pEnemy = UTIL_PlayerByUserId(_event->GetInt("saboteur"));
if(pPlayer && pPlayer->IsBot())
{
Omnibot::Notify_SentrySabotaged(pPlayer, pEnemy ? pEnemy->edict() : 0);
Omnibot::Notify_SentrySabotaged(pPlayer, pEnemy ? pEnemy : 0);
}
}

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,8 @@
#ifndef __OMNIBOT_INTERFACE_H__
#define __OMNIBOT_INTERFACE_H__
class CFFInfoScript;
namespace Omnibot
{
#include "Omni-Bot.h"
@ -13,12 +15,10 @@ namespace Omnibot
static void OnDLLInit();
static void OnDLLShutdown();
static void LevelInit();
static bool InitBotInterface();
static void ShutdownBotInterface();
static void UpdateBotInterface();
static void Bot_SendSoundEvent(int _client, int _sndtype, Omnibot::GameEntity _source);
static void Bot_Interface_SendEvent(int _eid, int _dest, int _source, int _msdelay, BotUserData * _data);
static void Bot_Interface_SendGlobalEvent(int _eid, int _source, int _msdelay, BotUserData * _data);
static void Bot_SendTrigger(TriggerInfo *_triggerInfo);
static void OmnibotCommand();
@ -42,17 +42,16 @@ namespace Omnibot
void Notify_TeamChatMsg(CBasePlayer *_player, const char *_msg);
void Notify_Spectated(CBasePlayer *_player, CBasePlayer *_spectated);
void Notify_ClientConnected(CBasePlayer *_player, bool _isbot);
void Notify_ClientConnected(CBasePlayer *_player, bool _isbot, int _team = RANDOM_TEAM_IF_NO_TEAM, int _class = RANDOM_CLASS_IF_NO_CLASS);
void Notify_ClientDisConnected(CBasePlayer *_player);
void Notify_AddWeapon(CBasePlayer *_player, const char *_item);
void Notify_RemoveWeapon(CBasePlayer *_player, const char *_item);
void Notify_RemoveAllItems(CBasePlayer *_player);
void Notify_Spawned(CBasePlayer *_player);
void Notify_Hurt(CBasePlayer *_player, edict_t *_attacker);
void Notify_Death(CBasePlayer *_player, edict_t *_attacker, const char *_weapon);
void Notify_KilledSomeone(CBasePlayer *_player, edict_t *_victim, const char *_weapon);
void Notify_Hurt(CBasePlayer *_player, CBaseEntity *_attacker);
void Notify_Death(CBasePlayer *_player, CBaseEntity *_attacker, const char *_weapon);
void Notify_KilledSomeone(CBasePlayer *_player, CBaseEntity *_victim, const char *_weapon);
void Notify_ChangedTeam(CBasePlayer *_player, int _newteam);
void Notify_ChangedClass(CBasePlayer *_player, int _oldclass, int _newclass);
@ -61,6 +60,7 @@ namespace Omnibot
void Notify_Build_CantBuild(CBasePlayer *_player, int _buildable);
void Notify_Build_AlreadyBuilt(CBasePlayer *_player, int _buildable);
void Notify_Build_NotEnoughAmmo(CBasePlayer *_player, int _buildable);
void Notify_Build_BuildCancelled(CBasePlayer *_player, int _buildable);
void Notify_CantDisguiseAsTeam(CBasePlayer *_player, int _disguiseTeam);
void Notify_CantDisguiseAsClass(CBasePlayer *_player, int _disguiseClass);
@ -71,35 +71,36 @@ namespace Omnibot
void Notify_CantCloak(CBasePlayer *_player);
void Notify_Cloaked(CBasePlayer *_player);
void Notify_RadarDetectedEnemy(CBasePlayer *_player, edict_t *_ent);
void Notify_RadioTagUpdate(CBasePlayer *_player, edict_t *_ent);
void Notify_BuildableDamaged(CBasePlayer *_player, int _type, edict_t *_buildableEnt);
void Notify_RadarDetectedEnemy(CBasePlayer *_player, CBaseEntity *_ent);
void Notify_RadioTagUpdate(CBasePlayer *_player, CBaseEntity *_ent);
void Notify_BuildableDamaged(CBasePlayer *_player, int _type, CBaseEntity *_buildableEnt);
void Notify_DispenserBuilding(CBasePlayer *_player, edict_t *_buildEnt);
void Notify_DispenserBuilt(CBasePlayer *_player, edict_t *_buildEnt);
void Notify_DispenserEnemyUsed(CBasePlayer *_player, edict_t *_enemyUser);
void Notify_DispenserDestroyed(CBasePlayer *_player, edict_t *_attacker);
void Notify_DispenserBuilding(CBasePlayer *_player, CBaseEntity *_buildEnt);
void Notify_DispenserBuilt(CBasePlayer *_player, CBaseEntity *_buildEnt);
void Notify_DispenserEnemyUsed(CBasePlayer *_player, CBaseEntity *_enemyUser);
void Notify_DispenserDestroyed(CBasePlayer *_player, CBaseEntity *_attacker);
void Notify_DispenserDetonated(CBasePlayer *_player);
void Notify_DispenserDismantled(CBasePlayer *_player);
void Notify_SentryUpgraded(CBasePlayer *_player, int _level);
void Notify_SentryBuilding(CBasePlayer *_player, edict_t *_buildEnt);
void Notify_SentryBuilt(CBasePlayer *_player, edict_t *_buildEnt);
void Notify_SentryDestroyed(CBasePlayer *_player, edict_t *_attacker);
void Notify_SentryBuilding(CBasePlayer *_player, CBaseEntity *_buildEnt);
void Notify_SentryBuilt(CBasePlayer *_player, CBaseEntity *_buildEnt);
void Notify_SentryDestroyed(CBasePlayer *_player, CBaseEntity *_attacker);
void Notify_SentryBuildCancel(CBasePlayer *_player);
void Notify_SentryDetonated(CBasePlayer *_player);
void Notify_SentryDismantled(CBasePlayer *_player);
void Notify_SentrySpottedEnemy(CBasePlayer *_player);
void Notify_SentryAimed(CBasePlayer *_player);
void Notify_SentryAimed(CBasePlayer *_player, CBaseEntity *_buildEnt, const Vector &_dir);
void Notify_DetpackBuilding(CBasePlayer *_player, edict_t *_buildEnt);
void Notify_DetpackBuilt(CBasePlayer *_player, edict_t *_buildEnt);
void Notify_DetpackBuilding(CBasePlayer *_player, CBaseEntity *_buildEnt);
void Notify_DetpackBuilt(CBasePlayer *_player, CBaseEntity *_buildEnt);
void Notify_DispenserBuildCancel(CBasePlayer *_player);
void Notify_DetpackDetonated(CBasePlayer *_player);
void Notify_DispenserSabotaged(CBasePlayer *_player, edict_t *_saboteur);
void Notify_SentrySabotaged(CBasePlayer *_player, edict_t *_saboteur);
void Notify_DispenserSabotaged(CBasePlayer *_player, CBaseEntity *_saboteur);
void Notify_SentrySabotaged(CBasePlayer *_player, CBaseEntity *_saboteur);
void Notify_PlayerShoot(CBasePlayer *_player, int _weapon);
void Notify_PlayerShootProjectile(CBasePlayer *_player, edict_t *_projectile);
void Notify_PlayerShoot(CBasePlayer *_player, int _weapon, CBaseEntity *_projectile);
void Notify_PlayerUsed(CBasePlayer *_player, CBaseEntity *_entityUsed);
// Goal Stuff
@ -111,7 +112,8 @@ namespace Omnibot
kBackPack_Health,
kBackPack_Grenades,
kFlag,
kFlagCap
kFlagCap,
kTrainerSpawn
};
void Notify_GoalInfo(CBaseEntity *_entity, int _type, int _teamflags);
@ -125,6 +127,8 @@ namespace Omnibot
void Notify_FireOutput(const char *_entityname, const char *_output);
void BotSendTriggerEx(const char *_entityname, const char *_action);
void SpawnBotAsync(const char *_name, int _team, int _class, CFFInfoScript *_spawnpoint = 0);
void SpawnBot(const char *_name, int _team, int _class, CFFInfoScript *_spawnpoint = 0);
};
#endif

View file

@ -1,162 +1,121 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="tier1-2005"
Version="7.10"
Name="tier1"
ProjectGUID="{E1DA8DB8-FB4C-4B14-91A6-98BCED6B9720}"
Keyword="Win32Proj"
>
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"
/>
Name="Win32"/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
ImproveFloatingPointConsistency="TRUE"
OptimizeForProcessor="3"
AdditionalIncludeDirectories="..\common,..\public,..\public\tier1"
PreprocessorDefinitions="_WIN32;_DEBUG;_LIB;TIER1_STATIC_LIB"
MinimalRebuild="true"
ExceptionHandling="1"
MinimalRebuild="TRUE"
ExceptionHandling="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
BufferSecurityCheck="true"
ForceConformanceInForLoopScope="true"
RuntimeTypeInfo="true"
BufferSecurityCheck="TRUE"
ForceConformanceInForLoopScope="TRUE"
RuntimeTypeInfo="TRUE"
UsePrecompiledHeader="0"
ProgramDataBaseFileName="$(IntDir)/"
WarningLevel="4"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
/>
Detect64BitPortabilityProblems="FALSE"
DebugInformationFormat="4"/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
CommandLine="if exist ..\lib\public\tier1.lib attrib -r ..\lib\public\tier1.lib&#x0D;&#x0A;if exist ..\lib\public\tier1.pdb attrib -r ..\lib\public\tier1.pdb&#x0D;&#x0A;"
/>
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\lib\public\tier1.lib"
/>
OutputFile="..\lib-vc7\public\tier1.lib"/>
<Tool
Name="VCALinkTool"
/>
Name="VCMIDLTool"/>
<Tool
Name="VCXDCMakeTool"
/>
Name="VCPostBuildEventTool"/>
<Tool
Name="VCBscMakeTool"
/>
Name="VCPreBuildEventTool"/>
<Tool
Name="VCFxCopTool"
/>
Name="VCPreLinkEventTool"
CommandLine="if exist ..\lib-vc7\public\tier1.lib attrib -r ..\lib-vc7\public\tier1.lib
if exist ..\lib-vc7\public\tier1.pdb attrib -r ..\lib-vc7\public\tier1.pdb
"/>
<Tool
Name="VCPostBuildEventTool"
/>
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
GlobalOptimizations="TRUE"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
EnableIntrinsicFunctions="TRUE"
ImproveFloatingPointConsistency="FALSE"
FavorSizeOrSpeed="1"
OptimizeForProcessor="3"
AdditionalIncludeDirectories="..\common,..\public,..\public\tier1"
PreprocessorDefinitions="_WIN32;NDEBUG;_LIB;TIER1_STATIC_LIB;_SECURE_SCL=0 "
StringPooling="true"
ExceptionHandling="1"
PreprocessorDefinitions="_WIN32;NDEBUG;_LIB;TIER1_STATIC_LIB"
StringPooling="TRUE"
ExceptionHandling="TRUE"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
ForceConformanceInForLoopScope="true"
RuntimeTypeInfo="true"
EnableFunctionLevelLinking="TRUE"
ForceConformanceInForLoopScope="TRUE"
RuntimeTypeInfo="TRUE"
UsePrecompiledHeader="0"
ProgramDataBaseFileName="$(IntDir)/"
WarningLevel="4"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="1"
/>
Detect64BitPortabilityProblems="FALSE"
DebugInformationFormat="2"/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
CommandLine="if exist ..\lib\public\tier1.lib attrib -r ..\lib\public\tier1.lib&#x0D;&#x0A;if exist ..\lib\public\tier1.pdb attrib -r ..\lib\public\tier1.pdb&#x0D;&#x0A;"
/>
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\lib\public\tier1.lib"
/>
OutputFile="..\lib-vc7\public\tier1.lib"/>
<Tool
Name="VCALinkTool"
/>
Name="VCMIDLTool"/>
<Tool
Name="VCXDCMakeTool"
/>
Name="VCPostBuildEventTool"/>
<Tool
Name="VCBscMakeTool"
/>
Name="VCPreBuildEventTool"/>
<Tool
Name="VCFxCopTool"
/>
Name="VCPreLinkEventTool"
CommandLine="if exist ..\lib-vc7\public\tier1.lib attrib -r ..\lib-vc7\public\tier1.lib
if exist ..\lib-vc7\public\tier1.pdb attrib -r ..\lib-vc7\public\tier1.pdb
"/>
<Tool
Name="VCPostBuildEventTool"
/>
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
@ -165,313 +124,236 @@
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
RelativePath=".\bitbuf.cpp"
>
RelativePath=".\bitbuf.cpp">
</File>
<File
RelativePath=".\byteswap.cpp"
>
RelativePath=".\byteswap.cpp">
</File>
<File
RelativePath=".\characterset.cpp"
>
RelativePath=".\characterset.cpp">
</File>
<File
RelativePath=".\checksum_crc.cpp"
>
RelativePath=".\checksum_crc.cpp">
</File>
<File
RelativePath=".\checksum_md5.cpp"
>
RelativePath=".\checksum_md5.cpp">
</File>
<File
RelativePath=".\convar.cpp"
>
RelativePath=".\convar.cpp">
</File>
<File
RelativePath=".\datamanager.cpp"
>
RelativePath=".\datamanager.cpp">
</File>
<File
RelativePath=".\diff.cpp"
>
RelativePath=".\diff.cpp">
</File>
<File
RelativePath=".\generichash.cpp"
>
RelativePath=".\generichash.cpp">
</File>
<File
RelativePath=".\interface.cpp"
>
RelativePath=".\interface.cpp">
</File>
<File
RelativePath=".\jobthread.cpp"
>
RelativePath=".\jobthread.cpp">
</File>
<File
RelativePath=".\KeyValues.cpp"
>
RelativePath=".\KeyValues.cpp">
</File>
<File
RelativePath=".\mempool.cpp"
>
RelativePath=".\mempool.cpp">
</File>
<File
RelativePath=".\memstack.cpp"
>
RelativePath=".\memstack.cpp">
</File>
<File
RelativePath=".\NetAdr.cpp"
>
RelativePath=".\NetAdr.cpp">
</File>
<File
RelativePath=".\processor_detect.cpp"
>
RelativePath=".\processor_detect.cpp">
</File>
<File
RelativePath=".\processor_detect_linux.cpp"
>
RelativePath=".\processor_detect_linux.cpp">
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
>
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"
/>
Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
ExcludedFromBuild="TRUE">
<Tool
Name="VCCLCompilerTool"
/>
Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File
RelativePath=".\rangecheckedvar.cpp"
>
RelativePath=".\rangecheckedvar.cpp">
</File>
<File
RelativePath=".\stringpool.cpp"
>
RelativePath=".\stringpool.cpp">
</File>
<File
RelativePath=".\strtools.cpp"
>
RelativePath=".\strtools.cpp">
</File>
<File
RelativePath=".\tier1.cpp"
>
RelativePath=".\tier1.cpp">
</File>
<File
RelativePath=".\tokenreader.cpp"
>
RelativePath=".\tokenreader.cpp">
</File>
<File
RelativePath=".\utlbuffer.cpp"
>
RelativePath=".\utlbuffer.cpp">
</File>
<File
RelativePath=".\utlstring.cpp"
>
RelativePath=".\utlstring.cpp">
</File>
<File
RelativePath=".\utlsymbol.cpp"
>
RelativePath=".\utlsymbol.cpp">
</File>
<File
RelativePath=".\xboxstubs.cpp"
>
RelativePath=".\xboxstubs.cpp">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
<File
RelativePath="..\public\tier1\bitbuf.h"
>
RelativePath="..\public\tier1\bitbuf.h">
</File>
<File
RelativePath="..\public\tier1\characterset.h"
>
RelativePath="..\public\tier1\characterset.h">
</File>
<File
RelativePath="..\public\tier1\checksum_crc.h"
>
RelativePath="..\public\tier1\checksum_crc.h">
</File>
<File
RelativePath="..\public\tier1\checksum_md5.h"
>
RelativePath="..\public\tier1\checksum_md5.h">
</File>
<File
RelativePath="..\public\tier1\convar.h"
>
RelativePath="..\public\tier1\convar.h">
</File>
<File
RelativePath="..\public\tier1\datamanager.h"
>
RelativePath="..\public\tier1\datamanager.h">
</File>
<File
RelativePath="..\public\datamap.h"
>
RelativePath="..\public\datamap.h">
</File>
<File
RelativePath="..\public\tier1\diff.h"
>
RelativePath="..\public\tier1\diff.h">
</File>
<File
RelativePath="..\public\tier1\fmtstr.h"
>
RelativePath="..\public\tier1\fmtstr.h">
</File>
<File
RelativePath="..\public\tier1\generichash.h"
>
RelativePath="..\public\tier1\generichash.h">
</File>
<File
RelativePath="..\public\tier1\interface.h"
>
RelativePath="..\public\tier1\interface.h">
</File>
<File
RelativePath="..\public\tier1\jobthread.h"
>
RelativePath="..\public\tier1\jobthread.h">
</File>
<File
RelativePath="..\public\tier1\KeyValues.h"
>
RelativePath="..\public\tier1\KeyValues.h">
</File>
<File
RelativePath="..\public\tier1\mempool.h"
>
RelativePath="..\public\tier1\mempool.h">
</File>
<File
RelativePath="..\public\tier1\memstack.h"
>
RelativePath="..\public\tier1\memstack.h">
</File>
<File
RelativePath="..\public\tier1\netadr.h"
>
RelativePath="..\public\tier1\netadr.h">
</File>
<File
RelativePath="..\public\tier1\processor_detect.h"
>
RelativePath="..\public\tier1\processor_detect.h">
</File>
<File
RelativePath="..\public\tier1\rangecheckedvar.h"
>
RelativePath="..\public\tier1\rangecheckedvar.h">
</File>
<File
RelativePath="..\public\tier1\refcount.h"
>
RelativePath="..\public\tier1\refcount.h">
</File>
<File
RelativePath="..\public\tier1\smartptr.h"
>
RelativePath="..\public\tier1\smartptr.h">
</File>
<File
RelativePath="..\public\tier1\stringpool.h"
>
RelativePath="..\public\tier1\stringpool.h">
</File>
<File
RelativePath="..\public\tier1\strtools.h"
>
RelativePath="..\public\tier1\strtools.h">
</File>
<File
RelativePath="..\public\tier1\tier1.h"
>
RelativePath="..\public\tier1\tier1.h">
</File>
<File
RelativePath="..\public\tier1\tokenreader.h"
>
RelativePath="..\public\tier1\tokenreader.h">
</File>
<File
RelativePath="..\public\tier1\utlbidirectionalset.h"
>
RelativePath="..\public\tier1\utlbidirectionalset.h">
</File>
<File
RelativePath="..\public\tier1\utlbuffer.h"
>
RelativePath="..\public\tier1\utlbuffer.h">
</File>
<File
RelativePath="..\public\tier1\utldict.h"
>
RelativePath="..\public\tier1\utldict.h">
</File>
<File
RelativePath="..\public\tier1\utlfixedlinkedlist.h"
>
RelativePath="..\public\tier1\utlfixedlinkedlist.h">
</File>
<File
RelativePath="..\public\tier1\utlfixedmemory.h"
>
RelativePath="..\public\tier1\utlfixedmemory.h">
</File>
<File
RelativePath="..\public\tier1\utlhandletable.h"
>
RelativePath="..\public\tier1\utlhandletable.h">
</File>
<File
RelativePath="..\public\tier1\utlhash.h"
>
RelativePath="..\public\tier1\utlhash.h">
</File>
<File
RelativePath="..\public\tier1\utllinkedlist.h"
>
RelativePath="..\public\tier1\utllinkedlist.h">
</File>
<File
RelativePath="..\public\tier1\utlmap.h"
>
RelativePath="..\public\tier1\utlmap.h">
</File>
<File
RelativePath="..\public\tier1\utlmemory.h"
>
RelativePath="..\public\tier1\utlmemory.h">
</File>
<File
RelativePath="..\public\tier1\utlmultilist.h"
>
RelativePath="..\public\tier1\utlmultilist.h">
</File>
<File
RelativePath="..\public\tier1\utlpriorityqueue.h"
>
RelativePath="..\public\tier1\utlpriorityqueue.h">
</File>
<File
RelativePath="..\public\tier1\utlqueue.h"
>
RelativePath="..\public\tier1\utlqueue.h">
</File>
<File
RelativePath="..\public\tier1\utlrbtree.h"
>
RelativePath="..\public\tier1\utlrbtree.h">
</File>
<File
RelativePath="..\public\tier1\UtlSortVector.h"
>
RelativePath="..\public\tier1\UtlSortVector.h">
</File>
<File
RelativePath="..\public\tier1\utlstack.h"
>
RelativePath="..\public\tier1\utlstack.h">
</File>
<File
RelativePath="..\public\tier1\utlstring.h"
>
RelativePath="..\public\tier1\utlstring.h">
</File>
<File
RelativePath="..\public\tier1\UtlStringMap.h"
>
RelativePath="..\public\tier1\UtlStringMap.h">
</File>
<File
RelativePath="..\public\tier1\utlsymbol.h"
>
RelativePath="..\public\tier1\utlsymbol.h">
</File>
<File
RelativePath="..\public\tier1\utlvector.h"
>
RelativePath="..\public\tier1\utlvector.h">
</File>
<File
RelativePath="..\common\xbox\xboxstubs.h"
>
RelativePath="..\common\xbox\xboxstubs.h">
</File>
</Filter>
</Files>