OpenXcom Forum

Modding => Help => Topic started by: Atribator on September 28, 2024, 09:07:46 pm

Title: Question about master mods folder access, if this is possible
Post by: Atribator on September 28, 2024, 09:07:46 pm
Hello guys. I'm trying to fiddle around with modding, but I am not understanding how submods actually work. I gave a search on the help section, and the closest thing I found was this:

https://openxcom.org/forum/index.php?topic=8284

So, for example, I will make a submod for x-com files, it's the one I have installed here atm. This one is a master mod, so I set my metadata.yml to point to xcom files as the master. No problems there.

Now, let's say I'll create a new soldier type, pretty much the same as the regular soldier from xcom files, but with higher strength melee and no psi skills. I cannot inherit anything from the original soldier - on ufopaedia it's mentioned anchors are only a copy paste, not actual inheritance. And, for that, I would have to edit the original mod and add the anchors anyway, not an option.

So I copy pasted most of the things from the original soldier, and edited the stats I wanted. And then it comes to this part of the soldier definition:

    deathMale: [41, 42, 43, 135, 136, 137, 138, 139, 140, 141]
    deathFemale: [44, 45, 46, 160, 161, 162, 163]
    panicMale: [701, 702, 703, 704, 705, 706, 707, 708, 709]
    panicFemale: [731, 732, 733, 734, 735, 736, 737]
    berserkMale: [801, 802, 803, 804, 805]
    berserkFemale: [831, 832, 833]

anything above 100 are sounds the original mod replaced, defined it in their own extrasounds.rul, and using resources > sound_compilation folder to access the media.

Is there a way to point, in my mod, to use the folders which already exist on the master mod? The alternative would be to replicate every file from the original and index it in my own mod, but that is too much redundant and suboptimal.

The thread I pointed above was from 2020; is there, in the current OXCE, any options regarding this? I didn't find anything in ufopaedia, so I guess not, but just to be sure.

Thanks.
Title: Re: Question about master mods folder access, if this is possible
Post by: Meridian on September 28, 2024, 09:10:44 pm
Here's a section in Ufopedia about cross-referencing mods: https://www.ufopaedia.org/index.php/Ruleset_Reference_Nightly_(OpenXcom)#Negative_indices_and_cross-referencing_other_mods
Title: Re: Question about master mods folder access, if this is possible
Post by: Meridian on September 28, 2024, 09:19:38 pm
Soldier death sounds would for example look like this:

Code: [Select]
    deathMale: [41, 42, 43, { mod: x-com-files, index: 135 }, { mod: x-com-files, index: 136 }, { mod: x-com-files, index: 137 }, { mod: x-com-files, index: 138 }, { mod: x-com-files, index: 139 }, { mod: x-com-files, index: 140 }, { mod: x-com-files, index: 141 }]
    deathFemale: [44, 45, 46, { mod: x-com-files, index: 160 }, { mod: x-com-files, index: 161 }, { mod: x-com-files, index: 162 }, { mod: x-com-files, index: 163 }]
Title: Re: Question about master mods folder access, if this is possible
Post by: Atribator on September 28, 2024, 10:19:36 pm
I see, that helps, thanks

by the way, the arrays accept a single reference after testing. This throws no errors:

Code: [Select]
    deathMale: [{ mod: x-com-files, index: 41, 42, 43, 135, 136, 137, 138, 139, 140, 141}]
    deathFemale: [{ mod: x-com-files, index: 44, 45, 46, 160, 161, 162, 163}]
    panicMale: [{ mod: x-com-files, index: 701, 702, 703, 704, 705, 706, 707, 708, 709}]
    panicFemale: [{ mod: x-com-files, index: 731, 732, 733, 734, 735, 736, 737}]
    berserkMale: [{ mod: x-com-files, index: 801, 802, 803, 804, 805}]
    berserkFemale: [{ mod: x-com-files, index: 831, 832, 833}]

Still didn't kill anyone to see if it will drop a runtime error, though
Title: Re: Question about master mods folder access, if this is possible
Post by: Meridian on September 30, 2024, 03:48:10 pm
by the way, the arrays accept a single reference after testing. This throws no errors:

just because it throws no error, doesn't mean it's correct or that anything was accepted

syntax needs to be followed exactly everywhere, otherwise you have 99.9% certainty it will NOT work

in this case, the game will either load only the first index, or potentially not even the first one, depending on exact circumstances