Author Topic: Modding beginner  (Read 2730 times)

Offline Ruberto

  • Colonel
  • ****
  • Posts: 123
    • View Profile
Modding beginner
« on: March 03, 2022, 09:34:46 am »
Hello
I like this project so much, I am thinking about contributing.
Nothing big at first, maybe some new monster or map or two.
How difficult is it and how do I start?
(I have 0 modding experience, had done some basic Python coding and map-making with editors in Heroes2 and Incarnate)

Offline Marza

  • Colonel
  • ****
  • Posts: 149
    • View Profile
Re: Modding beginner
« Reply #1 on: March 03, 2022, 08:08:30 pm »
If you have a text editor, you're good to go diving into the .rul files.
Mapping is probably best done with MapView 2.
Sprite work can be done with MCDedit.

Check here for details.

Offline The Martian

  • Commander
  • *****
  • Posts: 754
  • "It implores you to listen to its arguments..."
    • View Profile
Re: Modding beginner
« Reply #2 on: March 07, 2022, 02:13:18 pm »
The "UFOpaedia: Ruleset Reference Nightly" is a very handy guide to the different variables that can be altered using a .rul file. If you haven't checked it out already it is a good resource to become familiar with.

You can find .rul files for all of the default items/aliens/etc in the base non-modded X-Com games inside OXCE's "standard/xcom1" and "standard/xcom2" folders.
Spoiler:

Although you should never alter these files directly they are a great resource to see the format of how different objects that are already coded are laid out.

Another mod that could be very handy for you to look at the code of is the 'Final Mod Pack' as its .rul files are easy to read and cover changing & adding to almost all of the default types of content you'd play with in vanilla X-COM: UFO Defense without using scripts or OXCE's advanced features. (Items, Units, Armors, UFOs, Craft, Craft Weapons, Etc)


My advice is to start by creating your own items.rul (items:) and adding a new piece of equipment to the game and then giving it custom images by adding an extraSprites.rul (extraSprites:) file.

Understanding the items: section before adding armor or units could be helpful because they need a corpse item and store item(For wearable X-Com Armor) to function.


You've already done some Python coding so this information may be redundant but I recommend avoiding using text editors that were not designed for coding. (Like window's default Notepad program)

They may save hidden characters for their text formatting that will cause OpenXcom to experience errors reading the file.

These editors are recommended but anything that understands YAML code should work:
Visual Studio Code
Notepad++
Xed


As an added bonus if you use 'Visual Studio Code ' you can install these additional Ruleset validators to help with your coding:
SupSuper's Ruleset Validator
Pedroterzero's Ruleset Validator

Offline Psyentific

  • Colonel
  • ****
  • Posts: 161
    • View Profile
Re: Modding beginner
« Reply #3 on: March 07, 2022, 11:23:46 pm »
soldiers, items, structures, and crafts are all contained in piratez.rul; open it up with notepad++ and start poking around. use the online bootypedia xpiratez.wtf to find items and learn their STR_WHATEVER names in the file; for example Old Earth Weapon Box is STR_LOOTBOX_OLD_EARTH_WEAPONS which is processed by the workshop project STR_LOOTBOX_OLD_EARTH_WEAPONS_EX into various random loot. everything's all in plaintext so after a while you can start to see how it fits together.

from there, you could probably take apart someone else's small mod and use that structure to build your own mod.

Offline Ruberto

  • Colonel
  • ****
  • Posts: 123
    • View Profile
Re: Modding beginner
« Reply #4 on: March 10, 2022, 10:50:11 am »
Thanks a lot people!
You are great!