.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Bot Coding (http://forums.bots-united.com/forumdisplay.php?f=24)
-   -   how to let REAL players move ? (http://forums.bots-united.com/showthread.php?t=393)

Rick 16-01-2004 22:31

how to let REAL players move ?
 
For some reason I don't get this to work.... Setting v.button to IN_FORWARD doesn't work, execute "+forward" gives an unknow command error. Only with runplayermove you can let players move but then you have to set FL_FROZEN otherwise you get weird movement(a bit shocky). Does anyone know a way how todo it ?

Thanx in advance

Cheeseh 16-01-2004 22:35

Re: how to let REAL players move ?
 
The only thing I can guess is to update their velocity to whatever velocity you want (in pev->velocity)

Maybe an UpdateClientData would work after setting pev->buttons |= IN_FORWARD, or a DispatchThink().

Rick 17-01-2004 12:10

Re: how to let REAL players move ?
 
thanx ... but it didn't work :(
Calling updateclientdata or dispatchthink won't do anythink and setting the velocity gives weird results like no gravity. Unless I do it completely wrong...
Code:

pEntity->v.button |= IN_FORWARD;
UTIL_MakeVectors(pEntity->v.v_angle);
pEntity->v.velocity = gpGlobals->v_forward * pEntity->v.maxspeed;

But then I find it weird that +forward won't work or FakeClientCommand on a normal client failes on this :|

Cheeseh 17-01-2004 13:18

Re: how to let REAL players move ?
 
yeah +forward wont work because its not a nnormal cvar command. (Uses pfnAddCommand) which uses the input keys stuff on the client. (Have a look at keyDown on the sdk..) I don't think you can access that stuff though a server :(

oh yea.. for the gravity stuff you can maybe add your own code to not update the velocity at certain points if the player is falling (not on ground) etc.

and you could also try PlayerPostThink on the player after setting the buttons, can't remember if pre-think resets the buttons or something, but since its done on the client I would guess not.

stefanhendriks 17-01-2004 14:41

Re: how to let REAL players move ?
 
i remembered that Android Bot could even get your player be controlled by a bot. So how did he dod that? There has to be some possiblity?

Rick 17-01-2004 15:20

Re: how to let REAL players move ?
 
yes... count floyd does this aswell for his 'borg mode'. I have something simulair based on his code. I dunno if he uses the same way as the android bot author did but he just uses runplayermove on a normal client. But he removes the flag FL_FROZEN before he calls the function and he sets it after the function is called. If you won't do this you will move kinda weird(a bit shocky). But if you set FL_FROZEN player can't charge any attacks.... and since this its very common in esf to charge an attack...

And I tried setting IN_FORWARD in postthink but with no luck :( I remember something that it won't work with all kinda buttons.

Pierre-Marie Baty 18-01-2004 17:22

Re: how to let REAL players move ?
 
AFAIK the only way to force a player animation is through RunPlayerMove()... you can't force a client to send instant client commands (it would mean that your DLL on the server would need to send a network message to this client to ask him to press certain buttons, and the client would reply back with the right network messages... this is just silly)


All times are GMT +2. The time now is 09:54.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.