.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > General Bot Coding
General Bot Coding See what a pain it is to get those little mechs shooting around

Reply
 
Thread Tools
Don't jump ?
Old
  (#1)
slash-evil
Guest
 
Status:
Posts: n/a
Default Don't jump ? - 03-03-2004

One qeustion , is setting this below bit can make the bot don't jump ?

pEdict->v.button &= ~(IN_JUMP);

I don't think it does , because although I place it into my code , the bot also jump ,is the code wrong , or what , any ideas ???
  
Reply With Quote
Re: Don't jump ?
Old
  (#2)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Don't jump ? - 03-03-2004

The code you posted will clear the IN_JUMP bit of v.button. That is, if this bit is set to 1, it will set it back to 0.

Yes, this code can force the bot not to jump, but you have to ensure that nothing sets the IN_JUMP bit again later on in the code, AFTER this bit. The pEdict->v.button fields are only used when pfnRunPlayerMove() is called, not before - so ensure nothing breaks what you've done in between.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Don't jump ?
Old
  (#3)
bluesy
Moderator
 
bluesy's Avatar
 
Status: Offline
Posts: 3
Join Date: Jan 2004
Location: Israel
Default Re: Don't jump ? - 03-03-2004

Try moving that line as close as possible to pfnRunPlayerMove() so you won`t override IN_JUMP by mistake.

*someone beat me to it


8D
  
Reply With Quote
Re: Don't jump ?
Old
  (#4)
slash-evil
Guest
 
Status:
Posts: n/a
Default Re: Don't jump ? - 04-03-2004

See this one

Code:
if((BotUsesSniper(pBot) && pBot->iStates & STATE_SEEINGENEMY))
{
	pEdict->v.button |= IN_DUCK;
	pBot->f_move_speed = 0.0;
	pBot->f_sidemove_speed = 0.0;
	pBot->f_move_speed=0; pBot->f_sidemove_speed=0; 
    pEdict->v.button |= IN_ATTACK2;
	pEdict->v.button |= IN_ATTACK;
	pEdict->v.button &= ~(IN_JUMP);
}
Are you think the pEdict->v.button &= ~(IN_JUMP); is at the right place ?

*note I tested this code , it worked , it is a improved sniper code done by me
, it is a older version , I have a newer version of the code , so I just need
to make sure the bot don't jump *

Last edited by slash-evil; 04-03-2004 at 00:33..
  
Reply With Quote
Re: Don't jump ?
Old
  (#5)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Don't jump ? - 04-03-2004

Well if it works I suppose it's okay...

But I wouldn't do things like that if it was my own bot. In fact what you are doing is that you are correcting a wrong behaviour by adding the opposite behaviour on top of it. I call this "patching".
You should better try to figure out WHY your bot jumps when using a sniper rifle and make it NOT press the IN_JUMP key then.

Ah I know, it's more difficult.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Don't jump ?
Old
  (#6)
slash-evil
Guest
 
Status:
Posts: n/a
Default Re: Don't jump ? - 04-03-2004

Yeah , you're right , I'm studying the code now !
  
Reply With Quote
Re: Don't jump ?
Old
  (#7)
botman
Super Moderator
 
Status: Offline
Posts: 280
Join Date: Jan 2004
Location: Plano, TX
Default Re: Don't jump ? - 04-03-2004

Why are you pressing both attack buttons at once (both IN_ATTACK and IN_ATTACK2)?

botman
  
Reply With Quote
Re: Don't jump ?
Old
  (#8)
Rick
Council Member
 
Rick's Avatar
 
Status: Offline
Posts: 690
Join Date: Dec 2003
Location: Holland
Default Re: Don't jump ? - 04-03-2004

BLEH useless post :S

Last edited by Rick; 04-03-2004 at 23:08..
  
Reply With Quote
Re: Don't jump ?
Old
  (#9)
Rick
Council Member
 
Rick's Avatar
 
Status: Offline
Posts: 690
Join Date: Dec 2003
Location: Holland
Default Re: Don't jump ? - 04-03-2004

And setting move_speed and side_speed twice to zero
I think if you just set IN_ATTACK2 once when he starts to snipe is enough
  
Reply With Quote
Re: Don't jump ?
Old
  (#10)
slash-evil
Guest
 
Status:
Posts: n/a
Default Re: Don't jump ? - 05-03-2004

Ha , it is just for testing !
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com