Controlling player position directly

Hi all
Do you think it would be possible in a mod to control the position of the player directly (i.e. specifying co-ordinates every frame) and bypass the keyboard input/handling? Would that mean writing custom code to animate the motion?

cheers
 
If you bypass the keyboard input, how are you going to know where the player wants to go?
 
Can you explain why you want to do it?

It might make more sense then.
 
Hi again
I want to use the HL-2 engine as a simulator, so I want to feed in live position data and use that to control the position of the player
 
oh, ok.

Well, you can do that through the map editor. I haven't played with it at all yet, but I've seen the things in there.
 
OK does this mean I can do this in realtime while the game plays? so instead of pressing "W" and the player moves forward, I have code that sends a stream of co-ordinates (12,34,0 ... 13,34,0... etc) and the player model moves to those co-ordinates... make sense?
cheers
 
The simplest way I can think of would be to snap the player's eyes towards what he needs to move at (CBasePlayer::SnapEyeAngles), then execute the callback for the +forward console command for a certain amount of time.

@RabidJester
Are you sure the PLAYER can be set to move a certain direction in Hammer? I was pretty sure you could only do that with NPC's.
 
N3ur0 said:
The simplest way I can think of would be to snap the player's eyes towards what he needs to move at (CBasePlayer::SnapEyeAngles), then execute the callback for the +forward console command for a certain amount of time.

@RabidJester
Are you sure the PLAYER can be set to move a certain direction in Hammer? I was pretty sure you could only do that with NPC's.

As far as I know every entity in Hammer can be set to a certain direction, including the info_player_start
 
Of course you can do THAT in the map. RabidJester was talking about using map entities to actually move the player around.
 
That is generally not a good way to move players around - especially when working alongside rigid body physics.. I think you would get some very odd behaviious when your "player" collided with anything that used havok.
 
ok, I was referring to the point_viewcontrol

From that other evil site:
point_viewcontrol

Source(core) Point Entity


description

A camera entity that controls the player's view. While it's active, the player will see out of the camera.


properties

* Name targetname(target_source)
The name that other entities refer to this entity by.
* Pitch Yaw Roll (Y Z X) angles(angle) - default: 0 0 0
This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.
* Parent parentname(target_destination)
The name of this entity's parent in the movement hierarchy. Entities with parents move with their parent.
* Entity to Look At target(target_destination)
Name of the entity that the camera should point at and track while active.
* Target Attachment Name targetattachment(string)
If set, the camera will focus on the specified attachment on the 'Entity to Look At'.
* Hold Time wait(integer) - default: 10
The amount of time the camera should control the player's view for, after which it deactivates itself. If the camera should stay active until told to deactive, set the 'Infinite Hold Time' spawnflag.
* Path Corner moveto(target_destination)
The first path corner in a track that the camera should move along once it's activated. If not specified, the camera won't move.
* Initial Speed speed(string) - default: 0
The starting speed that the camera moves at, if it's on a path track.
* Acceleration units/sec^2 acceleration(string) - default: 500
The speed at which the camera accelerates to path corner's desired speeds.
* Stop Deceleration units/sec^2 deceleration(string) - default: 500
The speed at which the camera decelerates to path corner's desired speeds.

spawn flags

* 1: Start At Player - default: ON
* 2: Follow Player - default: ON
* 4: Freeze Player - default: OFF
* 8: Infinite Hold Time - default: OFF
* 16: Snap to goal angles - default: OFF
* 32: Make Player non-solid - default: OFF
* 64: Interruptable by Player - default: OFF


I didn't take a long look at it. But it seems that may be what you are looking for. You'd need to define your path in hammer, I suppose.
 
Back
Top