Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Conditional tokens for (automatic) mod compatibility  (Read 819 times)

voliol

  • Bay Watcher
    • View Profile
    • Website
Conditional tokens for (automatic) mod compatibility
« on: July 08, 2018, 08:13:07 am »

This suggestion was partially inspired by me seeing and reading various posts on the story board where various mods where not only one mod, but a several separate ones were added to the game, for extra craziness and novelty, or just to see how mixing these would end up (i.e. Modded Hell and Less Crazy Modpack), and also getting the idea that this would be fun to do by myself.
However, without further altering of the files, these mods would stay relatively separate. The skin of a Dragonite, or any other modded dragon, couldn't be tanned into the dragonskin of Old Genesis, and the fungi added by Mottledpetrel will never be turned into Shroom Cake by the toads of the Mushroom Kingdom.
This sent me into a line of thought where I realized that yes, it is possible to make your mods fully compatible with that of others, but if you do, they're often forced to be used with these mods (otherwise not working due to missing objects), and you'll have to upload a separate version for each possible compatibility setting.

To solve this, I propose 4 conditional tokens to be added to all object types: [IF], [ELIF], [ELSE] and [CONDITIONAL_END].
[IF], [ELIF], and [ELSE] would control the flow of the raws, with tokens added between them and a subsequent [CONDITIONAL_END] only being used if the arguments for [IF] and [ELIF] return true, or if none of the ones in previous [IF]s and [ELIF]s do, in the case of [ELSE].
To get raws that can automatically connect to others, I believe a simple argument checking for whether a specific object (and thus the mod) exists would suffice in most cases, something like OBJECT_EXISTS:OBJECT_TYPE:OBJECT_NAME with OBJECT_TYPE:OBJECT_NAME being the full name of an object defined in the raws (e.g. CREATURE:DOG or REACTION:TAN_A_HIDE).
Note that the modder would still have to implement compatibility, but this time the mods would try to connect only when possible, thus removing the need for extra files and uploads.

The addition of conditional tokens would also be use when the game becomes more random and everchanging, so that the existence of a certain creature could be restricted to, say, if the myth gen includes a moon, or zebra men only being described as similar to zebras if zebras have not already been hunted to extinction.

IndigoFenix

  • Bay Watcher
  • All things die, but nothing dies forever.
    • View Profile
    • Boundworlds: A Browser-Based Multiverse Creation and Exploration Game
Re: Conditional tokens for (automatic) mod compatibility
« Reply #1 on: July 09, 2018, 01:04:36 am »

This seems like a lot of work for little payoff.  Many of these can be handled much easier using creature classes and material reaction products.  While you would need to make sure everyone was using the same tags, this would be a lot less work for modders than the changes you're suggesting.

The one time when this might be useful is to avoid duplicate objects (i.e. a mod requires humans, but if multiple mods use humans you don't want a separate human object for each one).

voliol

  • Bay Watcher
    • View Profile
    • Website
Re: Conditional tokens for (automatic) mod compatibility
« Reply #2 on: July 09, 2018, 02:27:52 pm »

I figured it was something that would be nice to have, sooner or later, but I guess there are more important things to focus on at the moment, and maybe it's not the best way to do it either :/
I'll have to look into material reaction products...

Azerty

  • Bay Watcher
    • View Profile
Re: Conditional tokens for (automatic) mod compatibility
« Reply #3 on: July 09, 2018, 05:33:24 pm »

Conditional tags are an interesting proposition.
Logged
"Just tell me about the bits with the forest-defending part, the sociopath part is pretty normal dwarf behavior."

thompson

  • Bay Watcher
    • View Profile
Re: Conditional tokens for (automatic) mod compatibility
« Reply #4 on: July 19, 2018, 08:09:58 pm »

You could write a mod merger yourself, feeding it files with whatever syntax you like. The community would benefit from something like this.

I've thought of doing it myself, but have too many other neglected projects to seriously contemplate taking on another. Once you have children, getting stuff done gets hard...
Logged