Author Topic: How to make a mod  (Read 746 times)

Offline Chuckebaby

  • Colonel
  • ****
  • Posts: 386
  • Chrysalis are people too
    • View Profile
How to make a mod
« on: December 09, 2023, 07:42:11 pm »
I know this is a very broad question but I have made my own edits to rulesets, weapons, etc.
But up until now, I have only overwritten the files in rulessets copy/paste (for example to increase storage limits)

I know it has something to do with metadata, I'm just not sure what.

Do I make copies of the ruleset files, edit them, then put them in a folder, then create metadata ?

Any help I would be grateful.

Offline Nord

  • Commander
  • *****
  • Posts: 1660
  • The Gate is open.
    • View Profile
Re: How to make a mod
« Reply #1 on: December 09, 2023, 08:21:51 pm »
Basically, yes. Create copy of files you want to change and put them into "user/mods" folder.
Dont forget to remove parts that you dont change. So, if you add more power to a pistol, your mod will contain only "items.rul" file, with only one "- type:" part in it.
metadata file needed mostly for correct naming of your mod inside game. Shortest type of it can be similar to this:
Code: [Select]
name: "my super duper mod"
version: "1"
author: "Chuckebaby"
id: AnyShortName
master: xcom1

Offline Chuckebaby

  • Colonel
  • ****
  • Posts: 386
  • Chrysalis are people too
    • View Profile
Re: How to make a mod
« Reply #2 on: December 10, 2023, 03:36:18 pm »
Thank you Nord.
What about modding a mod ?
Is it basically the same way ?

I take my rules set file, items file, put them into a folder and the metadata goes in that folder along with the other files (rule sets and items) ?

Thank you again. You answered one of my questions already (Only put the changes in, not the whole ruleset file).

Offline CrazedHarpooner

  • Sergeant
  • **
  • Posts: 39
    • View Profile
Re: How to make a mod
« Reply #3 on: December 10, 2023, 06:25:05 pm »
If you mean you want to alter parameters without modifying the mods files directly but by making your own mod to work with the main one, yes, pretty much the same way. I belive the only thing you need to make sure of is that your mod is listed after the main mod (or mods) you're altering in the list of mods in the game, otherwise the order could "undo" the changes you make or cause other issues.

Offline Chuckebaby

  • Colonel
  • ****
  • Posts: 386
  • Chrysalis are people too
    • View Profile
Re: How to make a mod
« Reply #4 on: December 10, 2023, 07:19:17 pm »
If you mean you want to alter parameters without modifying the mods files directly but by making your own mod to work with the main one, yes, pretty much the same way. I belive the only thing you need to make sure of is that your mod is listed after the main mod (or mods) you're altering in the list of mods in the game, otherwise the order could "undo" the changes you make or cause other issues.

Thank you. I believe I have read about parent files and to make sure sub mods are underneath but your comment has just confirmed that and shown some clarity.
I appreciate it. thanks

Offline 0xEBJC

  • Colonel
  • ****
  • Posts: 180
  • Y'all are awesome! Thankful for this community.
    • View Profile
    • My Projects
Re: How to make a mod
« Reply #5 on: December 15, 2023, 06:52:08 pm »
Here's some examples on how to create a mod that will modify another mod, for example X-Com Files with directly editing the X-Com Files mod files.

Create your own folder in the mods directory, and make sure to add your own `metadata.yml` file, then I'd suggest downloading other peoples mods and reviewing the files, content, organization structure etc.  I've done some mods in the past, but over time the format and structure, like what to name the files (optional, but more clarifying what in the files, like picture names or .rul file names can be very helpful.)

Code: [Select]
.../openxcom/
.../openxcom/mods/
.../openxcom/mods/my_new_mod/
.../openxcom/mods/my_new_mod/metadata.yml

Then in your mod folder create a Ruleset directory where all the .rul files go , etc for Resources (images), Language (text and translations), etc...

I'd recommend starting small on just trying to make a mod that changes a single aspect, property, image, etc and build from there.

Solarius Scorch has done an amazing job on the X-Com Files mod... I'm constantly going to and referencing his mods source files as an example of a change or aspect that I want to implement in my mod work.