Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: Can you disable a weapon mount with a hullmod?  (Read 2179 times)

rogerbacon

  • Commander
  • ***
  • Posts: 150
    • View Profile
Can you disable a weapon mount with a hullmod?
« on: December 29, 2015, 02:38:58 PM »

I want to make a hullmod for a specific class of ship that adds cargo pods but renders two of the ship's weapons unusable. Is that possible? It will only be for a specific class of ship so I know which weapon IDs will be affected if that makes a difference.
Logged

Wyvern

  • Admiral
  • *****
  • Posts: 3803
    • View Profile
Re: Can you disable a weapon mount with a hullmod?
« Reply #1 on: December 29, 2015, 03:38:43 PM »

Hm... That starts to sound more like a variant hull than a hull mod.  Maybe a built-in hull mod that adds cargo space if both of those slots are left empty?  That might be more workable.
Logged
Wyvern is 100% correct about the math.

Zaphide

  • Admiral
  • *****
  • Posts: 799
    • View Profile
Re: Can you disable a weapon mount with a hullmod?
« Reply #2 on: January 03, 2016, 03:15:23 AM »

Should be possible I think :)

You could look at the advanceInCombat() method in BaseHullMod (which you will want to extend to create your new hull mod). You could do something like:
Code
ship.getAllWeapons().get(0).disable(true); // Permanently disable weapon

You would likely want to change the above so that it only disables the weapons you want, and probably just do it once per combat so your script doesn't needlessly try to disable an already-disabled weapon every frame... :)
Logged

rogerbacon

  • Commander
  • ***
  • Posts: 150
    • View Profile
Re: Can you disable a weapon mount with a hullmod?
« Reply #3 on: January 03, 2016, 08:15:49 AM »

Thanks Zaphide. I really appreciate that.
Logged