BF2 style Parachute controls...

Lots of cool and useful tips to mod either serverside or clientside

BF2 style Parachute controls...

Postby Apache Thunder » Tue Apr 13, 2010 3:34 am

I just discovered how to lock the parachute movement or slow it down so it doesn't spin when you look left or right. I tried adding wings to the parachute to tilt it left or right but wings/rotational bundles did not respond to player controls when addtemplated to the parachute. So instead I set the "setSpeed" command for the parachute animation states to 0.1 instead of 0 which would have prevent the parachute from rotating completely. So now it will rotate slowly on par with how fast the parachute rotates in BF2/BF2142

Pay close attention to the setSpeed command:

Animations/AnimationStatesParachute.con: (only relevant code shown)
Code: Select all
rem *** The middle number governs how much rotation the parachute will have ***
AnimationStateMachine.createState Lb_ParachuteIdle
AnimationStateMachine.addAnimation animations/3P_NoWeapon/3PParachuteGlideLower.baf 1 c_AsmLooping
AnimationStateMachine.setSpeed 0 0.1 0
AnimationStateMachine.setMorphFactor 1.0

rem *** Speed altered on this as well to lock movement while parachute opens. ***
AnimationStateMachine.createState Lb_ParachuteOpen
AnimationStateMachine.addAnimation animations/3P_NoWeapon/3PParachuteOpenLower.baf 0.5 c_AsmPlayOnce
AnimationStateMachine.setSpeed 0 0.1 0
AnimationStateMachine.setMorphFactor 1.0
AnimationStateMachine.setFlag c_AsmHideWeapon
AnimationStateMachine.setFlag c_AsmLockFreeLook
AnimationStateMachine.addTransitionWhenDone Lb_ParachuteIdle
AnimationStateMachine.setSoundTrigger c_SstOpenParachute


I have also done the following to allow the parachute to be seen in 1st person view. Some might complain it blocks their view, but since parachutes block your view in real life, then why not ingame? :P (plus in BF2 they are visible in 1p mode anyway)

Objects/soldiers/common/Parachute/Objects.con: (remove existing code in this file first if present in your mod)
Code: Select all
ObjectTemplate.create lodObject Parachute
ObjectTemplate.hasDynamicShadow 1
rem -------------------------------
ObjectTemplate.addTemplate Parachute1P
ObjectTemplate.addTemplate Parachute3P
rem -------------------------------
ObjectTemplate.lodSelector ParachuteSelector

LodSelectorTemplate.create DistCompareSelector2 ParachuteSelector
LodSelectorTemplate.hasDestroyedLod 0
LodSelectorTemplate.addLodDistance 0.5
LodSelectorTemplate.addLodComparison 1

ObjectTemplate.create AnimatedBundle Parachute1P
ObjectTemplate.geometry Parachute
ObjectTemplate.name Parachute
ObjectTemplate.createSkeleton animations/Parachute.ske
ObjectTemplate.setAnimationState OpenParachute
ObjectTemplate.hasDynamicShadow 1

ObjectTemplate.create AnimatedBundle Parachute3P
ObjectTemplate.geometry Parachute3P
ObjectTemplate.name Parachute
ObjectTemplate.createSkeleton animations/Parachute.ske
ObjectTemplate.setAnimationState OpenParachute
ObjectTemplate.hasDynamicShadow 1


Objects/soldiers/common/Parachute/Geometries.con: (extra geometry, but may not be needed. just use the same one for both child objects and see if that works)
Code: Select all
GeometryTemplate.create AnimatedMesh Parachute
GeometryTemplate.setSkin animations/Parachute.skn
GeometryTemplate.file Parachute_m1
GeometryTemplate.setLodRange 0 0 1 500 2 1000
GeometryTemplate.setLodPercent 0 1.0
GeometryTemplate.setLodPercent 1 1.0
GeometryTemplate.setLodPercent 2 1.0


GeometryTemplate.create AnimatedMesh Parachute3P
GeometryTemplate.setSkin animations/Parachute.skn
GeometryTemplate.file Parachute_m1
GeometryTemplate.hasDynamicShadow 1


And that is pretty much it. BF2 style parachute controls in BF1942! Except the controls to do it will be different, it will be the same thing essentially.
ImageImageImage

I have cameras in your head!
User avatar
Apache Thunder
 
Posts: 1199
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA

Return to General Modding Tutorials

Who is online

Users browsing this forum: No registered users and 4 guests