BF2 Object Containment

From BF2 Technical Information Wiki
Jump to: navigation, search
Wiki letter w.png WARNING: This page is a work in progress
The information here is not quite correct or complete yet, but it's being worked on, and should be finished "soon"! If you have insights into the matters discussed, please feel free to contribute to the page.

I'm not quite sure where this is going to go, so for the moment it's just some raw data. . .

I (Woody) wrote the following function:

 from bf2.stats.constants import *
 
 def showContainment(physicalObject):
     def recurseContainment(physicalObject, level):
         resultString += "    " * level
         if level <> 0: resultString += "--> "
         resultString += physicalObject.templateName
         print resultString
         
         kids = physicalObject.getChildren()
         
         for child in kids:
             recurseContainment(child, level + 1)
 
     topParent = getRootParent(physicalObject)
     recurseContainment(topParent, 0)

I then set up an event handler to cause showContainment to be called on various Physical Objects when certain events happened--for example, to call it when a EnterVehicle event fires, handing the returned player or vehicle off to showContainment. What this does is to traverse and print the entire "containment" hierarchy for a Physical Object, from top to bottom, so that it can be studied to learn DICE's deepest, darkest secrets.

Here are some examples:

Soldier holding regular rifle:

 us_heavy_soldier
     --> SoldierCamera
     --> US_Assault
         --> UnlockUSAssault
         --> recycle bin
             --> usrif_g3a3
             --> ushgr_m67
     --> usrif_m203

A guy in a parachute:

 parachute
     --> ParachuteForceDown
     --> parachuteWingLeft
     --> parachuteWingRight
     --> animatedparachute
     --> Parachute_Bodywing
     --> parachute_Rudder
     --> parachute_elevator
     --> parachuteForceFwd
     --> parachute_elevator_fwd
     --> us_heavy_soldier
         --> SoldierCamera
         --> US_Assault
             --> UnlockUSAssault
             --> recycle bin
                 --> usrif_g3a3
                 --> ushgr_m67
         --> usrif_m203

APC holding two soldiers:

 usapc_lav25
     --> USAPC_LAV25_hudPass
     --> USAPC_LAV25_Turret
         --> USAPC_LAV25_BarrelBase
             --> USAPC_LAV25_Barrel
         --> USAPC_LAV25_TowLauncher_tube
             --> USAPC_LAV25_TowLauncher
                 --> lav25_towbarrel
                 --> lav25_towbarrel
         --> USAPC_LAV25_hud_Spring
             --> USAPC_LAV25_hud
             --> usapc_lav25_Driver_Camera
         --> antenna
         --> antenna
         --> USAPC_LAV25_SmokeLauncher
             --> usapc_lav25_SmokeLauncher_Barrel
             --> usapc_lav25_SmokeLauncher_Barrel
     --> USAPC_LAV25_Lpropeller
     --> USAPC_LAV25_Rpropeller
     --> USAPC_LAV25_Engine
         --> USAPC_LAV25_nav_RF
             --> USAPC_LAV25_Wheel_RF
         --> USAPC_LAV25_nav_RR
             --> USAPC_LAV25_Wheel_RR
         --> USAPC_LAV25_nav_LF
             --> USAPC_LAV25__Wheel_LF
         --> USAPC_LAV25_nav_LR
             --> USAPC_LAV25_Wheel_LR
         --> USAPC_LAV25_Rwheel_01
         --> USAPC_LAV25_Rwheel_02
         --> USAPC_LAV25_Lwheel_01
         --> USAPC_LAV25_Lwheel_02
     --> USAPC_LAV25_EntryPoint_Front
     --> usapc_lav25_EntryPoint_Rear
     --> usapc_lav25_Rearpassenger_L
         --> usapc_lav25_Rearpassenger_L_Camera
         --> usapc_lav25_RearPassengerL_GunBase
             --> Firingport_M16
         --> us_heavy_soldier
             --> SoldierCamera
             --> US_Assault
                 --> UnlockUSAssault
                 --> recycle bin
                     --> usrif_g3a3
                     --> ushgr_m67
             --> usrif_m203
     --> usapc_lav25_Rearpassenger_R
         --> usapc_lav25_Rearpassenger_R_Camera
         --> usapc_lav25_RearPassenger_R_GunBase
             --> Firingport_M16
     --> usapc_lav25_Rearpassenger_BL
         --> usapc_lav25_Rearpassenger_BL_Camera
         --> usapc_lav25_RearPassenger_BL_GunBase
             --> Firingport_M16
     --> usapc_lav25_Rearpassenger_BR
         --> usapc_lav25_RearPassenger_BR_GunBase
             --> Firingport_M16
         --> usapc_lav25_RearPassengerCamera
     --> usapc_lav25_FloaterFrontLeft
     --> usapc_lav25_FloaterFrontRight
     --> usapc_lav25_FloaterRearLeft
     --> usapc_lav25_FloaterRearRight
     --> usapc_lav25_VerticalBodyWing
     --> usapc_lav25_Rudder
     --> USAPC_LAV25_WaterEngine
     --> LaserTarget_vehicle
     --> us_heavy_soldier
         --> SoldierCamera
         --> US_Assault
             --> UnlockUSAssault
             --> recycle bin
                 --> usrif_g3a3
                 --> ushgr_m67
         --> usrif_m203

U.S. Blackhawk carrying one soldier:

 usthe_uh60
     --> USTHE_UH60_FWheelL
     --> USTHE_UH60_FWheelR
     --> USTHE_UH60_WheelB
     --> USTHE_UH60_TailFlap
     --> USTHE_UH60_MainEngine
     --> USTHE_UH60_TailEngine
     --> USTHE_UH60__LLavett
     --> USTHE_UH60__RLavett
     --> USTHE_UH60_Camera
     --> USTHE_UH60_Left_Gunner
         --> hmg_m134
             --> HMG_M134_Minigun
                 --> HMG_M134_Barrels
                 --> HMG_M134_Trigger
                 --> HMG_M134_Safetyswitch
                 --> HMG_M134_SafetyCover
                 --> HMG_M134_Gun
                 --> HMG_M134_Camera
         --> us_heavy_soldier
             --> SoldierCamera
             --> US_Assault
                 --> UnlockUSAssault
                 --> recycle bin
                     --> usrif_g3a3
                     --> ushgr_m67
             --> usrif_m203
     --> USTHE_UH60_Right_Gunner
         --> hmg_m134
             --> HMG_M134_Minigun
                 --> HMG_M134_Barrels
                 --> HMG_M134_Trigger
                 --> HMG_M134_Safetyswitch
                 --> HMG_M134_SafetyCover
                 --> HMG_M134_Gun
                 --> HMG_M134_Camera
     --> USTHE_UH60_CoPilot
     --> HeatObject
     --> USTHE_UH60_Passenger2
     --> USTHE_UH60_Passenger1
     --> USTHE_UH60_EntryPoint
     --> usthe_uh60_tailrotor
     --> usthe_uh60_mainrotor
     --> usthe_uh60_flarelauncher
         --> usthe_uh60_flarelauncher_barrel
         --> usthe_uh60_flarelauncher_barrel
         --> usthe_uh60_flarelauncher_barrel
         --> usthe_uh60_flarelauncher_barrel
         --> usthe_uh60_flarelauncher_barrel
         --> usthe_uh60_flarelauncher_barrel
     --> usthe_uh60_EntryPoint_R
     --> usthe_uh60_RotorHead1
         --> usthe_uh60_RotorHead2
             --> usthe_uh60_Rotor
     --> usthe_uh60_WingL
     --> usthe_uh60_WingR
     --> usthe_uh60_Rudder
     --> usthe_uh60_BodyWing
     --> usthe_uh60_AISpawnPoint
     --> usthe_uh60_EntryPoint_mid
     --> us_heavy_soldier
         --> SoldierCamera
         --> US_Assault
             --> UnlockUSAssault
             --> recycle bin
                 --> usrif_g3a3
                 --> ushgr_m67
         --> usrif_m203

"Yes", you say, "but what does it all mean?" Ah, now that is the question, isn't it?

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox