View Single Post
Re: Turning bot's head?
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: Turning bot's head? - 17-03-2004

@botman: that would be quite fun indeed

@two masks: In the latest versions of Half-Life (Steam versions), Valve changed the way the engine behaves with players and monsters. Now players can turn their torso while standing still, and their feet stay in the same position, unless the player takes a physically impossible position then the engine makes the player turn its feet as well. You can see this in Counter-Strike 1.6 for example. Before that, it was impossible for a player model to point a gun (and thus look) in another direction than the direction the player was moving forwards to, and it should NOT have been possible for bots as well (logically) but either there was an exception with bots or they left out a bug, but most of the bot makers used then to separate their bot's head angles and body angles. This had the advantage to make it easier for them to make their bots run in some direction while shooting at another. A normal player wouldn't have been able to do that, a normal player would have had to alternate his strafe left/right and forward/backwards keys while shooting if he wanted to shoot in some direction while running in another.

To separate your bot's body and head angles, either you are running the Steam HL engine or the old one.

- With the Steam engine:
1. If your player is standing still, you won't be able to change his body angles, only his view angles. It's the HL engine which will decide of the direction of your player's feet while standing still. You can still change your player's view angle by changing his v_angle, not omitting to pass the same value in RunPlayerMove. If you omit this, your player will not fire in the direction he's looking at, and there will then be 3 directions: FEET (body angles), GUN (v_angle) and HEAD (RunPlayerMove). Although the gun angle won't be differenciated from the head angles on the player model, it will just look as if the player was firing forwards and the bullets were going backwards or sideways.
2. If your player is running, his body angles will be determined by the forward, lateral and vertical speeds that you pass in RunPlayerMove. Again, it's the engine which will decide of the body angles according to the speeds passed. You are still in control of the head angles in the same way as above, though.

- With the old engine:
1. If your player is standing still, the engine will make his body angles identical to his view angles. If you change his view angles and reflect this change in RunPlayerMove, ALL the model's angles will rotate together. If you don't reflect your change in RunPlayerMove, all the model's angle will rotate but the player will be farting bullets by his ass hole.
2. If your player is moving, it's the exact same behaviour as with the new engine (see 2. above)

Being paid for doing a bot ? lucky man



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