![]() |
Re: Yay - Bots move to given vector location...
small fix to check if a dedicated server;)
Code:
void CUBBOT_Plugin::ClientActive (edict_t *pEntity) edit few engine notes. -- class CBasePlayer pBot->pPlayerEnt -- pPlayerEnt->MaxSpeed (); // max speed pPlayerEnt->IsSuitEquipped (); // armor equipped pPlayerEnt->ArmorValue (); // armor amount pPlayerEnt->GetFOV (); & pPlayerEnt->GetDefaultFOV (); // get current, default fov -- CBaseEntity class pBot->pBaseEntity --- pBaseEntity->GetMaxHealth (); // max health pBaseEntity->GetHealth (); // current health pBaseEntity->GetTeamNumber (); // current team pBaseEntity->TeamID (); // current team`s name // CS:S : 1 = Spectator, 2 = Terrorist, 3 = Counter-Terrorist pBaseEntity->InSameTeam (pBaseEnemy); // is client on the same team enjoy Dubb;) |
Re: Yay - Bots move to given vector location...
great work Dub! Thats something i always wanted to know.
@ pmb, yes i already know you have to do something with that cmd.weaponselect thingy, but how its parsed, thats a clue to me (perhaps an impulse command). /me digs very quick in the code: * found this in usercmd.h (snippet) Code:
// Impulse command issued. Perhaps its the 'menu + submenu' thing. Like, ie, in CS the 4th weapon slot = grenades, and subtype is then a frag/flash/smoke grenade. But this also means you have to keep track of what a bot has because this 'order' changes (depending on what you have bought or not)... |
Re: Yay - Bots move to given vector location...
solution to getting weapon information.
add to the bot_t structure this Code:
CBaseCombatCharacter *pBaseCombatChar; Code:
pBot->pBaseCombatChar = pBot->pBaseEntity->MyCombatCharacterPointer (); Code:
CBaseCombatWeapon *pCurrentWeapon = pBot->pBaseCombatChar->GetActiveWeapon (); |
Re: Yay - Bots move to given vector location...
hmm yes, still remains an ugly hack :) any files we need to include with the project as well? or is that it? :)
*EDIT: i think you can change weapons via that way as well right? But, in CSS this would probably be different compared to the HL2 SDK code... did you test this code you posted here? |
Re: Yay - Bots move to given vector location...
untested the hack, having problem`s compiling with
CBaseCombatWeapon class included. |
Re: Yay - Bots move to given vector location...
i was afraid for that ;)
|
Re: Yay - Bots move to given vector location...
About the pBaseEnt->GetFOV
it does nothing but return a floating point if iw as not mistaken... does not help us much yet ;) |
Re: Yay - Bots move to given vector location...
stefan did you manage to compile accessing pPlayerEnt->GetFOV ()?
i keep getting unresolved external compiler error. Code:
ubbot.obj : error LNK2001: unresolved external symbol "public: int __thiscall CBasePlayer::GetFOV(void)const " (?GetFOV@CBasePlayer@@QBEHXZ) |
Re: Yay - Bots move to given vector location...
Good work Dub!
For finding out what you can access within the classes you need to check for members which are either fully defined within the header file, or are declared with the virtual state. Then you include the header file only and don't need to worry about the linking to the cpp file. However this technique only works because they have derived the 'working' classes from the ones we can see. E.G. for CS the player class is actually CSPlayer. It's not a hack, but it will fail if a mod doesn't follow valves layout to the letter. Also, isn't the float that GetFOV() returns related to the angle of the viewing cone, either degrees or possibly radians? |
Re: Yay - Bots move to given vector location...
thanks steve for the tips, much appreciated :D.
just a quick question, does this mean we can`t use GetFOV () because it`s not declared virtual or in the baseentity header? |
All times are GMT +2. The time now is 18:18. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.