IPB

Welcome Guest ( Log In | Register )

> Finally bots can fire SMG Grenade and AR2 Ball ...etc, i added some codes of the secondary firing mode
Salvax
post Feb 21 2007, 06:14 PM
Post #1


Advanced Member
***

Group: Members
Posts: 75
Joined: 14-February 07
Member No.: 1,034



hmmm, thx Captain Cheeseh !!! Thank u for ur infinite patiance and greate instructions. U r the hero !

I just add some codes so bot can fire SMG Grenade and AR2 Ball and throw Grenade by right clicking mouse smile.gif

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


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;


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*/
);
}
}


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
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
 
Reply to this topicStart new topic
Replies
Salvax
post Feb 22 2007, 02:38 AM
Post #2


Advanced Member
***

Group: Members
Posts: 75
Joined: 14-February 07
Member No.: 1,034



so i can just take 2.50/* hold time*/ = 2.5 seconds or something else ?

secondary attack 's let go time must be long, because bots has limited secondary ammo . Bot must pick up the secondary ammo even we already set the bots' weapon SMG and AR2.

ok, the firing distance issue , Never mind.

Riger that, Captain, i will re-upload the test only pack with GPL license(s) attached (modified in the first post)

PS:
bot.cpp - line 77 to 80

const float CBot :: m_fAttackLowestHoldTime = 0.1f;
const float CBot :: m_fAttackHighestHoldTime = 0.6f;
const float CBot :: m_fAttackLowestLetGoTime = 0.1f;
const float CBot :: m_fAttackHighestLetGoTime = 0.5f;

do these time values do something with attack time values below?:

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*/
);
}
}




bot_buttons.cpp - line 35 to 38

QUOTE
void CBotButtons :: attack (float fFor, float fFrom)
{
holdButton(IN_ATTACK,fFrom,fFor,0.1);
}


plz explain what fFrom/fFor/0.1(is it fLetGoTime?) mean ? do these time values do something with attack time values above ? THX !
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Cheeseh
post Feb 22 2007, 08:34 AM
Post #3


Admin
*****

Group: Admin
Posts: 3,066
Joined: 11-September 03
From: uk
Member No.: 1



look at the function for hold button

void CBotButtons :: holdButton ( int iButtonId, float fFrom, float fFor, float fLetGoTime )

holdButton(IN_ATTACK,fFrom,fFor,0.1);

iButtonId = INATTACK
fFrom = <fFrom> /* time to press */,
fFor = <fFor> /* hold time*/
fLetGoTime = 0.1 /*let go time*/

m_fAttackLowestHoldTime etc were only used briefly and not used at all right now (search for the variable usign the MSVC search, going through all .cpp/.h files) Most of these will answer your questions.

I would implement secondary attacks slightly different, not by using bot buttons all the time but by having a timer or random technique that uses a short secondary attack button
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th June 2025 - 01:29 AM