Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Modding quality of life improvements  (Read 1766 times)

Tiler

  • Bay Watcher
  • [ODOR_LEVEL:999]
    • View Profile
Modding quality of life improvements
« on: December 31, 2015, 08:06:23 am »

I've been trying to do some modding lately, and there's a few things, mainly with interactions and syndromes, where some minor additions would help out a ton. These are just kind of miscellaneous tokens that, while running myself into a wall repeatedly, I came to wish existed. Sorry if any of this is a repeat or infeasible for one reason or another.

Interactions
IT_MUST_HAVE_SYNDROME_CLASS (the opposite of IT_CANNOT_HAVE_SYNDROME_CLASS)

CDI:TARGET
Two new arguments: ALLY (e: or ENEMY_ONLY), and NOT_SELF.
Remove the conflict between USAGE_HINT:ATTACK and SELF_ONLY/SELF_ALLOWED (AI will refuse to use interactions with this combination). This would allow creating attack interactions that can apply some effect the the creature using it, and would allow a roundabout means of having IT_* tokens apply to the creature using the interaction.

CDI:USAGE_HINT
Two new arguments: ALWAYS, and NEVER.

Syndrome Effects
SYN_IMMUNE_SYN_CLASS:<SYN_CLASS> creature with this syndrome class is immune to effects of the syndrome.
CE_REMOVE_SYNDROME:<SYN_CLASS> - purges all syndromes with the SYN_CLASS on it.

Reactions
SYNDROME - applies a syndrome to the fellow using the workshop
« Last Edit: December 31, 2015, 05:29:58 pm by Tiler »
Logged

Tiler

  • Bay Watcher
  • [ODOR_LEVEL:999]
    • View Profile
Re: Modding quality of life improvements
« Reply #1 on: January 16, 2016, 05:06:49 am »

Something else that I've been having issues with while modding is mutually exclusive effects for syndromes.

I'd really like it if, like with reactions, there was an identifier one could apply to syndrome effects, so that only one with a <100 PROB chance can be applied.

Having a means to have it "roll" between various effects would be great, but just having it work like a C++ case deal where it "drops" and checks each effect once unless one is applied would be helpful as well. Having a "d6" sort of probability could be emulated in Russian-roulette style (first reaction is 1/6 chance, next is 1/5, up to 1/1), which would allow random results from a syndrome/reaction with equal probability of occurring.

e: This would also be nice for reactions to allow for mutually exclusive random products.
« Last Edit: January 17, 2016, 12:29:26 am by Tiler »
Logged

Tiler

  • Bay Watcher
  • [ODOR_LEVEL:999]
    • View Profile
Re: Modding quality of life improvements
« Reply #2 on: February 11, 2016, 12:58:36 am »

Just a minor thing: it'd be nice if [ITEM_WEAPON] and [ITEM_ARMOR] was changed to a REACTION_CLASS style thing like flux is; I wanted to add a new weapon made in a workshop that isn't the forge, but it'd require adding a reaction for each type of material I'd wanted to use, which is a bother.

The new update perhaps mitigates the necessity of doing that, though. I have not managed to test it out yet.
Logged

El_Stono

  • Bay Watcher
    • View Profile
Re: Modding quality of life improvements
« Reply #3 on: February 12, 2016, 04:02:28 pm »

Some of the additional tokens seem to allow a lot of new ways of creating 'fun', especially workshop syndromes (lead poisoning from smelting too much galena?  :D ). Could you tell us more about the stuff you are trying to achieve?
Logged

Tiler

  • Bay Watcher
  • [ODOR_LEVEL:999]
    • View Profile
Re: Modding quality of life improvements
« Reply #4 on: February 13, 2016, 02:29:54 am »

Some of the additional tokens seem to allow a lot of new ways of creating 'fun', especially workshop syndromes (lead poisoning from smelting too much galena?  :D ). Could you tell us more about the stuff you are trying to achieve?

Oh, this and that. I've been working to create a skaven mod for dwarf fortress (a race of evil rat people from Warhammer Fantasy which dabble in mad science and paranoia), and so there's been a variety of things I've been trying to accomplish to put them in DF while maintaining as much of their racial character as possible.

IT_MUST_HAVE_SYNDROME_CLASS was a token I wanted to have on hand when messing with interaction targeting, specifically self-targeting sorts of interactions. Several weapons the skaven use have a misfire chance that includes nasty things like blowing up, so what I wanted to achieve was a method to have an interaction that triggers a misfire check on the user of the "fire weapon" interaction. My idea was that, on use of the weapon interaction, the target would get a FREE_ACTION interaction directed at the weapon wielder that would apply a syndrome with an x% chance of nasty effects and, if nasty effects are applied, have a follow up interaction that applies an effect randomly. Unfortunately, the current targeting criteria for interactions doesn't really cut it, so there wasn't any means to implement this in vanilla DF. Having this token would enable a bit more of this style of interaction logic trickery.

It would also enable some other things; an interaction that "targets" a foe for a follow up interaction by applying a syndrome that allows an IT_MUST_HAVE_SYNDROME_CLASS interaction to be targeted at them, or an interaction directed specifically against things like werebeasts or vampires. There's probably some other things it'd allow; I've seen others wish for something similar.

ALLY/ENEMY_ONLY and NOT_SELF are just to get the AI to use certain interactions correctly. Interactions that buff one self or ones allies in a fight require a sort of "bounce" currently that's rather unreliable and fickle. NOT_SELF is not actually needed right now, iirc, but I'd like it in just to ensure that intended behavior is maintained in an interaction regardless of future changes in interaction logic, such as if the conflict between various USAGE_HINTS and CDI:TARGET tokens are changed/removed. In addition, the USAGE_HINT:ATTACK is really the only means to make sure an interaction doesn't target non hostiles, but I'd rather that functionality be shifted to a more direct means of defining acceptable targets via ALLY or ENEMY_ONLY, to allow more flexibility in having interactions that are triggered by combat but are not directed against hostiles.

As I mentioned, it'd also allow the creation of interactions that would be able to do IT_* checks on the creature using it. So you could have an interaction that, say, requires the creature using it not have a certain syndrome. Or a dwarf only specific interaction that requires the dwarf to be drunk. Or one that cannot be used if the creature is a vampire. Lots of things you can do with this.

Conflict between USAGE_HINT:ATTACK and SELF_ONLY/SELF_ALLOWED; this conflict is a pain, and is related to the issues I was having with the CDI:TARGET tokens, but it also means that having an interaction that has some sort of self-applied effect in addition to targeting an enemy is difficult to apply. Removing this means one could apply a global cooldown between various interactions much easier (using a interaction also grants a syndrome to the user that conflicts with a IT_CANNOT_HAVE_SYNDROME_CLASS token on said spell, so they can't use it or other interactions for as long as the syndrome persists). Or, a chance to blow up when an interaction is called.

USAGE_HINT:ALWAYS, and NEVER would help clarify a lot of ambiguity about the use of interactions for the AI. Previously, the behavior of the AI was, absent a usage hint, to always use the interaction when applicable. A later version shifted this to having the AI only use those interactions during "duress", aka combat. This change severely crippled several mods that relied on complex interaction/syndrome chains. Being able to specify that an interaction ought to be used whenever its applicable would be very handy to have. NEVER is probably not all that useful, but it'd be nice to have for various sorts of interactions that are meant to be player only. Right now, this can be sort of applied via exploiting the conflict between ATTACK and SELF_ONLY.

SYN_IMMUNE_SYN_CLASS:<SYN_CLASS> can currently be sort of done via SYN_IDENTIFIER, but that also causes problems for various reasons. The applications here for creating things like vaccines for or whatnot should be obvious, but in my case, I'd wanted to have an interaction that caused a creature gaining the interaction to become immune to its own attacks. Skaven Globadiers in particular; these are rat dudes equipped with glass globes full of, basically, nerve gas. I am able to create an interaction using material emissions and some trickery to simulate throwing an explosive gas bomb, but I'd wanted to avoid having globidiers kill themselves as much while ensuring skaven in general could be killed by the gas.

CE_REMOVE_SYNDROME:<SYN_CLASS> would be hugely useful for interaction targeting. Of course, it obviously would be a great means to put in antidotes, curse removal, ending transformations, one-shot spells, or what have you, but for me, I really wanted it to aid in creating more complex interaction scripts. For instance, it would allow each use of an interaction to grant a syndrome that blocks further use of the interaction until another interaction is used to "clear" it, making the misfire check idea very easy to implement.

Workshops/reactions gaining a SYNDROME token; I think every single person whose done in depth modding to DF would drop to their knees and scream for joy if this was put into vanilla DF. Right now, the only means to doing this are spawning a boulder that turns syndrome applying mist, which only has around a 20% shot of actually working and is a huge pain to deal with. In my case, this would allow the use of "equipping" a reaction reagent to allow the use of an interaction, to simulate the use of special weapons. People also try to use workshops to apply a CE_BODY_TRANSFORM effect, there's really so much you could do with this that I could list a billion insane things without limit. It'd also just be great for triggering a specific interaction; having someone ring a bell, for instance, that grants them a syndrome with an interaction that they would use instantly that does something.
« Last Edit: February 13, 2016, 02:35:52 am by Tiler »
Logged

El_Stono

  • Bay Watcher
    • View Profile
Re: Modding quality of life improvements
« Reply #5 on: February 14, 2016, 04:36:50 pm »

Quote
Oh, this and that. I've been working to create a skaven mod for dwarf fortress
Quote
having someone ring a bell, for instance,

Oh, you mean a Screaming bell with a Grey Seer on top? I know Skaven and Warhammer in general pretty well, because I am playing Vampire Counts for 15 years now 8)
But back to dwarf fortress: I see no reason why some or all of these features shouldn't be implemened, I guess the only problem is time  :-\

But the possiblities sound so awesome. Just looking at your examples makes that clear: fighters using advanced and risky weapons, usage of poison gas, ways buffing your soldiers, etc.
« Last Edit: February 14, 2016, 04:39:22 pm by El_Stono »
Logged

Tiler

  • Bay Watcher
  • [ODOR_LEVEL:999]
    • View Profile
Re: Modding quality of life improvements
« Reply #6 on: February 18, 2016, 12:59:27 am »

I tried to suggest things that I felt wouldn't be that difficult to implement (some of those run off the same logic as prior tokens but simply switch something like (self.foo) to (!self.foo), but my experience with coding is pretty limited so I could be way off on that.
Logged