aliens

Author Topic: Allow mods to pull in groups of .rul files for loading  (Read 4119 times)

Offline Xangi

  • Sergeant
  • **
  • Posts: 16
    • View Profile
Allow mods to pull in groups of .rul files for loading
« on: June 10, 2014, 12:34:10 am »
(Checked the first 2 pages for duplicates, didn't see any, sorry if this has been suggested before)
So this would probably help make mods a lot more... organized. An initializer file for mods with something like:
Code: [Select]
directory:
  - MyMod
files:
  - HumanPistol
  - HumanRifle
  - <etc>
Which then searches \Rulesets\MyMod for Humanpistol.rul and HumanRifle.rul (and any others) and loads them. This would let modders organize their code into many smaller files which would make development a bit less crazy and make mods more readable.

Offline Aldorn

  • Commander
  • *****
  • Posts: 750
    • View Profile
Re: Allow mods to pull in groups of .rul files for loading
« Reply #1 on: June 10, 2014, 03:09:44 am »
A work around could be to name correctly your ruleset files
- MyMod_001_HumanPistol.rul
- MyMod_002_HumanRifle.rul

This way, you are able :
- first to group your ruleset files together
- then to manage order of loading/reading

Anyway, an enhanced feature for a better mod management could be useful in the future (depending if our dear developpers have enough energy and motivation to go on after 1.0  :))
« Last Edit: June 10, 2014, 03:12:44 am by Aldorn »

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Allow mods to pull in groups of .rul files for loading
« Reply #2 on: June 10, 2014, 05:11:06 am »
well, you CAN customize the load order in the config, i guess we could do some sort of ordering like with the craft soldier thing?

Offline Xangi

  • Sergeant
  • **
  • Posts: 16
    • View Profile
Re: Allow mods to pull in groups of .rul files for loading
« Reply #3 on: June 10, 2014, 09:48:07 am »
well, you CAN customize the load order in the config, i guess we could do some sort of ordering like with the craft soldier thing?
Not sure of my original post was clear enough, but basically I'm asking for an automatic macro to be put in to load multiple rulesets all at once with one file in the mod menu/options.

This next bit isn't me bragging, it's relevant I swear
I did a similar system in the modloader for Teleglitch that I made, where each mod has an initializer file which points to the actual mod files, allowing modders to lay the mod out however they want inside its own directory and let users simply enable one file instead of many, without making the modder cram everything into one file.

Now granted, those mods are written in Lua which is really made for that kind of thing, but judging by the way mods are loaded right now I'm guessing that YAML can take some formatted information and turn in into an array of filenames which can then be passed to whatever function processes modded files. In the long run I think this would save a lot of hassle.

Offline Aldorn

  • Commander
  • *****
  • Posts: 750
    • View Profile
Re: Allow mods to pull in groups of .rul files for loading
« Reply #4 on: June 10, 2014, 10:51:14 am »
Ok, so in fact you did ask a question not so different as mine...

https://openxcom.org/forum/index.php?topic=2173.msg21577#msg21577

I am interested by your solution

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2159
    • View Profile
Re: Allow mods to pull in groups of .rul files for loading
« Reply #5 on: June 10, 2014, 02:24:46 pm »
This is planned.

Offline Xangi

  • Sergeant
  • **
  • Posts: 16
    • View Profile
Re: Allow mods to pull in groups of .rul files for loading
« Reply #6 on: June 10, 2014, 09:49:25 pm »
This is planned.
Awesome, thanks man.

niculinux

  • Guest