project reality header
Go Back   Project Reality Forums > PR:BF2 Mod Forums > PR:BF2 Community Modding > Modding Tutorials
30 Oct 2024, 00:00:00 (PRT)
Register Developer Blogs Members List Search Quick Links
Modding Tutorials Information and tutorials related to modding BF2.

Reply
 
Thread Tools Display Modes
Old 2023-09-01, 20:48   #1
[R-DEV]​Arab
PR:BF2 Developer
Supporting Member

Arab's Avatar
Default How to add freelook function to stationary weapons

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:
ObjectTemplate.controlsCategory VCAir
in the first paragraph of your code, so under
Code:
ObjectTemplate.seatAnimationSystem x
Then search for 'create Camera', and underneath - add the following code:
Code:
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.

Arab is offline
Last edited by Arab; 2023-09-01 at 20:54..
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 11:29.