Skip to content
CRUSHFORMV1.1.0
GET IT ON FAB

TOOLSDEBUG MODE

Debug mode

Debug mode is a panel for trying the plugin on a live body, without a test drive. Crushform.DebugMode opens it over the game. It gives you a free camera, a target, and tools that dent, dirty, wash, break glass and drop the body, plus overlays that show the lattice, the stiffness zones and the tyres. Run the command again to close it.

The panel is titled CRUSHFORM DEBUG. Its sections are titled in capitals: TARGET, TOOLS, DAMAGE, DIRT, WORLD, VIEW, TIME and INFO.

The CRUSHFORM DEBUG panel with no target: the TARGET row reads 'No target. Aim at a body and use Pick.', and the DAMAGE and DIRT buttons are greyed out.
The panel before a body is picked.
  • TARGET: click Pick, then aim with the right mouse button held and click the body. Or step through the bodies in the level with < and >.
  • TOOLS: Ball throws a ball at the body, Dent dents it at a chosen impact speed, Dirt brushes dirt on, Wash brushes it off, and Glass cracks or breaks the glass at the crosshair.
  • DAMAGE: Light, Medium, Heavy and Wreck apply a set of hits. Repair straightens the body, Wash cleans it, and Drop lifts the body to a height and lets it fall.
  • DIRT: Dusty, Muddy, Snowy and Wet fill the body with that mix, at an Amount you set.
  • WORLD: Reset world, Respawn props and Clear debris.
  • VIEW: four overlay switches, described under How it works: Lattice, Zones, Tyres and Hit markers.
  • TIME: Pause, Resume and Step (one frame) control the pause of the world. The speed buttons 1, 0.5, 0.25 and 0.1 set the time dilation. When the game or another player holds the pause, the panel says so instead.
  • INFO: the target’s Profile, its Parts that are off or bent, its Glass counts and the Dirt at aim.
A dented sedan with the lattice overlay on All: grey nodes are undamaged, damaged ones run from green to red, and beams join the nodes.
Crushform.Debug 2 on a dented sedan. Grey nodes are undamaged; damaged ones run from green to red as the dent deepens.

The mode runs on your local player. While you hold the right mouse button you fly and aim: the W, A, S, D, E and Q keys move the camera, and the mouse wheel changes the fly speed. The left mouse button uses the selected tool at the crosshair. Releasing the right mouse button stops the flying.

The panel refreshes the target’s state while it is open. Its INFO section shows the profile, the parts that are off or bent, the glass count and the dirt at the aim.

The damage and repair buttons, and the world buttons, run on the server through the plugin’s relay. A client can use them only when the server allows it. The server allows its own player always, and remote clients by default; see Key settings. When it refuses, the panel prints Server tools unavailable.

The VIEW section switches four overlays on and off:

  • Lattice (Crushform.Debug): Off, Damaged or All. It draws the lattice nodes and the beams between them.
  • Zones (Crushform.ShowZones): the stiffness zones of every damageable body, as boxes.
  • Tyres (Crushform.Tire.Debug): Off, Counts or Rays. Counts shows the on-screen tyre counts. Rays also draws the rays of each deforming tyre.
  • Hit markers (crushform.Impact.LogHits): a marker where each hit lands.
Three stiffness zones drawn as boxes around a sedan: blue at the rear, green along the body and red at the nose, labelled x0.2, x1.0 and x4.0, 12 cm.
The zones of a sedan profile with three zones added for this shot, with the Zones overlay on.

Nothing to create. The mode works on any body that has a Crushform deform component, such as a vehicle with the adapter, or a prop.

  1. Use a build other than Shipping. The debug module is not in Shipping builds, so Crushform.DebugMode is not there. It works in every build except Shipping, and in the editor.
  2. Open a level with a Crushform body. The plugin’s /Crushform/ProvingGround/Maps/Lvl_ProvingGround has one, and so does your own level once you have set up a vehicle, as in Your own vehicle.
  3. Press Play In Editor. Open the console with the tilde key and run Crushform.DebugMode.
  4. Click Pick in the TARGET section. Hold the right mouse button to aim at the body, then click the left button: the body under the crosshair becomes the target, and the tool goes back to the one you had selected. Or step to a body with < and >. Then press Heavy under DAMAGE.

On Blueprint. The mode has no Blueprint functions. From a Blueprint, run the console command with the engine’s Execute Console Command node, in the Development category. The graph below runs it from a custom event:

The graph runs the console command from a custom event.

In C++. Get the mode from the local player, and call its functions. The mode is a ULocalPlayerSubsystem:

#include "CFDebugModeSubsystem.h"
UCFDebugModeSubsystem* Mode = LocalPlayer->GetSubsystem<UCFDebugModeSubsystem>();
if (IsValid(Mode))
{
Mode->Toggle(); // Enters the mode when it is off, exits it when it is on.
const bool bOn = Mode->IsActive();
}

Enter() and Exit() do the same without the toggle. The module CrushformDebug is not built in Shipping; see Installation for the dependency rules.

PropertyWhat it doesDefault
Crushform.DebugMode.AllowClientsWhether the server runs the debug tools for remote clients (1) or only for its own local player (0).1
Crushform.DebugThe lattice overlay: 0 off, 1 damaged nodes, 2 all nodes.0
Crushform.ShowZonesThe stiffness zone overlay: 0 off, 1 on.0
Crushform.Tire.DebugThe tyre overlay: 0 off, 1 counts, 2 rays.0
crushform.Impact.LogHitsThe hit markers: 0 off, 1 on.0

The VIEW section sets these CVars, so the panel and the console agree.

Run Crushform.DebugMode in Play In Editor. The CRUSHFORM DEBUG panel opens, with its sections and an overlay hint at the bottom of the screen. Click Pick, hold the right mouse button, aim at a Crushform body and click the left button. The TARGET row shows its name, and INFO shows its profile. Press Heavy: the body dents, and with Lattice set to All in VIEW, you see the lattice nodes move. Run Crushform.DebugMode again to close the panel.

The full view with a sedan picked: a red box outlines it, and the scrolled panel shows its profile DA_CF_Profile_Sedan, its hinged parts at 0 cm and its six intact glass panes in INFO.
The sedan picked. INFO shows its profile, its parts, its glass and the dirt at the aim.

Crushform.DebugMode does nothing in a packaged build. Cause: the CrushformDebug module is not in Shipping builds, so the command is not registered there. Fix: use a build other than Shipping. Do not make shipping code depend on this module.

The Output Log prints this line:

Crushform.DebugMode: no local player in this world.

Cause: the command ran in a world without a local player, such as a dedicated server. Fix: run the command in a client window, or in the editor’s Play In Editor window.

The panel shows Server tools unavailable, and the server-side buttons are greyed out. Cause: the server runs with Crushform.DebugMode.AllowClients set to 0, and you are a remote client. Fix: set it to 1 on the server, or run the tools on the server’s own player.

The dent buttons are greyed out. Cause: the target is missing, or its profile has Dents off. The panel then shows Dents off next to the target’s name. Fix: pick a body that has a profile with dents on, or turn Dents on in its profile.