So, I'm building a mission where the player flies a capital ship. Using keypress-triggered SEXP's, the player can overtax the ship's powergrid in various ways to improve performance. All of that actually works great and is awesome!
One of the bad things that can happen is a system malfunction, which I want to use EMP to simulate. So made this weapon:
$Name: MG-EMP
$Model File: none
$Velocity: 20
$Fire Wait: 1
$Damage: 1
$Damage Type: HugeWeapon
$Blast Force: 2000.0
$Inner Radius: 10.0
$Outer Radius: 20.0
$Armor Factor: 1
$Shield Factor: 1
$Subsystem Factor: 0
$Lifetime: 0.1
$Energy Consumed: 0.0
$Cargo Size: 1
$Homing: NO
$Rearm Rate: 0.05
$Flags: ( "EMP" )
$EMP Intensity: 375.0
$EMP Time: 3.0
...and then set up this SEXP to trigger its creation...
$Formula: ( every-time
( and
( >=
( mission-time-msecs )
( + @Last-Overload-Effect[0] 3000 )
)
( >= @Overload-State[0] 50 )
( < @Overload-State[0] 75 )
)
( weapon-create
"<none>"
"MG-EMP"
( get-object-x "Alpha 1" )
( get-object-y "Alpha 1" )
( get-object-z "Alpha 1" )
)
( modify-variable
@Last-Overload-Effect[0]
( mission-time-msecs )
)
)
+Name: OverloadEMP
+Repeat Count: 1
+Interval: 1
The view visibly shakes, and I get the 'BLAST' warning on the UI every 3 seconds, so I am pretty sure the weapon is being properly generated, lasting for 0.1 seconds, exploding inside my ship, and hitting me. The issue is, it is not causing any kind of EMP effect.