Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Poll

Is adding moddability to DF an important design step?

Yes
No

Author Topic: Minor Modding Expansions (Item_Reaction_Class)  (Read 946 times)

Avelon

  • Bay Watcher
  • [ETHIC:INDULGE_IN_MYSTICISM:UNTHINKABLE]
    • View Profile
Minor Modding Expansions (Item_Reaction_Class)
« on: February 07, 2013, 08:19:39 pm »

Feel free to add small modding-related ideas to this thread.

Original concept:
Spoiler (click to show/hide)

Refined concept:

1.) Simply put, the addition of ITEM_REACTION_CLASS with companion modifiers HAS_ITEM_CLASS and HAS_NOT_ITEM_CLASS.

[ITEM_REACTION_CLASS:X] is added to any object of type item (everything you can put into your inventory) and can be defined as anything. In reactions, the two modifiers can be used to include or disallow items sharing a reaction class. As an example:

Code: [Select]
[REACTION:SMELT_METAL_ITEM_AVE]
[NAME:Melt metal item]
[REAGENT:A:1:NONE:NONE:NONE:NONE][REACTION_CLASS:METAL][HAS_NOT_ITEM_CLASS:INGOT]
[REAGENT:D:1:TOOL:ITEM_TOOL_SMELTER_AVE:NONE:NONE][PRESERVE_REAGENT]
[PRODUCT:100:1:TOOL:ITEM_TOOL_INGOT_AVE:GET_MATERIAL_FROM_REAGENT:A:NONE]
[PRODUCT:100:1:TOOL:ITEM_TOOL_INGOT_AVE:GET_MATERIAL_FROM_REAGENT:A:NONE]
[SKILL:SMELT]
[ADVENTURE_MODE_ENABLED]

The item entry:
[ITEM_TOOL:ITEM_TOOL_INGOT_AVE]
[NAME:ingot:ingots]
[VALUE:10]
[SIZE:200]
[TILE:'=']
[MATERIAL_SIZE:1]
[HARD_MAT]
[ITEM_REACTION_CLASS:INGOT]

This reaction will not show ingots in the crafting menu when melting down metal items although they ARE metal items. This allows 1 reaction to do what normally would take 13 (12 if you don't include the item type that INGOT belongs to, in this case tools) reactions.

------------------

2.) Expand 'DIMENSION' to encompass all items, taking over SIZE/WEIGHT where applicable (these could be analogous terms as they already are for one another). Reactions can interact with DIMENSION but not SIZE/WEIGHT as things currently are. Going again by the above example of my own script (yes I have an ulterior motive here), were it possible to endow, say, tools with DIMENSION:50 or something, that script could then demand a reagent have MIN_DIMENSION:100 and disallow the ingot from melting into 2 of itself that way.

------------------

3.) Variable output for PRODUCTs: MATERIAL_SIZE of reagent or DIMENSION (if above is implemented) can affect PRODUCTs like so:

Code: [Select]
[PRODUCT:100:1:TOOL:ITEM_TOOL_INGOT_AVE:INORGANIC:STEEL][INPUT_REAGENT_SIZE:A:50]INPUT_MAT_SIZE means that for each time REAGENT:A matches the input size of '50' it produces 1. So if you use, say, a war hammer (SIZE of 400), you would get 8 steel ingots. Or if you use material size (3), the output could look like this:

Code: [Select]
[PRODUCT:100:1:TOOL:ITEM_TOOL_INGOT_AVE:INORGANIC:STEEL][USE_MATERIAL_SIZE:1]That is, use material size / 1, in this case giving you 3. USE_MATERIAL_SIZE:2 would give you just 1, but if you were using a Battle Axe (MS 4), USE_MATERIAL_SIZE:2 would give you 2.
« Last Edit: February 07, 2013, 09:25:30 pm by Avelon »
Logged
Is God willing to prevent evil, but not able? Then he is not omnipotent.
Is he able, but not willing? Then he is malevolent.
Is he both able, and willing? Then whence cometh evil?
Is he neither able nor willing? Then why call him God? - Epicurus

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Minor Modding Expansion - Tokens
« Reply #1 on: February 07, 2013, 08:40:33 pm »

Tokens already refer to all of the whosits in the raws, so it should have a better name.

Maybe something like an [ITEM_REACTION_CLASS:X], to keep it consistent.

Avelon

  • Bay Watcher
  • [ETHIC:INDULGE_IN_MYSTICISM:UNTHINKABLE]
    • View Profile
Re: Minor Modding Expansion - Tokens
« Reply #2 on: February 07, 2013, 08:49:16 pm »

ITEM_REACTION_CLASS would be specific to objects of 'item' types and thus not eligible for entities or creatures - rather, Toady can name it FARGLEBYTES_PIECE_OF_EIGHT if he wants to but it would be confusing to have ITEM_REACTION_CLASS:HUMANOID in your entities file, for instance.

How about 'grouping' or 'class'? We have 'castes', but grouping is self-explanatory and 'class' is universal in object definitions.

Also added 2 more related minor suggestions, would you be so kind as to give feedback on those also?

EDIT: And I realize ITEM_REACTION_CLASS has class right in it but I mean more like 'CUSTOM_CLASS'. GROUPING could run solo.
« Last Edit: February 07, 2013, 08:51:21 pm by Avelon »
Logged
Is God willing to prevent evil, but not able? Then he is not omnipotent.
Is he able, but not willing? Then he is malevolent.
Is he both able, and willing? Then whence cometh evil?
Is he neither able nor willing? Then why call him God? - Epicurus

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Minor Modding Expansion - Tokens
« Reply #3 on: February 07, 2013, 08:51:08 pm »

Not sure why you would put entities in this? Since we already have reaction classes for reactions, creature classes for creatures and syndrome classes for syndromes, it stands to reason that we would have item (reaction) classes for items etc.

Avelon

  • Bay Watcher
  • [ETHIC:INDULGE_IN_MYSTICISM:UNTHINKABLE]
    • View Profile
Re: Minor Modding Expansion - Tokens
« Reply #4 on: February 07, 2013, 09:05:42 pm »

Those could be assimilated into the wider grouping to make the RAW files more modular I guess, but CREATURE_CLASS isn't the same thing as the proposed 'freeform custom tag you can put on anything', particularly since it's only used for GENERAL_POISON.

To be honest, as it stands, there is no REASON to add the entity, creature, or syndrome arguments, as there is nothing that can be done with them via reactions anyway (that I know of?). But the classes you mentioned don't do what this would do, and adding them now as opposed to later would make future developments in that direction easier.

I guess item_reaction_class would work for a current implementation since reactions can't react with the environment other than using things on the same tile. Maybe when we can cut trees down and dig.

I do still like the idea of having groupings for anything that you can define with more universality however.
Logged
Is God willing to prevent evil, but not able? Then he is not omnipotent.
Is he able, but not willing? Then he is malevolent.
Is he both able, and willing? Then whence cometh evil?
Is he neither able nor willing? Then why call him God? - Epicurus

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Minor Modding Expansion - Tokens
« Reply #5 on: February 07, 2013, 09:08:58 pm »

 
Those could be assimilated into the wider grouping to make the RAW files more modular I guess, but CREATURE_CLASS isn't the same thing as the proposed 'freeform custom tag you can put on anything', particularly since it's only used for GENERAL_POISON.


Yes it is. You can define anything under CREATURE_CLASS and use that in syndromes. For example, in my DBZ mod, I have [CREATURE_CLASS:NATURAL_KI], which disallows saiyans, namekians and frieza goons from learning anything from the turtle or crane schools.

Avelon

  • Bay Watcher
  • [ETHIC:INDULGE_IN_MYSTICISM:UNTHINKABLE]
    • View Profile
Re: Minor Modding Expansion - Tokens
« Reply #6 on: February 07, 2013, 09:16:37 pm »

In that case I stand corrected. There isn't anything like that for entities though, is there? Eventually world gen will be sophisticated enough that such a thing might come in handy - and it certainly will through the coming stages before it gains the level of sophistication that would render such a tag obsolete.

The main core of the idea though, that it should be available for items, remains. I'll update the first post to reflect your input - thanks!
Logged
Is God willing to prevent evil, but not able? Then he is not omnipotent.
Is he able, but not willing? Then he is malevolent.
Is he both able, and willing? Then whence cometh evil?
Is he neither able nor willing? Then why call him God? - Epicurus

WillowLuman

  • Bay Watcher
  • They/Them Life is weird
    • View Profile
Re: Minor Modding Expansion - Tokens
« Reply #7 on: February 07, 2013, 09:19:08 pm »

Also, probably change tokens to classes in thread title.
Logged
Dwarf Souls: Prepare to Mine
Keep Me Safe - A Girl and Her Computer (Illustrated Game)
Darkest Garden - Illustrated game. - What mysteries lie in the abandoned dark?

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Minor Modding Expansion - Tokens
« Reply #8 on: February 07, 2013, 09:24:18 pm »

I'd say that an arbitrary class for entities would be useful for, say, ALWAYS_WAR:(class) or something like that.

Avelon

  • Bay Watcher
  • [ETHIC:INDULGE_IN_MYSTICISM:UNTHINKABLE]
    • View Profile
Re: Minor Modding Expansions (Item_Reaction_Class)
« Reply #9 on: February 07, 2013, 09:32:29 pm »

Done and done, and yes! That's exactly what I was thinking for entity classes.

ALWAYS_WAR:X
ALWAYS_PEACE:X
COEXIST:X (shares settlements and considers one another to be the same civ when deciding where to go while moving to another town or searching for a mate; this already happens sometimes as I have had a Draconian city with dwarves, humans, goblins, and draconians coexisting)

And such.
Logged
Is God willing to prevent evil, but not able? Then he is not omnipotent.
Is he able, but not willing? Then he is malevolent.
Is he both able, and willing? Then whence cometh evil?
Is he neither able nor willing? Then why call him God? - Epicurus