Raised This Month: $51 Target: $400
 12% 

How to control fake client movement?


Post New Thread Reply   
 
Thread Tools Display Modes
Beaverboys
Member
Join Date: Aug 2012
Old 07-20-2015 , 11:26   Re: How to control fake client movement?
Reply With Quote #21

Still haven't figured it out, any ideas?
Beaverboys is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 07-20-2015 , 11:56   Re: How to control fake client movement?
Reply With Quote #22

Try buttons |= IN_FORWARD
Miu is offline
Dr. Api
BANNED
Join Date: Mar 2015
Location: France
Old 07-20-2015 , 18:27   Re: How to control fake client movement?
Reply With Quote #23

Teleport + vector force make the run or walk animation. Like you are pushed.
Just look at the botmimic plugin. The .rec containts all float positions and vec forces.
Dr. Api is offline
DeathChaos25
Senior Member
Join Date: Jan 2014
Location: Puerto Rico
Old 07-20-2015 , 19:41   Re: How to control fake client movement?
Reply With Quote #24

Quote:
Originally Posted by Miu View Post
Try buttons |= IN_FORWARD
^ This.

You can calculate the aim angles needed between your bot and it's destination
PHP Code:
decl Float:Origin[3], Float:EyePos[3], Float:AimOnEntity[3], Float:AimAngles[3];
GetEntPropVector(entityProp_Send"m_vecOrigin"Origin);
GetClientEyePosition(clientEyePos);
MakeVectorFromPoints(EyePosOriginAimOnEntity);
GetVectorAngles(AimOnEntityAimAngles);
TeleportEntity(clientNULL_VECTORAimAnglesNULL_VECTOR); 
This would force your fake bot to aim at whatever entity you want it to aim at,
and using OnPlayerRunCMD you can force IN_FORWARD to make the bot walk forwards.
__________________
DeathChaos25 is offline
Beaverboys
Member
Join Date: Aug 2012
Old 07-24-2015 , 09:28   Re: How to control fake client movement?
Reply With Quote #25

I tried all of the following:

buttons |= IN_FORWARD
FakeClientCommand(client, "+forward")
FakeClientCommandEx(client, "+forward")
ClientCommand(client, "+forward")
TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, Float:{400.0, 0.0, 0.0})

The first 4 did absolutely nothing and the last one basically gave me the same issue. I couldn't really decipher the code from the bot mimic plugin either.
Beaverboys is offline
kadet.89
Veteran Member
Join Date: Nov 2012
Location: Serbia
Old 07-24-2015 , 12:44   Re: How to control fake client movement?
Reply With Quote #26

https://forums.alliedmods.net/showthread.php?t=157075

Example:
https://youtu.be/CDtgppoIXa4?t=102 (not related to you question)

I'm nearly sure, you can control any bot action with these functions:

CCSBot::BuildTrivialPath(Vector const&)
CCSBot::ComputePath(Vector const&,RouteType)
CCSBot::ComputePathPositions(void)
CCSBot::FindApproachPointNearestPath(Vector *)
CCSBot::FindClosestPointOnPath(Vector const&,int,int,Vector*)
CCSBot::FindEntitiesOnPath(float,CPushAwayEnu merator *,bool)
CCSBot::FindGrenadeTossPathTarget(Vector *)
CCSBot::FindMostDangerousThreat(void)
CCSBot::FindOurPositionOnPath(Vector *,bool)
CCSBot::FindPathPoint(float,Vector *,int *)
CCSBot::IsStraightLinePathWalkable(Vector const&)

CCSBot::Jump(bool)
CCSBot::Attack(CCSPlayer *)
CCSBot::Buy(void)
CCSBot:rimaryAttack(void)

CCSBot::MoveAwayFromPosition(Vector const&)
CCSBot::MoveTo(Vector const&,RouteType)
CCSBot::MoveToInitialEncounter(void)
CCSBot::SetAimOffset(float)
CCSBot::MoveTowardsPosition(Vector const&)
CCSBot::Walk(void)
...so on

There are about 220 functions

Last edited by kadet.89; 07-24-2015 at 13:02.
kadet.89 is offline
Send a message via Skype™ to kadet.89
DeathChaos25
Senior Member
Join Date: Jan 2014
Location: Puerto Rico
Old 07-24-2015 , 14:06   Re: How to control fake client movement?
Reply With Quote #27

IN_FORWARD should've done the job perfectly, I have no idea why it would not work.

Here's an example plugin from L4D2 that I made that forces IN_ATTACK to fake clients, maybe looking at my shitty code might help you somewhat.
__________________
DeathChaos25 is offline
Beaverboys
Member
Join Date: Aug 2012
Old 07-25-2015 , 07:06   Re: How to control fake client movement?
Reply With Quote #28

Here is my code inside OnPlayerRunCmd
PHP Code:
////////// BOTS //////////
        
if (IsBot[client])
        {
                
GetEntPropVector(clientProp_Data"m_vecOrigin"floatvar);
                
targ_origin TargetOrigin[client], targ_origin[2] = floatvar[2];
                
IsUserClose = (GetVectorDistance(floatvartarg_origin) > 30.0) ? 1buttons 0;

                if (!
IsUserClose)
                {
                    
targ_origin[0] -= floatvar[0], targ_origin[1] -= floatvar[1], targ_origin[2] -= floatvar[2];
                    
v_length GetVectorLength(targ_origin);
                    
targ_origin[0] /= v_lengthtarg_origin[1] /= v_lengthtarg_origin[2] /= v_length;
                    
GetVectorAngles(targ_originfloatvar);
                    
floatvar[0] *= -1;
                    if (
floatvar[1] > 180.0floatvar[1] -= 360;
                    else if (
floatvar[1] < -180.0floatvar[1] += 360;
                    else if (
floatvar[1] == 180.0 || floatvar[1] == -180.0floatvar[1] = -179.999999;

                    
TeleportEntity(clientNULL_VECTORfloatvarNULL_VECTOR);
                }
                else if (
Snapstat != || TeamWithBall == (GetClientTeam(client) - 1))
                    
buttons = (Snapstat == && (client == TCenter || client == CTCenter)) ? IN_DUCK IN_ATTACK;

                if(!
IsUserClose && Snapstat != && !(Kicking && !Snapstat) && GameActive)
                    
vel[0] = 400.0vel[1] = 0.0vel[2] = 0.0;
        } 
I replaced the velocity values with buttons |= IN_FORWARD and it did nothing.
Beaverboys is offline
Alienmario
Senior Member
Join Date: Aug 2013
Old 07-25-2015 , 07:59   Re: How to control fake client movement?
Reply With Quote #29

Quote:
Originally Posted by DeathChaos25 View Post
IN_FORWARD should've done the job perfectly, I have no idea why it would not work.

Here's an example plugin from L4D2 that I made that forces IN_ATTACK to fake clients, maybe looking at my shitty code might help you somewhat.
Try to return Plugin_Changed or manually set m_nButtons ent prop.
Alienmario is offline
Beaverboys
Member
Join Date: Aug 2012
Old 08-17-2015 , 00:15   Re: How to control fake client movement?
Reply With Quote #30

Still doesn't work. I should have mentioned I was using "bot_stop 1" (which requires sv_cheats) to disable the bots before i started working with them. I think this might be causing the problem, does anybody know a different way of disabling the bots before I program them myself?
Beaverboys is offline
Reply



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


All times are GMT -4. The time now is 06:24.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode