IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> 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
Cheeseh
post Feb 21 2007, 08:56 PM
Post #2


Admin
*****

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



hold time = the amount of time the button is held
let go time = the amount of time the button is let go after it is held.

it can be anything, just make it useful. A short let go time and short hold time is useful for secondary attack. How long do you hold in the secondary attack to fire an smg grenade ? not long. Do you need to let go of the button and for how long (let go time)?

also the bot weapon code isn't implemented into the actual bot. You will notice that The CBotWeapons (m_pWeapons) class isn't actually used at all, it's just created and deleted, its there for future use once all weapon code can be done. (All the m_fSecMinWeaponShootDist stuff isn't even used, not even the primary stuff yet) so no need to even look at it right now.

QUOTE

File Name: rcbot2_preview_feb22.rar (including test map:salvax)
Size: 241KB |
Download Link: http://www.sendspace.com/file/l371kq


remember any release builds of modified source code must be distributed with the modified source code and GPL license(s) attached - read GPL license "TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION" no.3. http://www.gnu.org/copyleft/gpl.html#TOC3
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Salvax
post Feb 22 2007, 02:38 AM
Post #3


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 #4


Admin
*****

Group: Admin
Posts: 3,057
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
Salvax
post Feb 22 2007, 10:12 AM
Post #5


Advanced Member
***

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



i agree, but in the game, if player get limited SMG Grenades and AR2 Balls , he would like to fire them on the target, of cause the random code is better than bot button code , if i have time i will try it later, thx a lot !
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Lamron333
post Jun 5 2007, 12:15 AM
Post #6


Newbie
*

Group: Members
Posts: 3
Joined: 4-June 07
Member No.: 1,143



QUOTE(Salvax @ Feb 21 2007, 06:14 PM) *

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
i donot know what 8192.0f exactly means in Source SDK mapping ...so i donot know how to set the value of
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
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

Link busted
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

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: 28th April 2024 - 09:29 PM