Inside3D!
     

Getting Frikbot to shoot an entity

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Artificial Intelligence
View previous topic :: View next topic  
Author Message
CocoT



Joined: 14 Dec 2004
Posts: 599
Location: Belly-Gum

PostPosted: Thu Jul 05, 2007 10:06 pm    Post subject: Getting Frikbot to shoot an entity Reply with quote

Hi! Smile
I'm playing around with a little something here and was wondering if there was an easy way to make a Frikbot shoot an entity that is not a player or a monster. Basically, I'm making the player create an entity and would like bots to shoot at it (while shooting at each other and/or the player). I've tried a couple of things but can't seem to make it work. Any suggestions? Smile
_________________
http://www.planetcocot.net/
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Orion



Joined: 12 Jan 2007
Posts: 413
Location: Brazil

PostPosted: Thu Jul 05, 2007 11:45 pm    Post subject: Reply with quote

Yes! Smile

You can do it pretty easily, search fot bot_dodge_stuff() at bot_fight.qc and add this in the (else) after (if (coop)) statement:

Code:

local entity head;
head = findradius(self.origin, 9999);
while(head)
{
   if(head.classname == "something")
   {
      if(head.health > 0)
      {
         tsz = bot_size_player(head) + vlen(head.origin - self.origin) * 0.5;
         if (tsz < foesz)
         {
            if (fov(head) || head.b_sound > time || self.b_skill == 3)
            {
               if (fisible(head))
               {
                  self.enemy = head;
                  foesz = tsz;
               }
            }
         }
      }
   }
   head = head.chain;
}

_________________
There's no signature here. Stop looking for one.
Back to top
View user's profile Send private message
Electro



Joined: 29 Dec 2004
Posts: 241
Location: Brisbane, Australia

PostPosted: Fri Jul 06, 2007 12:11 am    Post subject: Reply with quote

If you really want to shove things down its throat you could always just do:

self.enemy = targetentity;

at the end of BotAI

BotAI is called pretty often, so if it's an entity you already know.. should be fine, but you don't want to be doing a find here methinks.

Really depends on what you're using it for! Smile
_________________
Unit reporting!
http://www.bendarling.net/
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
CocoT



Joined: 14 Dec 2004
Posts: 599
Location: Belly-Gum

PostPosted: Fri Jul 06, 2007 9:38 am    Post subject: Reply with quote

Great! Thanks a lot, guys, it works fine now Very Happy
_________________
http://www.planetcocot.net/
Back to top
View user's profile Send private message Send e-mail Visit poster's website
FrikaC
Site Admin


Joined: 08 Oct 2004
Posts: 947

PostPosted: Fri Jul 06, 2007 2:25 pm    Post subject: Reply with quote

Wait. FrikBot....shooting entities....I don't see how that fits with either InfraRed or SpaceWalk.....
Back to top
View user's profile Send private message Send e-mail
Entar



Joined: 05 Nov 2004
Posts: 422
Location: At my computer

PostPosted: Fri Jul 06, 2007 3:09 pm    Post subject: Reply with quote

Who said he's working on one of those two? CocoT seems to have a certain aptitude for working on multiple mods at a time... dum dum DUM!
_________________
woh... feelin woozy... too much cider...
http://entar.quakedev.com
games fascination - My Game Development Blog/Journal
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
CocoT



Joined: 14 Dec 2004
Posts: 599
Location: Belly-Gum

PostPosted: Fri Jul 06, 2007 8:00 pm    Post subject: Reply with quote

Shocked

...

/me tiptoes out of the thread...

... but trips on his own screenshot



... ouch!
_________________
http://www.planetcocot.net/
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Artificial Intelligence All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group