How to add freelook function to stationary weapons

Information and tutorials related to modding BF2.
Post Reply
Arab
PR:BF2 Developer
Posts: 2887
Joined: 2012-05-18 03:37

How to add freelook function to stationary weapons

Post by Arab »

This is a quick tutorial on how to enable controls to allow you to move the camera with ctrl on a Player Controlled Object/Weapon - transferring the ability from airplanes to enterable weapons like stationaries.

You would need to add

Code: Select all

ObjectTemplate.controlsCategory VCAir
in the first paragraph of your code, so under

Code: Select all

ObjectTemplate.seatAnimationSystem x
Then search for 'create Camera', and underneath - add the following code:

Code: Select all

ObjectTemplate.setMinRotation -125/-20/0
ObjectTemplate.setMaxRotation 125/20/0
ObjectTemplate.setMaxSpeed 90/90/0
ObjectTemplate.setAcceleration 5000/5000/0
ObjectTemplate.setInputToYaw PIMouseLookX
ObjectTemplate.setInputToPitch PIMouseLookY
ObjectTemplate.restoreRotationOnExit 1
ObjectTemplate.toggleMouseLook 1
ObjectTemplate.CVMNose 1
The camera will only work on CVM (Camera View Mode) Nose as the free look feature is used for airplanes with CVMNose set as 1 (on).

Applied to stationary vehicles, you are basically setting it to use airplane controls which means inverted controls in the menu will apply to the freelook camera set on stationaries depending on configuration.
Last edited by Arab on 2023-09-01 20:54, edited 2 times in total.
Image
Post Reply

Return to “Modding Tutorials”