Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: USE_MATERIAL  (Read 1643 times)

Igfig

  • Bay Watcher
    • View Profile
USE_MATERIAL
« on: May 11, 2010, 09:38:01 pm »

Has anybody been able to get the USE_MATERIAL tag to work?  Theoretically, it should let us take any material and assign it to a creature; in practice, it doesn't do anything at all as far as I can tell.

For instance, I want a dwarf that drops a "dwarf iron" statue on death.  I could define a new inorganic material called "dwarf iron", but it would be much more succinct to just put [USE_MATERIAL:IRON:INORGANIC:IRON] in the dwarf's raws, especially if I plan to do it for other creatures.

There is a compromise, though: make a material template called IRON_TEMPLATE with the same properties as iron.  Then we can just use a standard USE_MATERIAL_TEMPLATE tag...  but still, we shouldn't have to.

So.  USE_MATERIAL.

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: USE_MATERIAL
« Reply #1 on: May 11, 2010, 10:22:46 pm »

It is GET_MATERIAL_FROM_REAGENT.
Nevermind, I've lost my mind because I haven't slept the whole night.

1 moment let me give you the correct answer.

[EDIT]
So, here's the full answer.

Creatures no longer consist of "single material". Creatures now consist of tissues which are made of materials.

1) To add a completely new template with assigned material you need to do the following steps.

You want to add:

Code: [Select]
[USE_MATERIAL_TEMPLATE:MYMATERIAL:MYMATERIAL_TEMPLATE]
[USE_TISSUE_TEMPLATE:MYTISSUE:MYTISSUE_TEMPLATE]

and then make those templates.

After that you should add:
Code: [Select]
[TISSUE_LAYER:BY_CATEGORY:TOOTH:MYTISSUE]
if you want to make teeth to be made out of it.

2) If you want to make the body to use some existing materials without adding new templates (which is the answer to your original question) you add:

Code: [Select]
[TISSUE:IRON]
[TISSUE_NAME:iron:NP]
[TISSUE_MATERIAL:INORGANIC:IRON]
[MUSCULAR]
[FUNCTIONAL]
[STRUCTURAL]
[RELATIVE_THICKNESS:1]
[CONNECTS]
[TISSUE_SHAPE:LAYER]

And then you assign this tissue to everything:
Code: [Select]
[TISSUE_LAYER:BY_CATEGORY:ALL:IRON]
Note that if you want only parts of creature to be iron, replace ALL with correct category and repeat if you apply it to multiple categories (i.e. to horns and nails).
« Last Edit: May 11, 2010, 10:32:57 pm by Deon »
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Igfig

  • Bay Watcher
    • View Profile
Re: USE_MATERIAL
« Reply #2 on: May 11, 2010, 11:45:59 pm »

Thanks, but that's all stuff I already know.

I don't want to make a dwarf out of metal.  I want to have a metal that belongs to the DWARF matgloss instead of INORGANIC.

I've made plenty of creatures with iron tissues; however, the material of the tissue is still inorganic iron.  The question is about making organic iron.  Or, more specifically, whether the USE_MATERIAL tag does anything at all.

derigo

  • Bay Watcher
    • View Profile
Re: USE_MATERIAL
« Reply #3 on: May 12, 2010, 01:18:43 am »

Aside from the fact that  'Organic Iron' is a contradiction in terms, I see what you're getting at.  Toady doesn't use the [USE_MATERIAL] token anywhere in the raws, so I have no examples to give you, it may be a deprecated token for all I know.  What you want to do, however, is easy.  You can define a material template in the raws as you stated, but instead of calling it "Dwarf Iron" you call it "creature iron."

Then, in the dwarf (or other creature) you can alter properties of the material (including the name of the material) on the fly to suit the specific creature you're making, without changing the rest of the properties.  If the material is very simple, you can just define it on the fly in the creature raw.

For working examples of the first way, look at how milk works in any milkable creature.
Quote
      [USE_MATERIAL_TEMPLATE:MILK:MILK_TEMPLATE]
         [STATE_NAME:ALL_SOLID:frozen donkey's milk]
         [STATE_ADJ:ALL_SOLID:frozen donkey's milk]
         [STATE_NAME:LIQUID:donkey's milk]
         [STATE_ADJ:LIQUID:donkey's milk]
         [STATE_NAME:GAS:boiling donkey's milk]
         [STATE_ADJ:GAS:boiling donkey's milk]
         [PREFIX:NONE]


For working examples of the second way look at this excerpt from the vanilla ELEMENTMAN_GABBRO
Quote
   [TISSUE:ROCK]
      [TISSUE_NAME:gabbro:NP]
      [TISSUE_MATERIAL:INORGANIC:GABBRO]
      [MUSCULAR]
      [FUNCTIONAL]
      [STRUCTURAL]
      [RELATIVE_THICKNESS:1]
      [CONNECTS]
      [TISSUE_SHAPE:LAYER]
   [TISSUE_LAYER:BY_CATEGORY:ALL:ROCK]

In the first example, the material template MILK is already present in the raws.  By using the template, toady takes all the properties of the material from the template, and then changes the name of the material to suit the creature in question.  In the second example, there is no material or tissue named ROCK with the properties of Gabbro present in the raws, so he makes a very simple one up on the fly (and copies the properties of gabbro using the [TISSUE_MATERIAL:INORGANIC:GABBRO] token) to suit his purposes.  He could have easily changed the name to "Gabbro-Man Gabbro."

It should also be noted that there is also a [USE_TISSUE] token, which is also not used anywhere in the raws.  I suspect you haven't been able to get the [USE_MATERIAL] token to work because you're trying to use it to define tissues, when its meant to be used to define non-tissues, like creature extracts.  But I have no idea what the proper syntax should be, as there are no examples in the raws.
« Last Edit: May 12, 2010, 01:34:16 am by derigo »
Logged

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: USE_MATERIAL
« Reply #4 on: May 12, 2010, 03:23:45 am »

Oh sorry Igfig, I misread your intentions :). I will try to experiment with USE_MATERIAL, I haven't tried it at all. Is it from EXE scoping?
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Igfig

  • Bay Watcher
    • View Profile
Re: USE_MATERIAL
« Reply #5 on: May 12, 2010, 09:26:26 am »

You can define a material template in the raws as you stated, but instead of calling it "Dwarf Iron" you call it "creature iron."

Then, in the dwarf (or other creature) you can alter properties of the material (including the name of the material) on the fly to suit the specific creature you're making, without changing the rest of the properties.  If the material is very simple, you can just define it on the fly in the creature raw.
Right, that's the compromise I suggested in my first post.

I suspect you haven't been able to get the [USE_MATERIAL] token to work because you're trying to use it to define tissues, when its meant to be used to define non-tissues, like creature extracts.  But I have no idea what the proper syntax should be, as there are no examples in the raws.
No, dude, you've got it exactly backwards.  If I wanted to define tissues, it would be easy, as Deon described.

Oh sorry Igfig, I misread your intentions :). I will try to experiment with USE_MATERIAL, I haven't tried it at all. Is it from EXE scoping?
That's okay.  But yeah, I'm pretty experienced with the modding; if I'm asking a question, it's probably something complicated.  And yes, USE_MATERIAL is just a thing I found in the string dump.

derigo

  • Bay Watcher
    • View Profile
Re: USE_MATERIAL
« Reply #6 on: May 12, 2010, 10:41:17 am »

Its also on the wiki, right next to [USE_TISSUE] on the creature tokens page.  And they don't know what those tokens are for either. 

I assume your playing around with the ITEMCORPSE token.  I've never messed around with corpses dropping statues and whatnot. The wiki does seem fairly out of date on the subject.  What have you found out about it so far?
Logged

Igfig

  • Bay Watcher
    • View Profile
Re: USE_MATERIAL
« Reply #7 on: May 14, 2010, 03:06:24 pm »

ITEMCORPSE is pretty straightforward in its usage--you just specify the item and material, and it makes it.

My experiments with USE_MATERIAL haven't borne much in the way of fruit so far.  If you try to use it, the game will automatically substitute the first material on that creature's list.  Dwarves dropped dwarf skin statues; alligators, which have no skin (they use scales instead) drop alligator fat statues.

If you leave the USE_MATERIAL tag out completely, you get the same result. It's definitely a valid token, though, or the errorlog would have complained.

Thinking I might have used the wrong syntax, I tried USE_MATERIAL:LOCAL_CREATURE_MAT:IRON:INORGANIC:IRON, USE_MATERIAL:INORGANIC:IRON and USE_MATERIAL:IRON as well as USE_MATERIAL:IRON:INORGANIC:IRON.  I also tried replacing INORGANIC with METAL.  None of those made any difference.

I suppose it's possible that the tag was put into the game without a function, and that Toady is intending to do something with it later... but that seems especially strange to me.

Just out of curiosity, is there any difference between the INORGANIC and METAL matglosses?

derigo

  • Bay Watcher
    • View Profile
Re: USE_MATERIAL
« Reply #8 on: May 14, 2010, 03:23:33 pm »

Mmm, fat statues.  Great fun at parties.

That is how it would behave if you were using the wrong syntax, yes.  It's also how it would behave if the token had no function.  It essentially the same 'unknown syntax' problem we're having trying to create body parts, bones, shells, etc through reactions.  We know what tokens to use, but either the syntax is completely different than it is for other reaction products, or the functionality hasn't been implemented yet.  Don't dismiss that possibility!  There are lots of things in the game that are totally unfinished.  It could even be a token toady created and then decided not to use, in favor of the other tissue/material applying tokens that he came up with later, and just never removed the token.

Quote
Thinking I might have used the wrong syntax, I tried USE_MATERIAL:LOCAL_CREATURE_MAT:IRON:INORGANIC:IRON, USE_MATERIAL:INORGANIC:IRON and USE_MATERIAL:IRON as well as USE_MATERIAL:IRON:INORGANIC:IRON.  I also tried replacing INORGANIC with METAL.  None of those made any difference
 
The original syntax you tried was more like USE_MATERIAL:IRON  ?

In my, admittedly limited, experience with reactions, I haven't noticed any difference between those 2 matglosses.  Matglosses are very very unspecific tokens, they give a very limited amount of information.  Color, sometimes icon, maybe some physical properties like melting point, etc.  Ie Gloss ;p 

The INORGANIC token references the information through inorganic_metal.txt.  Whereas the METAL token seems to be a hardcoded definition that's able to access any material with the IS_METAL token in its material definition(ie all metals). 
Logged

Knight Otu

  • Bay Watcher
  • ☺4[
    • View Profile
Re: USE_MATERIAL
« Reply #9 on: May 14, 2010, 03:28:14 pm »

Just out of curiosity, is there any difference between the INORGANIC and METAL matglosses?

I have no idea whether there is a difference, or if METAL is a holdover (maybe for easier transition of reactions?). At least the currency tag in the entity raws accepts every inorganic material, whether gem or sand. Actually, it may exist for reactions that use undetermined metals, but can't use stone?
Logged
Direforged Original
Random Raw Scripts - Randomly generated Beasts , Vermin, Hags, Vampires, and Civilizations
Castle Otu

Grimlocke

  • Bay Watcher
  • *kobold noises*
    • View Profile
Re: USE_MATERIAL
« Reply #10 on: May 14, 2010, 03:40:20 pm »

The METAL matgloss seems like a piece of backwards compatibility. Havnt noticed any differences between it and INORGANIC.

As for the USE_MATERIAL and USE_TISSUE tags, I realy wouldnt know what those do. They arnt used in the stock raws, and if USE_MATERIAL:INORGANIC:IRON didnt work then it might be that they dont fulfill any roll at all now. Have you tried using organic materials yet? like, USE_MATERIAL:CREATURE_MAT:CAT:MEAT. Well that might be incorrect as I just wrote that off the top of my head.

And some useless knowledge: ITEMCORPSE:CORPSE:etc... doesnt do anything. Even when using silly materials like iron or booze.
Logged
I make Grimlocke's History & Realism Mods. Its got poleaxes, sturdy joints and bloomeries. Now compatible with DF Revised!

derigo

  • Bay Watcher
    • View Profile
Re: USE_MATERIAL
« Reply #11 on: May 14, 2010, 05:12:26 pm »

CORPSE is one of the item class tokens that the engine recognizes (it doesn't throw an error in the log), but that either doesn't work, or we haven't figured out the syntax for it.  Another just like it is CORPSEPIECE.
Logged