Jump to content
Official BF Editor Forums

Handbrake For Car?


rhysm_08
 Share

Recommended Posts

A force object would be easy enough to use, but you cant trigger sounds with it. Another bad thing is that it is always "ON", meaning that even if the car is still, the user can trigger it and move the car backwards. maybe make this the "reverse" fucntion for the vehicle?

Just add this to the car's tweak and adjust the position/rotation manually in the editor until the force is vectored in the right direction. (Where the blue arrow on the widget is pointed)

ObjectTemplate.addTemplate HandBrake
ObjectTemplate.setRotation 0/0/0
ObjectTemplate.setPosition 0/0/0



ObjectTemplate.create ForceObject HandBrake
ObjectTemplate.modifiedByUser "Mike"
ObjectTemplate.setNetworkableInfo BasicInfo
ObjectTemplate.createdInEditor 1
ObjectTemplate.floaterMod 0
ObjectTemplate.hasMobilePhysics 0
ObjectTemplate.input PIAltFire
ObjectTemplate.force 5
ObjectTemplate.constantForce 0
ObjectTemplate.startDelay 0.01

If your car already has the CarHorn added you might want to remove it if it is triggering off of PIAltFire aswell.

I dont think wings can be controlled directly by the player, but they can be added to gain overall control of the vehicle.

This thread has some good stuff in it.

http://www.bfeditor....=1entry101304

One thing that I found that can help make a car more controllable at high speeds is to add multiple Fo's vectored in the down axis to simulate aerodynamic down force. It will keep the wheels on the ground when you move over small bumbs. If the wheels leave the ground you loose the ability to control the vehicle so this can help some. The force should be small (like 3~5), anything higher and your car will be dragging onn the ground.

Edited by Coronaextra
Link to comment
Share on other sites

Last night I got bored and decided ot make a GFA that functions as a hand brake. Its just a machine gun (cloned off the AH1Z nose gun) that is fired into the ground behind the vehicle. The projectile has zero dammage, but a small negative explosion force that pulls the vehicle towards it, forcing it to slow down. Since it is a GFA, you can add sounds and effects (like tire screeching and smoke)

Some bad things.. Since you have to create explosions behind the vehicle for it to work, anything else (like other players) that are in the splash radius will be effected. This could be a blessing or a burden, depending on how you look at it. tongue.gif When you fire the gun, it makes a sound when the projectile impacts the terrain. I tryed changing the terrain material to to make it go away, but could not figure it out. I'm sure there is a way but I didnt spend much time on it.

Anyway, heres the code if you want it.

ObjectTemplate.addTemplate HandBrake_0
ObjectTemplate.setPosition 0/0/-1.8163
ObjectTemplate.setRotation 180/30/0


ObjectTemplate.create GenericFireArm HandBrake_0
ObjectTemplate.modifiedByUser "Mike"
ObjectTemplate.createdInEditor 1
ObjectTemplate.castsDynamicShadow 1
rem ---BeginComp:WeaponHud ---
ObjectTemplate.createComponent WeaponHud
ObjectTemplate.weaponHud.guiIndex -1
ObjectTemplate.weaponHud.hasFireRate 0
ObjectTemplate.weaponHud.showClips 0
ObjectTemplate.weaponHud.overheatSound S_Weapon_Vehicle_Overheat
rem ---EndComp ---
rem ---BeginComp:SingleFireComp ---
ObjectTemplate.createComponent SingleFireComp
ObjectTemplate.fire.fireStartDelay CRD_NONE/0.227/0/0
rem ---EndComp ---
rem ---BeginComp:DefaultAmmoComp ---
ObjectTemplate.createComponent DefaultAmmoComp
ObjectTemplate.ammo.nrOfMags -1
ObjectTemplate.ammo.magSize -1
ObjectTemplate.ammo.reloadTime 8
ObjectTemplate.ammo.autoReload 1
ObjectTemplate.ammo.reloadWithoutPlayer 1
rem ---EndComp ---
rem ---BeginComp:WeaponBasedRecoilComp ---
ObjectTemplate.createComponent WeaponBasedRecoilComp
rem ---EndComp ---
rem ---BeginComp:SimpleDeviationComp ---
ObjectTemplate.createComponent SimpleDeviationComp
rem ---EndComp ---
rem ---BeginComp:DefaultSoundComp ---
ObjectTemplate.createComponent DefaultSoundComp
rem ---EndComp ---
rem ---BeginComp:DefaultAnimationComp ---
ObjectTemplate.createComponent DefaultAnimationComp
rem ---EndComp ---
rem ---BeginComp:ToggleCameraComp ---
ObjectTemplate.createComponent ToggleCameraComp
ObjectTemplate.zoom.startCameraId 0
ObjectTemplate.zoom.startCameraViewMode 1
rem ---EndComp ---
ObjectTemplate.floaterMod 0
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType Mesh
ObjectTemplate.aiTemplate AHE_AH1Z_Gun
rem -------------------------------------
ObjectTemplate.addTemplate S_HandBrake_0_Fire1P
ObjectTemplate.addTemplate S_HandBrake_0_Fire1P_Outdoor
ObjectTemplate.addTemplate S_HandBrake_0_Fire3P
ObjectTemplate.addTemplate S_HandBrake_0_BoltClick
ObjectTemplate.addTemplate S_HandBrake_0_TriggerClick
ObjectTemplate.addTemplate S_HandBrake_0_SwitchFireRate
ObjectTemplate.addTemplate S_HandBrake_0_Reload1P
ObjectTemplate.addTemplate S_HandBrake_0_Reload3P
ObjectTemplate.addTemplate S_HandBrake_0_Deploy1P
ObjectTemplate.addTemplate S_HandBrake_0_Deploy3P
ObjectTemplate.addTemplate S_HandBrake_0_Zoom
rem -------------------------------------
ObjectTemplate.projectileTemplate HandBrake_0_Projectile
ObjectTemplate.keepProjectiles 5
ObjectTemplate.velocity 400
ObjectTemplate.itemIndex 1
ObjectTemplate.isSelectable 0

ObjectTemplate.create GenericProjectile HandBrake_0_Projectile
ObjectTemplate.modifiedByUser "Mike"
ObjectTemplate.createNotInGrid 1
ObjectTemplate.createdInEditor 1
rem ---BeginComp:DefaultCollisionComp ---
ObjectTemplate.createComponent DefaultCollisionComp
rem ---EndComp ---
rem ---BeginComp:DefaultDetonationComp ---
ObjectTemplate.createComponent DefaultDetonationComp
ObjectTemplate.detonation.explosionMaterial 70
ObjectTemplate.detonation.explosionRadius 5
ObjectTemplate.detonation.explosionForce -10
ObjectTemplate.detonation.explosionDamage 0
ObjectTemplate.detonation.detectionRadius 1.5
ObjectTemplate.detonation.maxDepthForExplosion 2
rem ---EndComp ---
rem ---BeginComp:DefaultProjSoundComp ---
ObjectTemplate.createComponent DefaultProjSoundComp
rem ---EndComp ---
rem ---BeginComp:DefaultRicochetComp ---
ObjectTemplate.createComponent DefaultRicochetComp
rem ---EndComp ---
rem ---BeginComp:DefaultPenetrateComp ---
ObjectTemplate.createComponent DefaultPenetrateComp
rem ---EndComp ---
ObjectTemplate.floaterMod 0
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType Point
ObjectTemplate.collisionGroups 8
ObjectTemplate.material 38
rem -------------------------------------
ObjectTemplate.addTemplate S_HandBrake_0_Projectile_Looping
rem -------------------------------------
ObjectTemplate.timeToLive CRD_NONE/0.5/0/0
ObjectTemplate.material 38
ObjectTemplate.hasOnTimeEffect 1
ObjectTemplate.damage 0

ObjectTemplate.activeSafe Sound S_HandBrake_0_Fire1P
ObjectTemplate.modifiedByUser "Mike"
ObjectTemplate.lowSamples 2147483647
ObjectTemplate.mediumSamples 2147483647
ObjectTemplate.soundFilename "objects/vehicles/land/jeep_faav/sounds/carscreech.wav"
ObjectTemplate.loopCount 1
ObjectTemplate.is3dSound 0
ObjectTemplate.stopType 1
ObjectTemplate.volume 1
ObjectTemplate.pitch 1
ObjectTemplate.pan 0.5
ObjectTemplate.reverbLevel 1
ObjectTemplate.pitchEnvelope 0/1/0.9/1.1/1/1/0/0.98/1.03/
ObjectTemplate.volumeEnvelope 0/1/0/1/1/1/0/0.95/1/

ObjectTemplate.activeSafe Sound S_HandBrake_0_Fire1P_Outdoor
ObjectTemplate.modifiedByUser "Mike"

ObjectTemplate.activeSafe Sound S_HandBrake_0_Fire3P
ObjectTemplate.modifiedByUser "Mike"

ObjectTemplate.activeSafe Sound S_HandBrake_0_BoltClick
ObjectTemplate.modifiedByUser "Mike"

ObjectTemplate.activeSafe Sound S_HandBrake_0_TriggerClick
ObjectTemplate.modifiedByUser "Mike"

ObjectTemplate.activeSafe Sound S_HandBrake_0_SwitchFireRate
ObjectTemplate.modifiedByUser "Mike"

ObjectTemplate.activeSafe Sound S_HandBrake_0_Reload1P
ObjectTemplate.modifiedByUser "Mike"

ObjectTemplate.activeSafe Sound S_HandBrake_0_Reload3P
ObjectTemplate.modifiedByUser "Mike"

ObjectTemplate.activeSafe Sound S_HandBrake_0_Deploy1P
ObjectTemplate.modifiedByUser "Mike"

ObjectTemplate.activeSafe Sound S_HandBrake_0_Deploy3P
ObjectTemplate.modifiedByUser "Mike"

ObjectTemplate.activeSafe Sound S_HandBrake_0_Zoom
ObjectTemplate.modifiedByUser "Mike"

ObjectTemplate.activeSafe Sound S_HandBrake_0_Projectile_Looping
ObjectTemplate.modifiedByUser "Mike"
ObjectTemplate.createdInEditor 1

Some things that would need adjusting

Positions and firing angle of the weapon

ObjectTemplate.addTemplate HandBrake_0
ObjectTemplate.setPosition 0/0/-1.8163
ObjectTemplate.setRotation 180/30/0

Explosion force and Radius for the projectile

ObjectTemplate.detonation.explosionRadius 5
ObjectTemplate.detonation.explosionForce -10

Link to comment
Share on other sites

This is approach that we had in our mod and came originally from the Surreal Mod.

You have a rotationalbundle which holds the firearm. This allows drifting/sliding when pressing A/D. The force is applied by the weapons recoil.

It should be placed on the rear vehicle axis and the firebutton and the recoil size need to be adjusted.

rem *** Generated with Bf2Editor.exe [created: 2006/5/15 11:52]
ObjectTemplate.activeSafe RotationalBundle is_handbrake_RB
ObjectTemplate.modifiedByUser "Cassio"
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.createdInEditor 1
ObjectTemplate.floaterMod 0
ObjectTemplate.hasMobilePhysics 1
rem -------------------------------------
ObjectTemplate.addTemplate S_is_handbrake_RB_RotationRpm
ObjectTemplate.addTemplate is_handbrake
rem -------------------------------------
ObjectTemplate.setMinRotation -45/0/0
ObjectTemplate.setMaxRotation 45/0/0
ObjectTemplate.setMaxSpeed 1/0/0
ObjectTemplate.setAcceleration 75/0/0
ObjectTemplate.setInputToYaw PIYaw
ObjectTemplate.setAutomaticReset 1
ObjectTemplate.snapToZeroOnNoInput 1

ObjectTemplate.activeSafe Sound S_is_handbrake_RB_RotationRpm
ObjectTemplate.modifiedByUser "Cassio"

ObjectTemplate.create GenericFireArm is_handbrake
ObjectTemplate.modifiedByUser "Cassio"
ObjectTemplate.setNetworkableInfo BasicInfo
ObjectTemplate.createdInEditor 1
rem ---BeginComp:WeaponHud ---
ObjectTemplate.createComponent WeaponHud
ObjectTemplate.weaponHud.weaponIcon Ingame\Weapons\Icons\Hud\bomb.tga
ObjectTemplate.weaponHud.hudName "is_handbrake"
ObjectTemplate.weaponHud.guiIndex -1
ObjectTemplate.weaponHud.hasFireRate 0
ObjectTemplate.weaponHud.showClips 0
ObjectTemplate.weaponHud.overheatSound S_Weapon_Vehicle_Overheat
rem ---EndComp ---
rem ---BeginComp:SingleFireComp ---
ObjectTemplate.createComponent SingleFireComp
ObjectTemplate.fire.roundsPerMinute 900
ObjectTemplate.fire.fireInput PIFlareFire
rem ---EndComp ---
rem ---BeginComp:DefaultAmmoComp ---
ObjectTemplate.createComponent DefaultAmmoComp
ObjectTemplate.ammo.nrOfMags -1
ObjectTemplate.ammo.magSize -1
ObjectTemplate.ammo.reloadWithoutPlayer 1
rem ---EndComp ---
rem ---BeginComp:WeaponBasedRecoilComp ---
ObjectTemplate.createComponent WeaponBasedRecoilComp
ObjectTemplate.recoil.recoilForce 50
rem ---EndComp ---
ObjectTemplate.floaterMod 0
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.projectileTemplate BlankProjectile
ObjectTemplate.keepProjectiles 5
ObjectTemplate.heatAddWhenFire 0.01
ObjectTemplate.coolDownPerSec 0.05
ObjectTemplate.overheatPenalty 1.5

Link to comment
Share on other sites

  • 2 weeks later...
  • 5 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...