Short walkthrough on Vehicle Positions

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
Samee3
First Lance Corporal
First Lance Corporal
Posts: 123
Joined: Sun Jul 05, 2015 5:07 pm
Projects :: BF2 Refresh Mod
Games I'm Playing :: Empire at War
xbox live or psn: VaporousFern310
Location: California, USA

Short walkthrough on Vehicle Positions

Post by Samee3 »

Here is a list of references and other tutorials that I have found: Lots of information, but also a lot of loose ends. I'll try to consolidate as much as I can, and fill in the blanks as I go.

Let's get to it.

Limitations/Notes:
  • Use stock vehicles as templates and reference. This includes stuff from BF1 as well as BF2.
  • You can only have up to 8 positions in a vehicle. That's it, no more.
  • Pilots (Ground or Flyer) can have a maximum of 2 weapons.
  • Turrets can only have 1 weapon**. Vehicle positions other than the pilot are considered turrets. Standalone turrets can only have 1 position.
  • Ground vehicles cannot be set to PilotType = "Self". The game will CTD.
  • If you set any turret in a flyer to PilotType = "Self", the game will CTD if you try to land or use the squad commands.
  • Another question is the possibility of piloting Capital ships and Frigates. In 1 word: Impractical.
  • You can make soldiers use their own weapons(rifles and grenades) while in a vehicle. It's buggy, but I listed DarthDUCK's tutorial above.
  • Some vehicles don't like being messed with, like the AT-AT (or did someone finally get the 2 position AT-AT working properly :D ).
  • Passenger slots work, but they will all have the same EyePoint.
  • When dealing with Flyers, StrafeSpeed must be nonexistent. Otherwise, you won't be able to take off. Don't ask me why this is......
  • Again, use stock vehicles as templates and reference. I cannot stress this enough, and it goes for BF2 Modding in general.
  • Read this topic on general BF2 limitations.



On Camera Positioning:
Hidden/Spoiler:
Copied some of this from the commented AAT odf.
[code]
// Think of camera as fixed on one end of a long stick balanced on a cone.
//-- on one end is camera, other end is focal point, cone at center can be shifted
//-- camera is eyepoint; TrackOffset is focal point; Trackcenter is cone position; tilt value is tilt on pole
EyePointOffset = "0.0 0.0 0.0" // Camera position from vehicle origin x,y,z. This seems to affect First Person and Scopes, but not Third Person
TrackCenter = "0.0 0.0 0.0" // Camera tilt axis from vehicle origin x,y,z. This seems to affect Third Person, but not First Person and Scopes
TrackOffset = "0.0 0.0 0.0" // Camera Focal Point from vehicle origin x,y,z

TiltValue = "0.0" // Try this: Fix your eyes on a fixed point. Keeping them there, tilt your head up and down. A higher TiltValue is like tilting your head down more; A higher value is like tilting your head up more.
[/code]
On Camera Movement:
Hidden/Spoiler:
[code]
TurnRate = 0.0 // This is how fast, in rotations per second, the vehicle, turret, or unit can turn.
TurnFilter = 0.0 // This defines the acceleration on the TurnRate
PitchRate = 0.0 // This is how fast, also in rotations per second, the vehicle, turret, or unit can pitch.
PitchFilter = 0.0 // This defines the acceleration on the PitchRate
PitchDamp = 0.0 // Deceleration for the PitchRate (I think....more testing needed.....)

PitchLimits = "-0 0" // How far camera can pitch (Up and Down). Test this thoroughly, as the values are often inverted.
YawLimits = "-0 0" // How far camera can turn (Left and Right)
[/code]
On Setting up a new position:
Hidden/Spoiler:
The first thing you will need is to identify the section. The code used for this will vary with the type of vehicle.
For Hovers and Flyers, you will use FLYERSECTION. Pilot will be FLYERSECTION = "BODY", and any extra positions will be FLYERSECTION = "TURRET<1-8>"
For Walkers, you will use WALKERSECTION.
WEAPONSECTION is only necessary if you are going to have 2 weapons.

Next is setting up the Turret, Aimer, and Barrel Nodes for the weapons. Darth D.U.C.K. made a very good tut on this matter, and I have it listed above.
[code]
TurretNodeName = ""
AimerNodeName = ""
BarrelNodeName = ""
FirePointName    = ""
[/code]
Buggy vehicles (that I have heard of/found):
Hidden/Spoiler:
[list]
[*]The AT-AT. Unless someone has figured it out already, don't get your hopes up about bringing back the 2-position AT-AT from BF1. The Node hierarchy is somewhat messed up.
[*]The AAT. I once tried making the laser cannons independent, and one of them did not cooperate.
[*]The LA-AT. The rear gunner is possible, but the only way I have ever made it work also makes the barrel static.
[*]The K-Wing. I got everything outside of the chin turret working properly. EDIT: I take that back....
[*]A certain 'rep_hover_combatspeeder', located in Sides\ALL\msh. I have tried to get it working, with only partial success. You probably didn't even know this thing existed.[/list]
** While you can technically set a turret to have 2 weapons, you as a player cannot control the second weapon, but the AI can. Could be useful, dunno.

Thanks for reading, and good luck,
Sam
Last edited by Samee3 on Sat Dec 30, 2017 8:42 pm, edited 5 times in total.
jedimoose32
Field Commander
Field Commander
Posts: 938
Joined: Thu Jan 24, 2008 12:41 am
Projects :: Engineering Degree
Location: The Flatlands of Canada

Re: Short walkthrough on Vehicle Positions

Post by jedimoose32 »

Very nice. This is definitely a good point of reference.
Samee3
First Lance Corporal
First Lance Corporal
Posts: 123
Joined: Sun Jul 05, 2015 5:07 pm
Projects :: BF2 Refresh Mod
Games I'm Playing :: Empire at War
xbox live or psn: VaporousFern310
Location: California, USA

Re: Short walkthrough on Vehicle Positions

Post by Samee3 »

***Update***


I have somewhat of a treat for anyone interested:
Hidden/Spoiler:
[code]
//********************************
//******** REAR GUNNER *********
//********************************
FLYERSECTION = "TURRET4"

EyePointOffset = "0 0.0 0.0"
TrackCenter = "0 3.75 5.8"
TrackOffset = "0 0.0 0.0"

TiltValue = "0.0"

PitchRate = 3.0
PitchFilter = 6.0
TurnRate = 3.0
TurnFilter = 6.0

PitchLimits = "-60.0 60.0"
YawLimits = "110.0 250.0"

PitchTurnFactor = "1.0"
YawTurnFactor = "1.0"

AimerNodeName = "hp_gun_3"
AimerPitchLimits = "-90.0 90.0"
AimerYawLimits = "-180.0 180.0"

WeaponName = ""
WeaponAmmo = "0"

BarrelLength = "0.0"

TurretYawSound = "turret_whir_yaw_lp"
TurretYawSoundPitch = "0.7"
TurretPitchSound = "turret_whir_pitch_lp"
TurretPitchSoundPitch = "0.7"
TurretAmbientSound = ""
TurretActivateSound = "vehicle_equip"
TurretDeactivateSound = ""
TurretStartSound = ""
TurretStopSound = ""

VehiclePosition = "common.vehiclepositions.gunner"
[/code]
The Rear Gunner position for the LA-AT Gunship.
Feel free to use it and modify it however you like, no credit necessary.
EDIT: I've been having some issues getting this to work lately, so don't be surprised if you have some issues as well.

Bugs:
Hidden/Spoiler:
[list]
[*]The barrel doesn't move with the camera. Weird, but it's the only way I could get it to work properly.
[*]The camera positioning is a little rough, so feel free to post any improvement ideas.[/list]
Next up is(I hope) the Chin Guns.

Have fun!

Many thanks to Psych0fred for deciphering the camera positioning code.

***Edit/Update 2***


Here's the Chin Guns, like I promised:
Hidden/Spoiler:
[code]
//********************************
//********** CO PILOT *********
//********************************
FLYERSECTION = "TURRET1"

FirstPerson = "rep\repsccam;rep_1st_cockpit_securitycam"
PitchRate = 2.0
PitchFilter = 5.0
TurnRate = 2.0
TurnFilter = 5.0


PitchLimits = "-30 30"
YawLimits = "-90 90"

EyePointOffset = "0.0 0.0 0.0"
TrackCenter = "0.0 1.5 10.5"
TrackOffset = "0.0 0.0 0.0"
TiltValue = "0.0"

ForceMode = 1

WEAPONSECTION = "1"

WeaponName = ""
WeaponAmmo = "0"

AimerNodeName = "front_gun_1"
AimerYawLimits = "-40.0 130.0"
AimerPitchLimits = "-90.0 70.0"
BarrelLength = "1.0"
FireOutsideLimits = "0"

NextAimer = "-"

AimerNodeName = "front_gun_2"
AimerYawLimits = "-130.0 40.0"
AimerPitchLimits = "-90.0 70.0"
BarrelLength = "1.0"
FireOutsideLimits = "0"

VehiclePosition = "common.vehiclepositions.copilot"

[/code]
Controlled by the Co-Pilot, like they are supposed to be.

Like the Rear Gun, the camera positioning is a little rough, but not terrible.
Also, when the pilot is deprived of his cannons, you will notice that the HUD icon for the torpedoes is a little messy.

**Edit/Update 3**

Although there has already been a 3-seated ARC-170 released, I found the rear turret implementation to be a little rough.
So, here is a new and improved version:
Hidden/Spoiler:
[code]
FLYERSECTION = "TURRET1"

FirstPerson = "rep\repsccam;rep_1st_cockpit_securitycam"
//ForceMode = "2"
FirstPersonFOV = "55"

EyePointOffset = "0.0 0.3 0.25"
TrackOffset = "0.0 0.0 3.0"
TrackCenter = "0.0 0.8 2.0"
ThirdPersonFOV = "55"
TiltValue = "0.0"

//ForceMode = 1

PitchRate = "1"
PitchFilter = "6.75"
TurnRate = "1"
TurnFilter = "6.75"

WeaponName = "rep_weap_fly_arc170_turret_cannon"
WeaponAmmo = "0"

YawLimits = "120 240"
PitchLimits = "-17.0 20.0"

TurretNodeName = "aimer_topturretbase_y"

NextAimer = "-"

HierarchyLevel = 1
AimerNodeName = "aimer_topturret_x"
AimerPitchLimits = "-25.0 25.0" // 0 0
AimerYawLimits = "-110.0 110.0"

NextAimer = "-"

AimerNodeName = "aimer_topturretbase_y"
AimerPitchLimits = "-25.0 25.0"
AimerYawLimits = "-110.0 110.0" // 0 0

BarrelNodeName = "top_barrel"
BarrelRecoil = 0.0
FirePointName = "hp_fire_reartop"

NextAimer = "-"

HierarchyLevel = 1
AimerNodeName = "aimer_bottomturret_x"
AimerPitchLimits = "-25.0 25.0"
AimerYawLimits = "-110.0 110.0"

NextAimer = "-"

AimerNodeName = "aimer_bottomturretbase_y"
AimerPitchLimits = "-25.0 25.0"
AimerYawLimits = "-110.0 110.0"

BarrelNodeName = "bottom_barrel"
BarrelRecoil = 0.0
FirePointName = "hp_fire_rearbottom"

VehiclePosition = "common.vehiclepositions.gunner"

[/code]
Post Reply