Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: Can I make a reaction that take anything except metal?  (Read 3157 times)

FluxX

  • Bay Watcher
    • View Profile
Can I make a reaction that take anything except metal?
« on: October 08, 2012, 10:59:53 am »

As the title asks, can I make a reaction that forbids metal or rocks? I want to make a reaction that can take nearly any item and output a craft. Like a recycling or reusing. But I don't want it to be able to become OP and be used to turn a metal coin into an entire metal door or armor set. For now, I'd like to just forbid metal and rocks/ore from the reaction. But I can't see a way to do it.

The other option is making 5 or 6 different reactions, each taking "bone", "leather" etc. But I want to simplify my list of reactions down to just 1 for non metal crafts and 1 for metal crafts. Is it possible?

I've tried

Code: [Select]
[REAGENT:B:1:ANY:NONE:NONE:NONE:NONE][NO_EDGE_ALLOWED][NOT_IMPROVED]To forbid some weapons from the reaction. But I'm guessing it's not possible to have "[NOT_METAL]", is it?

Hmmm. Can I set all the items I want excluded from the reaction with the tags [web] in their RAWS then use the modifier [NOT_WEB] to exclude them?
« Last Edit: October 08, 2012, 11:32:45 am by FluxX »
Logged

Sorcerer

  • Bay Watcher
  • [magical]
    • View Profile
Re: Can I make a reaction that take anything except metal?
« Reply #1 on: October 08, 2012, 11:52:28 am »

One way is to add a [REACTION_CLASS:RECYCLE] to the template files, you can then specify to only allow reagents of that class.
Logged

smakemupagus

  • Bay Watcher
  • [CANOPENDOORS]
    • View Profile
Re: Can I make a reaction that take anything except metal?
« Reply #2 on: October 08, 2012, 01:41:54 pm »

In general the list of tokens on the wiki can be thought of as exhaustive, and if you try to guess a new token, it doesn't work.

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: Can I make a reaction that take anything except metal?
« Reply #3 on: October 08, 2012, 02:04:03 pm »

Hmmm. Can I set all the items I want excluded from the reaction with the tags [web] in their RAWS then use the modifier [NOT_WEB] to exclude them?
[NOT_WEB] is only used to distinguish silk webs from silk thread.
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Can I make a reaction that take anything except metal?
« Reply #4 on: October 08, 2012, 07:01:08 pm »

In general the list of tokens on the wiki can be thought of as exhaustive, and if you try to guess a new token, it doesn't work.

Not "in general"--our local code gurus have every single token and string in the game dumped onto the wiki for every version, and our local modders tend to test out any new token as soon as possible. We know exactly what we can and can't do with the raws, you know :P

smakemupagus

  • Bay Watcher
  • [CANOPENDOORS]
    • View Profile
Re: Can I make a reaction that take anything except metal?
« Reply #5 on: October 08, 2012, 07:06:12 pm »

Right, well, that's pretty much what I meant.  I didn't want to assume that you guys update and test everything literally instantaneously ;)

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Can I make a reaction that take anything except metal?
« Reply #6 on: October 08, 2012, 07:08:24 pm »

Haha, it's been a while since 34.11, so there's plenty we know.

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: Can I make a reaction that take anything except metal?
« Reply #7 on: October 09, 2012, 12:37:08 pm »

our local code gurus have every single token and string in the game dumped onto the wiki for every version
We don't actually use the string dump because it's actually quite useless for determining the context in which a token can be used - for example, AT_PEACE_WITH_WILDLIFE only appears once in the string dump, but it can be used in two completely different contexts (namely, as a creature token to make cats ignore wild animals and as an entity token to make members of Elven civilizations ignore wild animals). What we actually do is disassemble the program (often using IDA Pro or similar tools) or open it in a debugger (such as Cheat Engine) and then trace through the code responsible for parsing certain types of raws.

For creature and material raws, this is fairly simple, but for stuff like item definitions, custom reactions, syndromes, and interactions, this gets much more complicated because each different type (e.g. weapon/armor/shield, reagent/product/improvement, display_name/flash_tile/skill_roll_adjust, and each interaction source/target/effect) has its own code for parsing its raws (e.g. armor has UBSTEP+LBSTEP, pants have LBSTEP, and gloves/shoes/shields have UPSTEP; IS_NAME can be used with any I_SOURCE type, but IS_USAGE_HINT can only be used with I_SOURCE:DEITY).
« Last Edit: October 09, 2012, 12:44:39 pm by Quietust »
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Can I make a reaction that take anything except metal?
« Reply #8 on: October 09, 2012, 06:56:04 pm »

Yes, but the important part isn't exactly the string dump, but the amount of time we've had to sift through all the random bullshit the string dump throws out--every update, there's some new stuff that is either found or explained by Toady handily. Anything that isn't is promptly tested. Personally, I use the string dump for some things that have little-to-no other documentation on the wiki, such as data/speech files and the "weird text files" (fortressintro and its ilk).

FluxX

  • Bay Watcher
    • View Profile
Re: Can I make a reaction that take anything except metal?
« Reply #9 on: October 10, 2012, 03:21:07 pm »

One way is to add a [REACTION_CLASS:RECYCLE] to the template files, you can then specify to only allow reagents of that class.
Oh, thanks. Um, I'm a total noob at this. I've figured out how to change items, numbers etc. So can make a reaction to make something. How would I change the template files, and then what do I need to specify?

If this works I'll post up a mini mod for others to test out. :)

Basically I want to narrow down the reactions (for now) to 3. Something like "make cloths" and accept only bone/cloth/leather. "make armor" and accept only bone/leather" and "make metal armor" and only accept metal. This will shorten the amount of reactions listed from about 15 to 3. After that, I can start adding other types of reaction in their place hopefully. :)

So far. I can allow "any", but that means I either get cheese socks, or exploitable metal mittens. :/

If I use "any_bone" it limits it to bone. Whereas I want to add bone, as an example. :(
« Last Edit: October 10, 2012, 03:32:08 pm by FluxX »
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Can I make a reaction that take anything except metal?
« Reply #10 on: October 10, 2012, 06:20:55 pm »

Change the template files by editing the template files and adding [REACTION_CLASS:RECYCLE] to he templates.

FluxX

  • Bay Watcher
    • View Profile
Re: Can I make a reaction that take anything except metal?
« Reply #11 on: October 11, 2012, 03:29:29 pm »

But does that not just make the item made have the same material? I do want the same material but I also want it to refuse metal though. :/
« Last Edit: October 11, 2012, 03:51:48 pm by FluxX »
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Can I make a reaction that take anything except metal?
« Reply #12 on: October 11, 2012, 05:12:32 pm »

You can always have it be the same material by just having the material be GET_MATERIAL_FROM_REAGENT:reagent:NONE.

FluxX

  • Bay Watcher
    • View Profile
Re: Can I make a reaction that take anything except metal?
« Reply #13 on: October 12, 2012, 06:48:37 am »

I want that AND to forbid metal.
I want to streamline a couple of reactions to make the list of reactions shorter. So, I want 1 reaction to be "take any non-metal, make an item out of it".
Currently, if I do this, the craft shop would be able to make bone, thread and wood items really easy. But then be OP because it can also make metal items without a smelter. :(
So, I want to have 2 reactions 1 for everything except metal, and one for only metal. Well, I can do the "only metal" bit easy. It's the "don't let anyone use metal" bit I can't force to work :(
Logged

i2amroy

  • Bay Watcher
  • Cats, ruling the world one dwarf at a time
    • View Profile
Re: Can I make a reaction that take anything except metal?
« Reply #14 on: October 12, 2012, 11:13:19 am »

So do as Putnam suggested. Add [REACTION_CLASS:NOT_METAL] (or something similarly named) to every single template that you want to be able to recycle that isn't the metal one. Then just make your reaction use GET_MATERIAL_FROM_REAGENT:reagent:NONE as well as having [REACTION_CLASS:NOT_METAL] on the reagent that you want to accept anything.

But does that not just make the item made have the same material? I do want the same material but I also want it to refuse metal though. :/
All [REACTION_CLASS:XXXX] is is a label used for separating out permissible reactants from ones that are not. It has absolutely no effect on what the reagent is made out of or what the products are. I believe you are thinking of [MATERIAL_REACTION_PRODUCT:XXXX:XXXX] which can be used to determine products.
Logged
Quote from: PTTG
It would be brutally difficult and probably won't work. In other words, it's absolutely dwarven!
Cataclysm: Dark Days Ahead - A fun zombie survival rougelike that I'm dev-ing for.
Pages: [1] 2