PEAKMODDERFIREMAPLEJUMPER-RandomDynamite icon

RandomDynamite

Drops 1-10 vanilla dynamite above the players at a random height, scattered wide and raining down over a few seconds. F8 toggles, F9 drops a burst now. Its own dynamite skip the heavy explosion VFX to save framerate. Client-side.

CHANGELOG

1.7.0

  • Fixed the 1.6.0 explosion fix, which was a silent no-op. 1.6.0 stripped the explosion prefab with Object.Destroy, but Unity refuses to remove a component that another component declares as a requirement, and VFX_DynamiteExplosion hits that twice:

    • ExplosionEffectOptimizer has [RequireComponent(typeof(ExplosionEffect))]
    • ParticlePlatformSettings requires its ParticleSystem

    Both destroys were rejected, Player.log recorded Can't remove ExplosionEffect (Script) because ExplosionEffectOptimizer (Script) depends on it, and 1.6.0 detonated exactly like vanilla. It even logged "3 visual components removed" because it counted attempts rather than results.

  • Visual components are now deactivated instead of destroyed. Switching off the GameObject does not care about [RequireComponent], and ExplosionEffect.Start never runs on an inactive object, so no orbs are ever created. This is what actually removes the cost.

  • Fixed a second bug the prefab dump exposed. RemoveAfterSeconds.seconds defaults to 5, but the randomised fuse can run to 8. A shared stripped copy would therefore destroy itself before the dynamite reached it, and Object.Instantiate on a dead reference means the explosion silently never happens. Each dynamite now gets its own copy whose lifetime is raised above the worst-case fuse.

  • Added a self-check that reports how many ExplosionEffect components are still active on the copy, and warns if the strip did not take. The 1.6.0 bug would have been caught immediately by this line.

  • The startup dump now searches children for the ExplosionEffect, so the orb count is actually reported (it silently found nothing in 1.6.0), and it logs each explosion AudioSource's spatialBlend, which confirms building a copy 100 km below the map cannot be heard.

1.6.0

  • Reworked the explosion optimisation away from Harmony-patching ExplosionEffect.Start, and towards swapping the explosionPrefab reference on dynamite this mod spawns.
  • Added Effects / Explosion Detail: Minimal, Particles or Full.
  • Removed Effects / Suppress Explosion Effect On Mod Dynamite, which blocked the explosion outright and left dynamite frozen and lit in mid-air forever.
  • The explosion strip itself did not work. See 1.7.0.

1.5.0

  • Bursts are no longer a tight clump. The horizontal scatter was only 5 m, so every piece landed on top of each other. Now 14 m.
  • A burst now rains down over 3 seconds instead of appearing all in one frame, so it arrives as a rolling shower.
  • Much less frequent. Bursts were every 8-20 s. Now every 25-70 s.
  • Toggling it off cancels a half-finished burst, and leaving a room discards anything still queued.

1.4.0

  • Reduced the explosion orb count for dynamite this mod spawned, and randomised the fuse (0.8x - 1.6x).
  • Added a Max Live Mod Dynamite safety cap (default 20).

1.3.0

  • Smoke suppression for mod-spawned dynamite. Vanilla dynamite is unaffected.

1.2.0

  • Fixed the dynamite not working. It now unfreezes the spawned item (SetKinematicNetworked(false)) so it actually falls, and lights the fuse (LightFlare()) so it detonates reliably.
  • The dynamite prefab name is resolved from the loaded game data at runtime.

1.1.0

  • Added a manual burst key (F9) and on-screen messages.

1.0.0

  • Initial release. F8 toggles the spawner, random bursts of 1-10 dynamite.