Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: Additional "mountTypeOverride" features/restrictions + shift-click bug?  (Read 195 times)

Arthr2(real)

  • Ensign
  • *
  • Posts: 5
    • View Profile

I'd like something like an "onlyOverrideType" and/or "onlyAcceptOverrideType" setting for weapon's slots. I have ran into a few issues with using "mountTypeOverride" to mistype weapons, like making a missile which scales off energy weapon bonuses ("mountTypeOverride":"MISSILE","type":"ENERGY",) or weapons I only want in composite slots instead of being able to be used in any.

The first weapon actually almost works perfectly, except for not being able to be mounted to composite slots (which is fine IMO and neat restriction for an energy-missile hybrid) and a balance breaking bug which allows the player to place it in energy slots by simply shift-clicking after placing one of them correctly in a compatible slot.

I've heard the second weapon's issue has previously been tackled by other modders by scripting the weapon to remove itself if placed in the wrong slot but that only leads to player confusion and I'd like the weapons to work right with both the list UI and shift-clicking. And I have found a workaround which accomplishes this by setting the override type to decorative and the main type to the slot I want ("mountTypeOverride":"DECORATIVE","type":"COMPOSITE",) but it feels weird and still requires me to script in any weapon stat scaling manually (which I could also do in the first example, but I feel it looks neater to have the native "counts as ENERGY for stat modifiers" explain that instead of secondary description text), but...

tl;dr: I'd like a neater option to have weapons which can only be slotted into a single slot type and weapons which only base the slots they can be slotted into on their override type.

(Image shows both of the weapons with shift key held, first one can be mismounted into energy slots, the second works and only accepts composites)
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: Additional "mountTypeOverride" features/restrictions + shift-click bug?
« Reply #1 on: January 02, 2024, 04:27:08 PM »

Hmm. So, good news/bad news! I've fixed the bug that let MISSILE/ENERGY weapons fit into ENERGY slots - I'm not entirely sure why the code that let it do that was there (and am a bit concerned that I might have inadvertently broken something else), but it's not clear what that might be and it looks like just a straight up error or an early version of the code that got left in by mistake.

The bad news is that your (rather creative, I have to say!) DECORATIVE/COMPOSITE combination was actually making use of this specific bug, so it no longer works.
Logged

Arthr2(real)

  • Ensign
  • *
  • Posts: 5
    • View Profile
Re: Additional "mountTypeOverride" features/restrictions + shift-click bug?
« Reply #2 on: January 02, 2024, 05:08:27 PM »

The bad news is that your (rather creative, I have to say!) DECORATIVE/COMPOSITE combination was actually making use of this specific bug, so it no longer works.

Thanks for the fix! This exact thought crossed my mind which is why I ask for a new tag or boolean in the json which would replace the janky DECORATIVE/COMPOSITE combination with something like COMPOSITE/MISSILE + "onlyAllowOverrideSlot" which would only allow it to slot into COMPOSITE slots.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: Additional "mountTypeOverride" features/restrictions + shift-click bug?
« Reply #3 on: January 03, 2024, 11:05:08 AM »

Yeah, I see what you mean. Added "restrictToSpecifiedMountType" to .wpn files; if set to true this works regardless of whether an override mount type is specified or not.
Logged