On Modding Ship Hulls

Please post here for questions and discussion about data, event, art and sound modding and the game editor for Distant Worlds.

Moderator: MOD_DW2

Post Reply
Overlord015
Posts: 55
Joined: Tue Jan 20, 2015 8:08 pm

On Modding Ship Hulls

Post by Overlord015 »

After almost a week of messing around the files I've finally managed to get modded ship hulls working. Currently testing them out on an ongoing game. A question for anyone that may know, are there any other dependancies I need to modify in order to get modified hulls to work 100%?

I've added additional slots and modified firing arcs for some stations and combat ships in order to either emphasize their specialties or make them more flexible. Game runs fine, issue is that for hulls whose firing arcs I've modified seem to act as though all weapons are placed in the same location in the center of the hull and have 360 degrees of coverage ala DW1/DWU. Also, component bay indicators in the design screen break on these hulls and don't show regardless of whether I toggle the filter on or off.

This might be a feature for some (lol), but it is not what I was going for. Anyone have a clue on what I might be missing here?
User avatar
Eventure
Posts: 105
Joined: Wed Apr 20, 2022 12:16 pm

Re: On Modding Ship Hulls

Post by Eventure »

Overlord015 wrote: Sat May 21, 2022 8:58 pm After almost a week of messing around the files I've finally managed to get modded ship hulls working. Currently testing them out on an ongoing game. A question for anyone that may know, are there any other dependancies I need to modify in order to get modified hulls to work 100%?

I've added additional slots and modified firing arcs for some stations and combat ships in order to either emphasize their specialties or make them more flexible. Game runs fine, issue is that for hulls whose firing arcs I've modified seem to act as though all weapons are placed in the same location in the center of the hull and have 360 degrees of coverage ala DW1/DWU. Also, component bay indicators in the design screen break on these hulls and don't show regardless of whether I toggle the filter on or off.

This might be a feature for some (lol), but it is not what I was going for. Anyone have a clue on what I might be missing here?
It's hard to say without seeing the changes. The component bays have a mesh name id to identify it's location, afaik.
User avatar
frankycl
Posts: 402
Joined: Mon Mar 01, 2021 5:16 pm

Re: On Modding Ship Hulls

Post by frankycl »

Overlord015 wrote: Sat May 21, 2022 8:58 pm (...) A question for anyone that may know, are there any other dependancies I need to modify in order to get modified hulls to work 100%?
No, you need no other files, etc. for this, but if you want to edit/add things on the ship-/station-models you need to do this with the mesh-files in the bundle-files (also see below) - either with Stride 3D, or with the command-line extraction-tool (see here: https://github.com/DW2MC/DistantWorlds2 ... tag/v1.1.1). ;)

Overlord015 wrote: Sat May 21, 2022 8:58 pm I've added additional slots and modified firing arcs for some stations and combat ships in order to either emphasize their specialties or make them more flexible. Game runs fine, issue is that for hulls whose firing arcs I've modified seem to act as though all weapons are placed in the same location in the center of the hull and have 360 degrees of coverage ala DW1/DWU. Also, component bay indicators in the design screen break on these hulls and don't show regardless of whether I toggle the filter on or off.
You need to take in account that you can only change/edit component-bays that are stored in the bundle-files (on the ship-/station-models - which are very limited for weapons and engines, normally). The location of these component-bays on the models is allways fix (and defined through the component-bay-IDs in the XML), but you can change the type of the component-bays at these locations and also the components that are used on them - however you can't change their graphical looks (of the component-bays) on the models only via XML-editing (I've tried and tested this several times). :!:

But nevertheless you can still add componetbays to the ships/stations in the XML, but they will NOT change/add to the locations or the graphical looks on the models - they will only change the loadout of the ships/stations for the added components. (I've tested and done this several times, too) ;)

As for the firing arcs:
If you don't edit the models/meshes in the bundle-files, firing arcs can only be used for already existing weapon-meshes for the weapon-component-bays. If you add any additional weapons via the XML they will only be counted for "internally", but will not have a special location/mesh on the models. Therefore all weapon-fire of those additional weapons can only be fired from the center of the model (since they have no other defined location on the model <-> this can only be done on the models in the bundle-files).
I'm not sure if it would be possible to use a specially defined firing-arc (in the center of the model) if you only add 1 additional weapon-component-bay (you'll have to test this for yourself), but I'm certain that if you add more than 1 additional weapon-component-bay with different firing-arcs that they will overlap each other - and therefore lead to seemingly altered firing-arcs. ;)
Overlord015
Posts: 55
Joined: Tue Jan 20, 2015 8:08 pm

Re: On Modding Ship Hulls

Post by Overlord015 »

Thank you both for your replies.
It's hard to say without seeing the changes. The component bays have a mesh name id to identify it's location, afaik.
Eventure I've attached my modified XML file. Also, thank you for your modmaker, I used it to work on the changes, I'm planning on typing up some feedback on it once I get these issues sorted and wrap up my current work on component edits.
As for the firing arcs:
If you don't edit the models/meshes in the bundle-files, firing arcs can only be used for already existing weapon-meshes for the weapon-component-bays. If you add any additional weapons via the XML they will only be counted for "internally", but will not have a special location/mesh on the models. Therefore all weapon-fire of those additional weapons can only be fired from the center of the model (since they have no other defined location on the model <-> this can only be done on the models in the bundle-files).
I'm not sure if it would be possible to use a specially defined firing-arc (in the center of the model) if you only add 1 additional weapon-component-bay (you'll have to test this for yourself), but I'm certain that if you add more than 1 additional weapon-component-bay with different firing-arcs that they will overlap each other - and therefore lead to seemingly altered firing-arcs.
I suspected something along these lines could be an issue. Thank you for confirming Frankycl, If I'm not misunderstanding you, this means that even if I don't add any new weapon slots with new arcs, and simply edit existing ones, issues like the ones I described will happen? That is unless I edit the model as well to account for the edited weapon arcs. That's a bummer, so if I revert the weapon arcs to their original settings the issues should be resolved correct? Now, some hulls don't use slots that other versions of the same hull do, if I enable these slots on said hulls, would the same issue occur? I hope this isn't the case as the associated data should be tied to a preexisting base model for a role rather than its variant hulls, is this an accurate assumption?
Attachments
ShipHulls.7z
(107.74 KiB) Downloaded 25 times
User avatar
frankycl
Posts: 402
Joined: Mon Mar 01, 2021 5:16 pm

Re: On Modding Ship Hulls

Post by frankycl »

Overlord015 wrote: Sun May 22, 2022 6:17 pm (...) If I'm not misunderstanding you, this means that even if I don't add any new weapon slots with new arcs, and simply edit existing ones, issues like the ones I described will happen?
No, if you don't add weapon-component-bays to the already existing, you can edit whatever you like and both the weapons and the firing-arcs will be displayed and functioning as intended (if you stay within the possible value-ranges, of course).
Only if you add any component-bay that is not already on the model, the issues will be of importance. (but only for things like weapons/defences/firing-arcs - despite of this you can add any other bays/components like e.g. engines, or general components as much as you want and wherever you want (in the XML - i.e. if you use the right parent-tag) - they only never will show on the models (but in the ship-designer they will - in the component-lists). ;)

Overlord015 wrote: Sun May 22, 2022 6:17 pm (...) so if I revert the weapon arcs to their original settings the issues should be resolved correct?
This depends if you had added any additional component-bays for the weapons you wanted to use (see above). ;)

Overlord015 wrote: Sun May 22, 2022 6:17 pm Now, some hulls don't use slots that other versions of the same hull do, if I enable these slots on said hulls, would the same issue occur?
I guess with "enable" you mean: "add the missing component-bays to the other hulls", yes ?
If so, the answer would be yes, the same issues would occur ! - That's simply due to the fact that this "other hulls" are also other models (with mostly also other component-meshes).
However there are some models that have some "secret" component-meshes. This means that they will only be displayed (and functional) if you "enable" them by adding them in the XML, although they where already built for the regarding model (in the bundle-files). But as far as I know, there's no list existing for which models should have what component-bays/- meshes - so you'll just have to try this and use the ship-designer for confirmation (I also had found out about this only by chance :roll: )

Overlord015 wrote: Sun May 22, 2022 6:17 pm I hope this isn't the case as the associated data should be tied to a preexisting base model for a role rather than its variant hulls, is this an accurate assumption?
Äh, I'm not sure I fully understood what you wanted to know, but all the entries belonging to 1 ShipHull-Id in the XML are only connected to 1 preexisting model for/in the game, yes. (if that's what you were asking)
- But, if you assume that there are "base model(s)" that are the same for each ship-/station-role and that those are only varried for/through the different variants for the same role, the answer must be: no ! Each variant has its own ship-model (although the can look quite similar)- and therefore also its own preexisting component-bays. :idea:
Post Reply

Return to “Design and Modding”