FO 4.0 techtree questions

Program aborts? Network configuration? Graphic errors? Bugs? Post your question here.
posted on February 18th, 2024, 7:02 pm
Migrating a mod to 4.0 causes more headache than I realized.
Currently I am stuck on the issue that many special weapons are in fact replaceweapons. My mod heavily relies on time advancement by spawning an "era pod" at the beginning and removing it at the end of each era. This makes sure that only the ships of that specific era are buildable. However, this has the additional unfortunate effect that once an Era has passed, the ships from that era cannot use their replaceweapon-tye special weapons, because the replaceweapon now checks if every requirements of the child ship in the techtree (including the "Era pod") - and apparently even of the parent - are met.

Is there a way to avoid the replaceweapon checking the techtree requirements?

I think I'm going to have several followup questions if this one gets answered...
posted on February 19th, 2024, 5:24 am
To my knowledge there isn't. Right now I'm working on a similar issue, and looking for ways to hide the build button with certain tech requirements unmet.

If this fails, I'll just have to add shipA.odf variants that are identical to the rank 1 version of the ship, and have replaceweapons "return" the ship to it instead. That seems to be the simplest way to have a tech requirement on building the ship, but allow it to replace back and forth after completion.
posted on February 19th, 2024, 6:35 am
You can hide the button if you add the following to the requirements:

<requirement buttonHideUnavailable="true">

I think I figured out a way to circumvent my issue, although it's far from elegant. Originally when the ship uses the special ability, replaceweapon1 replaces the ship with the ability, and then replaceweapon2 auto-replaces it with the original parent class. Now instead of reverting to a parent, replaceweapon2 would turn the child ship into a third ODF that is identical to the parent ship in every way, except its techtree entry would have no requirement. It would require a lot of coding (especially because you would have to add the new "pseudo-parents" to every single weapon avoidance and damage list) and tons of extra ODFs, but it should work. In theory.
posted on February 19th, 2024, 6:48 am
Yup, that's the solution I mentioned. It just needs to be a differently named odf, in fact: the whole contents of "shipA.odf" can be #include ship.odf.
posted on February 19th, 2024, 1:19 pm
k_merse wrote:... because the replaceweapon now checks if every requirements of the child ship in the techtree (including the "Era pod") - and apparently even of the parent - are met.


Are you sure about that last part? In Roots 4.0 the standard Borg Cube requires a lot of items in the techtree, but I can still use its cycle loadout replaceweapon to replace into another version of the Cube when the tech requirements of the standard Cube are not being met anymore (for example by deleting one of the stations the standard Cube requires). It seems like the game only checks the requirements for the replaceweapon and the child object, not the parent object. This also works with the support ships in Roots 4.0.

Also, I think that unless you want the child ship variants to be buildable at a yard you can just remove the era requirement from them altogether and only keep that for the buildable standard variant. Although if you want a variant to be able to replace back into the standard variant then yes, you need a copy of the standard variant with different tech requirements for that.
posted on February 21st, 2024, 8:38 am
So having worked with it a bit more, here's my rundown:

There is no V4 option to have a replaceweapon that does not check ship caps. These are needed, for example, for every Veteran ship with a replacement ability. For example, fed_akirar6.odf must have a techtree requirement which includes the veteran cap, otherwise it could be turned into a veteran when there aren't enough free slots. However, if the Veteran cap is full and you activate Defensive Patterns, it will be unable to replace back into its regular version when the ability ends.

The only solution I can see is the double replace. In TM this will mean adding about a hundred temp ships, since I added mixed tech refitting which uses replacement. Other mods probably need fewer: in Fleet Ops most if not all of the capped ships don't have replaceweapons.

Notably, normal Veterans will have a tooltip that shows your current Veteran cap. They will lose this tooltip during their special ability unless you also add the cap requirement to the special version, and if you do that you will need ANOTHER temp ship for starting the ability. I'm currently on the fence for whether I want to add a dozen more temp ships to fix this tiny tooltip inconsistency.

I did consider putting the double replace on the veteran ability instead, with the temp ship requiring the cap and the final ship not (it can still count against the cap without requiring it) but then the Veteran ship wouldn't show the cap tooltip.
Reply

Who is online

Users browsing this forum: No registered users and 3 guests