Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Erebus Alpha on May 16, 2018, 01:42:47 pm

Title: Capital Ship Mission - Need Help EMPing Myself!
Post by: Erebus Alpha on May 16, 2018, 01:42:47 pm
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:

Code: [Select]
$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...

Code: [Select]
$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.
Title: Re: Capital Ship Mission - Need Help EMPing Myself!
Post by: JSRNerdo on May 16, 2018, 03:26:15 pm
Try either replacing the EMP with an electronics (d-missile) effect or adding a shockwave to the EMP weapon. IIRC EMP and electronics weapons have some odd behaviour with blasts and shockwaves.
Title: Re: Capital Ship Mission - Need Help EMPing Myself!
Post by: Erebus Alpha on May 16, 2018, 03:48:42 pm
I would like to go with an EMP effect instead of an electronics effect. I added primary and secondary firepoints to the capship, and it does have some fantastically powerful missiles, all of which require aspect lock to fire. When EMP'ed, those missiles will not be usable.

Adding a shockwave back to the EMP weapon...
Title: Re: Capital Ship Mission - Need Help EMPing Myself!
Post by: Nightmare on May 16, 2018, 03:55:01 pm
Then make 2 weapons- 1 for the EMP to killed the target lock of the missiles, 1 to disable the player ship.
Title: Re: Capital Ship Mission - Need Help EMPing Myself!
Post by: JSRNerdo on May 16, 2018, 03:56:29 pm
I would like to go with an EMP effect instead of an electronics effect. I added primary and secondary firepoints to the capship, and it does have some fantastically powerful missiles, all of which require aspect lock to fire. When EMP'ed, those missiles will not be usable.

An electronics effect with weapons/sensors/etc multipliers set to a non-zero number does in fact shut down your weapons and prevent you from firing them, basically giving the same effect as an EMP. Source: Made a capship command mission with a special ability ehitting you with electronics as part of a backblast thing
Title: Re: Capital Ship Mission - Need Help EMPing Myself!
Post by: Erebus Alpha on May 16, 2018, 04:16:46 pm
Adding a shockwave did not work. I am going to try spawning the weapon on the outside of the ship, aimed at the ship. It may be an issue with collision, and it may be failing to apply EMP because the inside of the ship might be transparent & noncolliding.

Capships are big and slow, I shouldn't have any problems hitting myself with a really fast missile.

As for electronics-effects disabling a ship's weapons, can they be set to disable only secondaries? I want the primaries to still be usable, right up until the ship blows itself apart. (Yay, self-destruct SEXP!)
Title: Re: Capital Ship Mission - Need Help EMPing Myself!
Post by: Nightmare on May 16, 2018, 04:23:28 pm
I don't think it's possible, atleast I'd use turret-lock instead.
Title: Re: Capital Ship Mission - Need Help EMPing Myself!
Post by: JSRNerdo on May 16, 2018, 04:30:58 pm
As for electronics-effects disabling a ship's weapons, can they be set to disable only secondaries? I want the primaries to still be usable, right up until the ship blows itself apart

Maybe if you had the secondaries set to no dumbfire and made the electronics EMP your sensors and not your weapons? That, or have a seperate event to lock-secondary-weapons Alpha 1.
Title: Re: Capital Ship Mission - Need Help EMPing Myself!
Post by: Erebus Alpha on May 16, 2018, 04:42:55 pm
Ok, just tried it. Capital ships seem to be wholly immune to EMP.

(https://s9.postimg.cc/bsf8ii4nx/Capship_Emp_Missiles.jpg)

I installed a grey trail for testing purposes, so that I would be able to see the 'missile' which is supposed to be generating EMP. It's spawning behind me properly, colliding, and exploding. But with none of the EMP goodness.

I initially thought this might have been a FREDing issue, but it probably belongs in the modding forum instead.

Modified weapon:
Code: [Select]
$Name: MG-EMP
$Model File: none
$Velocity: 10000
$Fire Wait: 1
$Damage: 1
$Damage Type: HugeWeapon
$Blast Force: 2000.0
$Inner Radius: 50.0
$Outer Radius: 100.0
$Shockwave Speed: 80
$Shockwave name:        shockwave01
$Armor Factor: 1
$Shield Factor: 1
$Subsystem Factor: 0
$Lifetime: 0.5
$Energy Consumed: 0.0
$Flags: ( "EMP" )
$Trail:
+Start Width: 100
+End Width: 100
+Start Alpha: 1
+End Alpha: 0
+Max Life: 10
+Bitmap: MissileTrail101

$EMP Intensity: 375.0
$EMP Time:                             3.0
Title: Re: Capital Ship Mission - Need Help EMPing Myself!
Post by: Nightmare on May 16, 2018, 04:53:26 pm
EMP intensity too low? Enter something really high for testing, to see if it works.
Title: Re: Capital Ship Mission - Need Help EMPing Myself!
Post by: Erebus Alpha on May 16, 2018, 05:06:49 pm
Increasing EMP intensity to 375 million had no effect.

I also thought EMP time might be measured in milliseconds instead of seconds, so I tried setting it to 3000. No effect.