Experimental Stunt Mortar 0.4

Apply force to a vehicle in a variety of ways.

  1. HighBeam9000
    What is it?
    upload_2021-11-11_0-31-27.png
    Flipping vehicles is a common stunt. One method, the flip ramp, comes with BeamNG.drive. Another method uses a mortar attached through the chassis floor pan to explosively launch one side of the vehicle upwards, flipping the vehicle. This was the original intent behind the stunt mortar, but it’s evolved to do much more. The stunt mortar is implemented using a thruster. The thruster can be located anywhere within the volume of the vehicle, can be oriented in any direction, and has adjustable force and duration.

    How is it installed?
    The stunt mortar can be installed on a vehicle in either the “License Plate Design” slot or the “Additional Modification” slot (not both at the same time). The choice of slots enables the stunt mortar to be used at the same time as many other mods. For props, such as the shipping container, barrels, and rocks, a different slot is used, but the idea is the same.

    The Tuning Menu can be used to set the following parameters:
    • Force Direction – This section specifies the vehicle-relative direction in which the vehicle will be pushed when force is applied.
    • Force Duration – Specifies how long the force will be applied per trigger (1 ms – 1000 ms). The Continuous Force slider specifies whether force is applied continuously (continuous=1) or according to the time limit (continuous=0).
    • Force Magnitude – Sets the magnitude of the force applied.
    • Force Origin – This section specifies the location of the thruster within the vehicle in vehicle-relative coordinates.
    Experiment with the settings to get a feel for what they do. The vehicle-relative direction vectors/coordinates are as follows:
    • X: Left is in the X+ direction, and right is X-.
    • Y: Front is in the Y- direction, and rear is Y+.
    • Z: Up is in the Z+ direction, and down is Z-.
    Knowledge of these directions is important to achieve the desired effect. For example:
    • To push the vehicle upward:
      • Force Direction X = 0
      • Force Direction Y = 0
      • Force Direction Z = 1
    • To push the vehicle to the left:
      • Force Direction X = 1
      • Force Direction Y = 0
      • Force Direction Z = 0
    • To push the vehicle to the right:
      • Force Direction X = -1
      • Force Direction Y = 0
      • Force Direction Z = 0
    • To push the vehicle up and to the left:
      • Force Direction X = 1
      • Force Direction Y = 0
      • Force Direction Z = 1
    The Force Origin will determine the area of the vehicle that receives the force. If the force is applied at the vehicle's center, the resultant motion will be mostly linear. If the force is applied away from the vehicle's center, then rotation will also result.

    How can it be used?
    The thruster can be used in any way that the player can think of to use a thruster bolted to a vehicle, such as any of the following uses:
    • Flip Vehicles – Apply an upward force at about the middle of one side of the vehicle. Put the vehicle into a sideways slide, then activate the stunt mortar to trigger a rollover "accident".
    • “Hydraulics” – Not really hydraulics. Allow the vehicle to jump over obstacles by applying an upward force in the middle of the vehicle. This method can also be used to launch vehicles straight to the second or third level of a parking garage.
    upload_2021-11-11_0-56-23.png
    • Add pop to explosions – When exploding a vehicle, apply an upward force to cause the vehicle to lurch upward at detonation. Note that the stunt mortar just adds the pop, not the explosion. Explosions come with BeamNG (Options-->Controls-->Bindings-->Gameplay-->Explode or Fun Stuff-->Boom).
    upload_2021-11-11_0-56-45.png
    • Invisible Jet – Accelerate very quickly, like using the JATOs but sneakier, by applying a strong forward force.
    • Speed Brakes – Decelerate quickly by applying a strong backward force.
    • Gravity Reduction – Apply an upward force to unspring the vehicle weight off the suspension, but not quite strong enough to lift the vehicle off the ground. This severely reduces tire traction and allows the vehicle to perform ballet, or to be used as a hockey puck.
    • Flying Car – Install the Stunt Mortar in the “Additional Modification” slot and install the AgentY Universal JATO in the “License Plate Design” slot. Locate the stunt mortar thruster in the middle of the front bumper of the vehicle. Set a continuous upward force so that it slowly lifts the front of the vehicle when the stunt mortar is activated, but don’t activate it yet. Launch the JATOs, wait a few seconds to gain speed, then activate the stunt mortar to start rotating the nose upward. When enough of the JATO thrust is vectored downward, the vehicle will leave the ground.
    upload_2021-11-11_0-57-3.png
    • Side Swipe – Locate the thruster in the middle of the vehicle and apply a sideways force. This can be used to side swipe fleeing vehicles in a police pursuit. It can also be used to make parallel parking easy.
    • Stick to Walls and Ceilings – Apply a downward force strong enough to overcome gravity, then drive up the wall of a whole pipe in the Grid map. This can be rough on a vehicle's suspension.
    Note that, because the thruster parameters can be set only one way at a time, the stunt mortar can’t be used for all of the above purposes at the same time. Reconfiguration is required to repurpose. A video demonstrating some of the stunt mortar’s uses can be found here.

    Currently Supported Vehicles and Props
    • Autobello (added in v0.1)
    • Barstow (added in v0.2)
    • Bluebuck (added in v0.1)
    • Burnside (added in v0.3)
    • City Bus (added in v0.1)
    • Ibishu 200BX (added in v0.3)
    • ETK 800-Series (added in v0.3)
    • ETK K-Series (added in v0.2)
    • ETK I-Series (i2400 and i3000; added in v0.3)
    • Grand Marshal (added in v0.1)
    • Covet (added in v0.3)
    • Hopper (added in v0.1)
    • LeGran (added in v0.4)
    • Miramar (added in v0.3)
    • Moonhawk (added in v0.1)
    • Pessima (added in v0.4)
    • D-Series Pickup (added in v0.1)
    • Pigeon (added in v0.1)
    • Roamer (added in v0.1)
    • SBR4 (added in v0.2)
    • T-Series Semi (added in v0.1)
    • Sunburst (added in v0.3)
    • Bolide (added in v0.2)
    • H-Series Van (added in v0.1)
    • Vivace (added in v0.2)
    • Wendover (added in v0.3)
    • Wigeon (added in v0.2)
    • Shipping Container - Yes, the shipping container can be moved with a thruster. This allows the shipping container to be used as a security gate or to crush vehicles. (added in v0.1)
    • Barrels – There are a thousand fun things to do with throwable barrels. (added in v0.1)
    • Rocks - Throwable rocks; Good for punting cars (added in v0.3)
    • Travel Trailer - Actually, it's only attached to the toilet. By default, it will launch out of the back of the trailer. (added in v0.4)
    What if my favorite vehicle isn't supported (yet)?
    One option is to wait for "official" support. However, motivated users can opt to add support themselves. Adding stunt mortar support for a currently unsupported vehicle isn't difficult, just slightly tedious. At the end of this mod description are step-by-step instructions to add support to any vehicle with an available slot. Almost any slot will work, but some slots are better choices than others.

    Plans for the Future
    • All Stock Vehicles – Eventually, all of the stock BeamNG.drive vehicles will be supported by the stunt mortar.
    • Some Additional Vehicles – Some non-stock vehicles will be supported.
    • Additional Movable Props – Some additional props will be supported.
    Known Shortcomings
    • The barrel, while not necessarily unstable with the stunt mortar attached, sometimes bounces around for a while after a collision. The stunt mortar attachment simply needs a little more tuning for when it's installed on the barrel. Lighter objects seem to be more sensitive to large changes in node mass and beam spring/damp values.
    • For body-on-frame vehicles, the thruster is attached to the frame. Frames nodes tend to be somewhat planar. Locate the thruster above or below this “frame plane” for best results.
    • Applying large forces using the stunt mortar can lead to fun and vehicle damage. Applying utterly ridiculous forces can sometimes lead to instability.
    • The Stunt Mortar mod will appear in the "License Plate Design" slot for all vehicles that have that slot. However, not all vehicles that have that slot are supported, yet. There's a "stub" of sorts that connects to the License Plate Design slot, but if the guts don't exist for that particular vehicle, nothing happens. Eventually, all of the stock vehicles will be supported.
    • If the vehicle is instructed to fall apart (Fun Stuff-->Break or Options-->Controls-->Bindings-->Gameplay-->Dismount all parts), it will also drop the stunt mortar, which will no longer be able to apply force until the vehicle is recovered (repaired). If the vehicle is intended to fall apart, be sure to give the stunt mortar enough time to apply the needed force before disintegrating the vehicle.
    • Sometimes, if a vehicle has other special controllers, the control event that is supposed to trigger the stunt mortar isn't received for some reason. The initialization and graphics update functions are called, which suggest that the mod is loading, but no trigger. For example, the stunt mortar works with the Hyper Bolide, but not if either the built-in rockets or minigun are installed. As soon as both of those are removed, the stunt mortar works. Some other vehicles with additional controllers may also have similar issues. However, the presence of a special controller doesn't necessarily mean that other controllers won't work. As another example, a version of the Pessima also has another special controller, for 4-wheel steering, but the stunt mortar works just fine with it. There's probably a better way that the stunt mortar controller can be implemented; some way that won't be affected by the presence of other controllers. The key seems to reside with the difference between a vehicle's working and non-working configurations. What's the difference when certain items are installed vs not installed? Hmmm...
    Adding Support to Vehicles
    This section describes how to add stunt mortar support to a currently unsupported vehicle with an available slot. Without a free slot, adding the stunt mortar is more difficult, and won't be covered here. The easiest way to add stunt mortar support is to copy an existing vehicle's support files and make some edits. This activity requires some knowledge of the BeamNG.drive slot system. See the BeamNG.drive wiki and other dev pages for more information regarding the slot system.

    JBEAM files with the ".jbeam" extension define slot types to which other JBEAMs can connect. For example, the main JBEAM of the Covet (hatch.jbeam) has the following "slots" section:
    "slots": [
    ["type", "default", "description"],
    //bodywork
    ["hatch_body","hatch_body", "Body", {"coreSlot":true}],
    ["paint_design", "", "Paint Design"],
    ["licenseplate_design_2_1","","License Plate Design"],
    ["hatch_mod", "", "Additional Modification"]
    ],

    The first line within the "slots" section defines the field names for the lines that follow: type, default, and description. The first item in each subsequent line is the slot type. The second item is the default selection for that slot. The third is the slot type description that's displayed in the parts selection screen. The tag "coreSlot" determines if the slot must be filled to properly create the vehicle.

    The "Additional Modification" and "License Plate Design" slots are popular mod slots because nothing that affects the vehicle's performance is usually installed in those slots. In fact, the Additional Modification slot is specifically for mods because nothing stock in the game is installed in that slot. Another good slot candidate might be the GPS slot. Taking over the GPS slot doesn't affect vehicle performance.
    1. Open the mod vehicle's ZIP file. This will usually be somewhere in the folder "C:\Users\Your_User_Name\AppData\Local\BeamNG.drive\latest\mods".
    2. Within the ZIP file is a "vehicles" folder, and in that folder are folders with vehicles' names. Pick one mod vehicle to use for this exercise, and remember its name. This vehicle will be referred to as the target vehicle. A folder will be created later that will eventually hold the stunt mortar support files for this vehicle. This folder's name needs to exactly match the name of the target vehicle folder.
    3. Find an appropriate slot somewhere within the target vehicle JBEAM files and take note of the slot type.
    4. Find the target vehicle's chassis JBEAM file. If it's a body-on-frame vehicle, the name of the file will probably be the name of the vehicle with "_frame.jbeam" at the end. If it's a unibody vehicle, the name of the file will probably have "_body.jbeam" at the end. Open the chassis JBEAM file.
    5. Look for all of the "nodeWeight" tags in the file. Take note of the highest value found with these tags. A value of 40% of this node weight will be used as a starting point for the stunt mortar node weights. Calculate this 40% value now.
    6. Find the "beams" section of the chassis file. Look at the comments in this section and find a main load-bearing part of the chassis. Take note of the "beamDeform", "beamSpring", and "beamDamp" tags in this chassis area. The stunt mortar attachment beams will use 10% values of beamSpring and beamDamp, and will use the full value of beamDeform as a starting point. Calculate these values now.
    7. Launch BeamNG.drive and spawn the target vehicle in the blank, empty grid map for fast loading.
    8. Strip the vehicle down until only the chassis (frame or body) remains. Some parts can't be completely removed, and that's OK.
    9. Turn on the node name display. If the debug stuff is setup with default settings, this can be accomplished with Ctrl-N.
    10. Select 10 chassis nodes to use as attachment points for the stunt mortar, 5 from each side of the chassis. Take note of these node names. Exit BeamNG after selecting nodes.
    11. The stunt mortar is encapsulated in the ZIP file "HighBeam9000_Stunt_Mortar.zip". Create a new folder on your PC and extract the ZIP file into this folder.
    12. Within the extracted folder structure is a "vehicles" folder, and in that folder are folders with the names of all the vehicles currently supported by the stunt mortar. This exercise will use the "hatch" (Covet) as an example. Make a copy of the "hatch" folder.
    13. Rename the copy with the exact same name as the target vehicle's original folder. If the folders aren't named exactly the same, this won't work.
    14. Open the folder that you just renamed. This will soon be the target vehicle's stunt mortar support file folder. Feel free to check out the "inputmaps" folder and the "input_actions_HighBeam9000_Stunt_Mortar.json" file. However, these items don't require modification.
    15. Rename the file "HighBeam9000_Stunt_Mortar_HatchMod.jbeam". Change the "_HatchMod" part of the file's name to something that denotes the slot type that was selected for the stunt mortar. For example, if the "gps_nav" slot was selected, the file could be renamed as "HighBeam9000_Stunt_Mortar_GPSNav.jbeam".
    16. After renaming the file, open it.
    17. At the top of the file is the name of the JBEAM contained by the file. The name of the JBEAM must match the name of the file, except without the ".jbeam" extension.
    18. In the "information" section, change "(Hatch Mod)" to something more descriptive of the slot type selected for the stunt mortar.
    19. In the "slotType" section, change "hatch_mod" to the exact text of the target slot type on the target vehicle.
    20. Save and close this file.
    21. Find the file "HighBeam9000_Stunt_Mortar.jbeam". This file's name must remain unchanged. Open this file.
    22. In the "variables" section, there are some variables whose names start with "hb9k_forceOrg". These variables determine where the stunt mortar is placed in the vehicle. If the minimum and maximum X, Y, and Z coordinates of the vehicle nodes are known, then those values can be entered. The defaults for each variable must be between min and max, inclusive. If the vehicle's extents are not known, then -2 to 2 is a good starting range to try first. The parameters for the variable "hb9k_forceMag" will be set later when the stunt mortar is installed for the first time.
    23. In the "nodes" section, find the "nodeWeight" tag. Set the node weight to the value that was calculated at the end of step (5).
    24. In the "beams" section, set the "beamDeform", "beamSpring", and "beamDamp" values to those calculated at the end of step (6).
    25. Also in the beams section are the beams that connect the stunt mortar to the chassis. The stunt mortar nodes are named "hb9k_smfn1" and "hb9k_smfn2". There is a list of 10 nodes that are connected to hb9k_smfn1, and the same 10 nodes connected to hb9k_smfn2. Edit both lists to connect both stunt mortar nodes to the 10 nodes selected in step (10).
    26. Save the file, but keep it open to be edited some more later. The stunt mortar maximum and default forces still need to be set.
    27. Navigate back to the base folder in which the file "HighBeam9000_Stunt_Mortar.zip" was extracted at the beginning of this procedure, and zip everything back up again, including your new stunt mortar support files. Do not delete the unzipped copies of the files. You'll need those to put your vehicle's stunt mortar support files back whenever the official stunt mortar ZIP file is updated on your PC.
    28. Copy the ZIP file back to the mods folder where you found it. Overwrite the existing file.
    29. Launch BeamNG, spawn the target vehicle, equip the stunt mortar, and try it out. Also, be sure to check the debug window for errors. Pop up the debug window with the ~ key, except don't hold shift when pressing it.
    30. Tune the settings in the file "HighBeam9000_Stunt_Mortar.jbeam":
      -- The "hb9k_forceMag" variable default value is normally set to the minimum necessary to flip a vehicle onto its side, and the maximum is normally set to 5 times the default.
      -- The "nodeWeight", "beamSpring", and "beamDamp" beam settings may need to be adjusted if signs of instability are detected. These signs include BeamNG reporting instability, the vehicle vibrating or sliding around on its own, or the vehicle actually exploding. If instability occurs, raise the nodeWeight, lower the beamSpring or beamDamp, or some combination thereof. Some experimentation may be necessary.
    31. Once it's dialed-in, enjoy!

Recent Updates

  1. Vehicles added
  2. Vehicles and Props added, +More
  3. New Vehicles Added

Recent Reviews

  1. mhegai
    mhegai
    5/5,
    Version: 0.4
    Directed by
    Michael Bay
  2. Andryusha
    Andryusha
    5/5,
    Version: 0.4
    S Tier mod and explanation
  3. a normal driver
    a normal driver
    5/5,
    Version: 0.2
    this is amazing! definently usefull for stunts
    1. HighBeam9000
      Author's Response
      Thank you for the review!

      This is what the stunt mortar is for. :)

      BTW, throwable rocks are coming in the next update, which will be posted soon.
  4. TPWTB TV
    TPWTB TV
    5/5,
    Version: 0.2
    Does it work with mods?
    1. HighBeam9000
      Author's Response
      Thank you for the review!

      As far as modded vehicle support goes, please see the answer(s) below:

      ----== The Short Answer ==----
      The short answer is that it's *possible* to attach the stunt mortar to any vehicle or prop within BeamNG, BUT support for a particular vehicle or prop is *not* automatic. A set of custom attachment files are required for each vehicle or prop to include stunt mortar support. There are plans to support non-stock vehicles, such as the CRD and others, but this will take time. Support for non-stock vehicles will be added after stock vehicles and props. More popular non-stock vehicles will likely be supported before less popular non-stock vehicles.

      ----== The Long Answer ==----
      Some mods are more universal than others. For example, AgentY's Universal JATOs can be attached to a vehicle's doors. This type of attachment works across most vehicles because the names of door nodes usually start with the letter 'd' and start counting at 1 (d1l, d1r, d2l, d2r, etc). This yields common door node names.

      Because of its explosive nature, the stunt mortar doesn't enjoy such universal attachment. Unfortunately, it would rip the doors off. Instead, it has to attach to a stronger part of the vehicle than the doors: the chassis (frame or body). Not all chassis use the same node names, so each vehicle needs it's own set of attachment files to specify exactly which nodes to connect to. This attachment method was selected because it also allows attachment to props (barrels, rocks, etc), which usually don't have the same node names as vehicles. BTW, throwable rocks are coming with the next update.

      Motivated users can create their own custom attachment files for vehicles that don't have out-of-the-box support yet. Instructions will be included with the next update that take a user step-by-step through the process of creating attachment files for almost any vehicle they like, as long as the vehicle has an available slot (any slot). If the vehicle doesn't have an available slot, it's still possible to attach the stunt mortar, but it's a more complicated process.
  5. VTC
    VTC
    5/5,
    Version: 0.1
    please tell me the combination or how to add the explosion pop?
    1. HighBeam9000
      Author's Response
      Here's what I did:
      (1) Goto Options-->Controls-->Bindings-->Gameplay-->Explode, and bind the 'Explode' action to a button on your controller. I used 'X'.
      (2) Install the stunt mortar on the vehicle.
      (3) Goto Options-->Controls-->Bindings-->Vehicle Specific-->Stunt Mortar, and bind it to a button on your controller. I used 'A''.
      (3) Use the following settings for the stunt mortar to launch the vehicle into a forward somersault:
      Force Direction X = 0
      Force Direction Y = 0
      Force Direction Z = 1
      Continuous Force = 0
      Force Duration = About 200 ms
      Force Magnitude = Depend on vehicle weight. Experiment with this.
      Force Origin X = Middle of slider (probably 0)
      Force Origin Y = Maximum (puts thruster at rear bumper)
      Force Origin Z = Middle of slider (probably won't be 0)
      (4) Mash the throttle and build speed because moving explosions are more dramatic.
      (5) Trigger the stunt mortar and the vehicle 'Explode' action at the same time.
      (6) Enjoy, repeat, and enjoy some more.
  6. eggward
    eggward
    5/5,
    Version: 0.1
    honestly this is the greatest thing. hands down 10/10 vehicular yeet
    1. HighBeam9000
      Author's Response
      Thank you for the review.

      I'm glad that throwing cars gives so much joy. :)
  7. Agent_Y
    Agent_Y
    5/5,
    Version: 0.1
    Haven't tested it yet but from the videos it looks really promising! Idea: you can add a setting that will add an explosion effect when the mortar is used, explosions on command can be made with a LUA controller that activates particles, you can copy some of the code from the old cannon
    1. HighBeam9000
      Author's Response
      Thank you for the review!

      I might add a poof of something; some evidence that something fired (sparks, flame, smoke). Good idea.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice