Here's the DEMO. I integrated a 3rd person camera to showcase the code, since it wouldn't make any sense to use it in first person.

http://www.geocities.com/hainesrs/blending.rar - 380kb

OR

http://www.geocities.com/hainesrs/blending.zip - 718kb

The animation states blending will be obvious, so I don't need to explain it. However, the various movement/control modes need to be addressed, so you'll know how each value influences the camera and controls.

The VAR "movementType" has 5 possible settings: 0, 1, 2, 3, and 4. The default is "0". To change this value, find the function named "loadControlsDefault" located in "main.wdl". Simply change the value to one of the five listed above.

Here's what each one will do for you.

movementType
0 = This is a standard behind the player, 3rd person camera and is controlled with the mouse. The player moves relative to itself using W and S, and strafing is not yet implemented. This is most like the controls and camera used in Max Payne.
1 = This is a standard satellite style, 3rd person camera and is controlled with the mouse. The player moves relative to itself using WASD and would best be compared with the early Resident Evil play mechanics(i.e. tank controls).
2 = This is a standard satellite style, 3rd person camera and is controlled with the mouse. The player moves relative to itself using the gamepad.
3 = This is a standard satellite style, 3rd person camera and is controlled with the mouse. The player moves relative to the camera using WASD. This is most like the controls and camera used in Splinter Cell.
4 = This is a standard satellite style, 3rd person camera and is controlled with the mouse. The player moves relative to the camera using the gamepad. This is most like the controls and camera used in Splinter Cell.

Please note that in gamepad mode the camera should ideally be controlled with the 2nd analog stick or some other button on the input device. However, this feature is not yet implemented, so you'll have to settle for the mouse. It isn't very practical, but I'm not going to fix it anytime soon. This is valid for movementTypes 2 and 4 only.

Finally, when in modes 3 and 4 there is an animation frame problem with the "idle" and "stand" states. The way it is scripted, now, the player's state will change to its idle animation after about 8 seconds of inactivity. This works as it should with modes 0-2, but it does not function in the other two. Also, the stand state does not occur when not moving. This used to work, so I must have broke something when I was actively working on this and forgot to go back and fix it.


My User Contributions master list - my initial post links are down but scroll down page to find list to active links