Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
ChamesyGaming

How could I create constant subtle head bobbing in DOOM 2?

Recommended Posts

Hey all,

 

I am wondering how I can make the players head/camera constantly move up down, left right, forwards and backwards, (and maybe even pivot left and right) very very slightly in a random fashion in game?

 

This is a feature John Romero wanted to implement into quake for the players first person perspective but due to time restraints it was only implemented in the finishing scoreboard screen for deathmatch.

 

Can anyone help me? Im sure it could be done now with doom. Curious experiment.

 

I tried using DECORATE to figure out a way but had no luck but thats probably because im a noob. Im new to modification so im still needing to learn a lot.  

 

Thanks Everyone!

Share this post


Link to post

Making the view move would require use of A_SetPitch and A_SetAngle for vertical and horizontal movement, respectively.

The DECORATE code might look like this:

Actor FidgetyPlayer : DoomPlayer
{
 states
 {
  See:
	PLAY A 4 A_Jump (32, "Up")
	PLAY B 4 A_Jump (32, "Down")
	PLAY C 4 A_Jump (32, "Left")
	PLAY D 4 A_Jump (32, "Right")
	Loop
  Up:
	PLAY A 0 A_SetPitch (pitch-random(1, 3))
	Goto See
  Down:
	PLAY A 0 A_SetPitch (pitch+random(1, 3))
	Goto See
  Left:
	PLAY A 0 A_SetAngle (angle-random(1, 3))
	Goto See
  Right:
	PLAY A 0 A_SetAngle (angle+random(1, 3))
	Goto See
 }
}

I can't say for sure if this would work as intended by adding or subtracting a random number of degrees from the pitch or angle this way, but this would be rather random if it does.

Share this post


Link to post

Thank you Aquila I thought DECORATE would be the thing I need to use,

 

I tried your script and tried a few different variations to identify the actor and tried using the weapons themselves but as the actor but cant seem to get any results 

 

Bah what am I missing ><

Share this post


Link to post

I did say that I wasn't sure it would work.

Also, that code up there only accounts for when the player is running and even then each pitch/angle change will only happen about 12.5% of the time. You'll want to modify the first integers to 64 or 128 to make those happen consistently.

It could also be because I'm using custom state changes on a player actor in that code that's making it not work. That's part of why I try to avoid modifying the player actors.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×