![]() |
Yay - Bots move to given vector location...
It took a bit of fiddling , but i got it working, so here a little tutorial to get it working for you too (based on botmans template), its not completely step by step, but it has lots of code snippets.
first, make sure the viewangles get updated by WriteUserCmd in the hpb_bot2_usercmd.x file: Code:
// THIS IS OLD.... So, first we need a vector in the bot_t so we get our bot moving to that vector constantly. Since the usercmd calls them viewangles (which is NOT correct) , i call it vViewVector. Code:
typedef struct Code:
//----------------------------------------------------------------------------- Code:
if (pBot->vViewVector != Vector(0,0,0)) Code:
Vector botVec=Vector(0,0,0); 1. get the bot vector itself 2. substract your vector with the botvector 3. and finally set vViewVector to vDir * EDIT: Let me know if it does , or does not, work for you. I could have forgotten something. NOTE: THe bots do not LOOK at the direction, they MOVE at the direction, given the forward speed of the usercmd. (there is no sidespeed set, etc). I am still looking for a proper 'looking' function. |
Re: Yay - Bots move to given vector location...
so, did it work for anyone as well? (or any difficulties?). Or does this silence mean this post is uber l33t? :P
|
Re: Yay - Bots move to given vector location...
I was able to get them to move in the proper YAW direction once I added the viewangles stuff (but I was just setting the YAW directly via a ClientCommand thing I added so that I could change it on the fly).
I looked through the SDK dlls code a bit to try to determine what sets the facing direction properly, but never found it. I won't have time to look at this stuff again until probably late February or early March. botman |
Re: Yay - Bots move to given vector location...
i just hope the looking will be also 'as easy' because frankly i havent seen anything that will help me just yet. I try to find some info on a'fire a bullet' function so i know how they calculate it, but without getting the SDK compiled 100% properly under MSVC i am stuck with searching through files with Windows Commander (which is slow. :S)
|
Re: Yay - Bots move to given vector location...
I gave alfred an email about how to get "EyeAngles" without CBaseEntity/CBasePlayer, just the edict. I'll see if he gives a response, or the bot documentation for the SDK will be released before then :P
|
Re: Yay - Bots move to given vector location...
rofl yeah, well its good to keep on mailing them :D so far we made quite some progress imo in a 'short' amount of time :D
|
Re: Yay - Bots move to given vector location...
Alfred replied to say that you can only change eye angles if you have access to CBasePlayer (as botman said :p) They're working on how to access eye angles through plugins but have no date.
|
Re: Yay - Bots move to given vector location...
cheeseh, i tried ur code , but though i could not test it myself. Asp tried it for me , and he said it did not work? Are you sure it works for player entities as well?
|
Re: Yay - Bots move to given vector location...
The origin code? It works for me as a player, maybe it doesn't work for bots. I haven't tried it for getting bots origins though ...
|
Re: Yay - Bots move to given vector location...
the bots with stefans code ran always towards this corner at the ct spawn in de_cbble near to that bomb site and that fence there. dunno the coordinates yet there, but I wouldnt be surprised if there would be (0,0,0) :)
|
All times are GMT +2. The time now is 07:45. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.