I just add some codes so bot can fire SMG Grenade and AR2 Ball and throw Grenade by right clicking mouse
and i also made a map(named Salvax , full of Ar2 guns , Ar2 balls , SMG guns and SMG grenades), so i can test if my code works, and i biult a new DLL , it works.
PLZ download it at the bottom of my post and test, THX !
________________________
modified file list:
bot.cpp
bot.h
bot_buttons.cpp
bot_buttons.h
bot_task.cpp
bot_weapons.h
some pictures from my testing map with bots:
http://ihost-images.biz/i/finally!!!1.JPG
http://ihost-images.biz/i/finally!!!2.JPG
http://ihost-images.biz/i/finally!!!3.JPG
and i got a small question about the length unit in ur source files , e.g.:
bot_weapons.h - line 166 to line 171
QUOTE
// shoot distance (default)
m_fPrimMinWeaponShootDist = 0.0f;
m_fPrimMaxWeaponShootDist = 8192.0f;
m_fSecMinWeaponShootDist = 0.0f;
m_fSecMaxWeaponShootDist = 2048.0f; // SMG Grenade & AR2 Ball for BOT by Salvax
m_fPrimMinWeaponShootDist = 0.0f;
m_fPrimMaxWeaponShootDist = 8192.0f;
m_fSecMinWeaponShootDist = 0.0f;
m_fSecMaxWeaponShootDist = 2048.0f; // SMG Grenade & AR2 Ball for BOT by Salvax
i donot know what 8192.0f exactly means in Source SDK mapping ...so i donot know how to set the value of
QUOTE
m_fSecMinWeaponShootDist = ???f;
m_fSecMaxWeaponShootDist = ???f;
m_fSecMaxWeaponShootDist = ???f;
i wanna know 1000f in source file = X*1024 in SDK mapping, X=?
and a small problem about the holding button time and letgo time, i dont know what the value in ur source exactlly means : e.g.
bot.cpp - line 1109 to 1124
QUOTE
void CBot :: primaryAttack ()
{
float fLetGoTime = 0.15;
// not currently in "letting go" stage?
if ( m_pButtons->canPressButton(IN_ATTACK) )
{
m_pButtons->holdButton
(
IN_ATTACK,
0/* reaction time? (time to press)*/,
0.12/* hold time*/,
fLetGoTime/*let go time*/
);
}
}
{
float fLetGoTime = 0.15;
// not currently in "letting go" stage?
if ( m_pButtons->canPressButton(IN_ATTACK) )
{
m_pButtons->holdButton
(
IN_ATTACK,
0/* reaction time? (time to press)*/,
0.12/* hold time*/,
fLetGoTime/*let go time*/
);
}
}
I wanna know the time value, for example 0.12/* hold time*/ = ? seconds
plz help me, Captain ! THX !
_______________________________
File Name: rcbot2_test_only_feb22.rar
Size: 248KB |
Download Link: http://www.sendspace.com/file/3363wq