Bay 12 Games Forum

Please login or register.

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

Author Topic: Modding Glass (You know it was bound to come up).  (Read 4992 times)

Pickerel

  • Bay Watcher
    • View Profile
Modding Glass (You know it was bound to come up).
« on: March 15, 2011, 10:29:43 pm »

In previous versions, I had to do all sorts of modding to get an essentially glass-equivalence with a variety of reactions, inorganics, metals, ect.  I wanted colored glass of all sorts.  And I still love glass.  MAN I can't wait until glasses are no longer hard coded... anyway...

I just looked at the wiki, and it says that, due to 'memory hacking', the properties of green glass are now known.  Likewise, they say they conveniently place it in inorganic raws format.

My questions, and I hope I ask these explicitely enough, are as follows:
Looking at the glass raws from the wiki: Are those accurate enough that one could copy and paste them, change the colors and names, and get them to work as glass?  Does one require the [IS_GLASS] token in the material definition raws?  Of course it does not seem to have anything in the way of defining how to produce the stuff, so the actual items to be made would still need to be made with a long string of reactions, but, were I to do the above, would items created via reactions in this way actually BE glass, for all intensive purposes?

Has anyone looked into this?  I tried a search but it was not as fruitful as one might hope...


P.S. While I am at it, is there a way to make the number of a particular product produced in a reaction depend on the skill of the user?
« Last Edit: March 15, 2011, 10:46:15 pm by Pickerel »
Logged

Jay

  • Bay Watcher
  • ☼Not Dead Yet☼
    • View Profile
Re: Modding Glass (You know it was bound to come up).
« Reply #1 on: March 15, 2011, 11:08:27 pm »

As far as "being" glass, glass is just another inorganic.  There's really no difference, other than how it's made, which happens to be the hardcoded part that you're fretting about.
I think you can target sand bags in reactions (generic powder bags, at least), though, so actual custom glass isn't too far out, though you won't be able to make it at the glass furnace and you won't get the fancy menus.  (I hope Toady implements reaction menus soon-ish...)

P.S.  No.
Logged
Mishimanriz: Histories of Pegasi and Dictionaries

Pickerel

  • Bay Watcher
    • View Profile
Re: Modding Glass (You know it was bound to come up).
« Reply #2 on: March 15, 2011, 11:31:13 pm »

That brings me to another question I had, for which I was milling about the wiki and searching the forum.  Is it still not possible to make reactions at buildings that don't already have demonstrations in the raws?  Nowhere can I seem to find info on building names for reaction mods.  For example, I am trying to find the name of the jeweler's shop.  Is there somewhere where someone has figured out what the shop is called, so that reactions can be place in it?  Likewise, is this inability why you say the reaction won't be at the glass shop?
Logged

Jay

  • Bay Watcher
  • ☼Not Dead Yet☼
    • View Profile
Re: Modding Glass (You know it was bound to come up).
« Reply #3 on: March 15, 2011, 11:44:17 pm »

Only a few places allow custom reactions, and yes, they're the ones where he's already set up reactions at.
It's easy enough to tell, because only raw-sourced reactions are red/unavailable when you lack materials.
I'm not sure whether he just adds them to the array as he finds uses for them himself, whether he's already working on refactoring everything to be reactions (which would be pretty neat), or whatever else, though.

You could just create a custom "glass furnace" to handle your colored glasses, mind.
Logged
Mishimanriz: Histories of Pegasi and Dictionaries

Pickerel

  • Bay Watcher
    • View Profile
Re: Modding Glass (You know it was bound to come up).
« Reply #4 on: March 16, 2011, 10:35:51 am »

True... Or maybe something else but with a different concept.  Maybe these colored glasses would be 'alchemical' or so?  Anyway, thanks much!  You are wonderfully helpful and informative!

But more questions:
One way I can see to do this is to use glass items and simply 'convert' them to another type.  This would allow one to not require many reactions for the plethora of items made with glass, but a single one capable of dealing with all items of similar type.  I know we can specify to gt the MATERIAL from the reagent, but can we specify getting the TOKEN from the reagent?  I looked at the glazing raws, and this is what I think might work, or something similar (and with some trial and error to get bugs out):

[REACTION:CONVERT_GLASS_RED]
   [NAME:color green glass item red]
   [BUILDING:KILN:CUSTOM_SHIFT_R]
   [REAGENT:colorant:1:BAR:NONE:NONE:NONE]
      [PRESERVE_REAGENT]
      [REACTION_CLASS:RED_GOLD_COLORANT]
   [REAGENT:item:1:NONE:NONE:GLASS_GREEN:NONE]
      [EMPTY]
      [NOT_IMPROVED]
   [PRODUCT:100:1:item:NONE:INORGANIC:GLASS_GOLD]
   [FUEL]
   [SKILL:GLASSMAKING]

Off to test it!
« Last Edit: March 16, 2011, 11:47:18 am by Pickerel »
Logged

Grimlocke

  • Bay Watcher
  • *kobold noises*
    • View Profile
Re: Modding Glass (You know it was bound to come up).
« Reply #5 on: March 16, 2011, 11:54:03 am »

Another glass mod I saw on here made glass items from raw glass, which seems like the most efficient method to use here. You can produce raw colored glass from sand and coloring materials of your choice, then turn said raw glass into windows and whatnot. The convenient part is that by adding a row workshops orders you can be certain your dwarf allways grabs the right color of glass. This way you will need one reaction for each color of glass you want, and one for each item type, which isnt too messy if it has its own workshop.

Also you cant use item tokens the same way you can carry material token from reagent to product, if thats what you meant. You can decorate them, or put something in them, but in either case it keeps whatever base material it had.

IS_GLASS is a valid token, though it does not seem to do anything. It does not show up in stockpile menus or the glass furnace.

EDIT: perhaps IS_GLASS responds to the GLASS_MATERIAL reagent token?
« Last Edit: March 16, 2011, 11:56:11 am by Grimlocke »
Logged
I make Grimlocke's History & Realism Mods. Its got poleaxes, sturdy joints and bloomeries. Now compatible with DF Revised!

Jeoshua

  • Bay Watcher
  • God help me, I think I may be addicted to modding.
    • View Profile
Re: Modding Glass (You know it was bound to come up).
« Reply #6 on: March 16, 2011, 11:59:10 am »

Wouldn't it technically be possible to remove the glassmaking facilities from [PERMITTED_BUILDING]s and make a custom "Glass Fvrnace" that makes the old glasses and also some new ones?
Logged
I like fortresses because they are still underground.

Grimlocke

  • Bay Watcher
  • *kobold noises*
    • View Profile
Re: Modding Glass (You know it was bound to come up).
« Reply #7 on: March 16, 2011, 03:35:01 pm »

Non-custom workshops are hardcoded, you cant remove them from play. But of course nothing stops you from adding the default glasses to your custom building and just not building a default glass furnace.

For it to make some more sense you could name the new furnace 'advanced glass furnace', 'master glass furnace' or whatever.
Logged
I make Grimlocke's History & Realism Mods. Its got poleaxes, sturdy joints and bloomeries. Now compatible with DF Revised!

Pickerel

  • Bay Watcher
    • View Profile
Re: Modding Glass (You know it was bound to come up).
« Reply #8 on: March 16, 2011, 04:58:21 pm »

So... yeah.  The above method I tried results in game crashed.  And the problem is with the product, as Grimlocke predicted.

Is this just not going to work this way, truly?  Because if things would actually require a long list of reactions to mimic glass, I might as well just make a few minor reactions to make rough glass of each color, and then just make a reaction that uses glass to glaze things.

Question: if I have a reaction hat, in it's PRODUCT, specifies hat it will produce crafts but not which one, will it produce a random craft, or some untyped generic 'craft'?
Logged

Grimlocke

  • Bay Watcher
  • *kobold noises*
    • View Profile
Re: Modding Glass (You know it was bound to come up).
« Reply #9 on: March 16, 2011, 05:15:08 pm »

... What? Reaction hat?

Took me a while to figure out that was a typo, and now I want to make a reaction hat.

Aaaanyway. You can produce a random craft with CRAFTS:NONE as item tokens.

Glazing would be simpler to mod in, but might prove to be a bit of a pain in fortress mode when you want a specific item 'colored'. There also the names and descriptions being weird.
Logged
I make Grimlocke's History & Realism Mods. Its got poleaxes, sturdy joints and bloomeries. Now compatible with DF Revised!

Pickerel

  • Bay Watcher
    • View Profile
Re: Modding Glass (You know it was bound to come up).
« Reply #10 on: March 16, 2011, 07:01:39 pm »

Okay, a question about amounts in reactions under the new system.
SO: I want to use a metal bar to color some glass.  But the glass requires VERY little to actually be used.  Bars seem to have, now, 150 units?  Lets say I had the following:
[REAGENT:colorant:1:BAR:NONE:NONE:NONE]
Would this use 1/150th of the bar, leaving a bar with 149 units to go?
And if so, can this bar still be used for other processes - for example, if a dwarf requires 150 bar, and there are many bars around, can said dwarf use 149 bar from my bar, and 1 bar from another bar?
Logged

Jay

  • Bay Watcher
  • ☼Not Dead Yet☼
    • View Profile
Re: Modding Glass (You know it was bound to come up).
« Reply #11 on: March 16, 2011, 07:15:46 pm »

I don't know if reactions are set up for partials in reagents like that yet.

I would imagine it has something to do with the [MIN_DIMENSION]  tag, but the wiki is clueless as to its usage.
Logged
Mishimanriz: Histories of Pegasi and Dictionaries

Pickerel

  • Bay Watcher
    • View Profile
Re: Modding Glass (You know it was bound to come up).
« Reply #12 on: March 17, 2011, 02:22:51 am »

So I have some things working nicely, but one thing I have come up against is the following.

I have Eight glass reactions.
Three of these, I have the component in stone.  Like the below, where I bought and embarked with a pyrolusite boulder.
   [REAGENT:colorant:1:ANY_RAW_MATERIAL:NONE:INORGANIC:PYROLUSITE]
      [PRESERVE_REAGENT]
This works JUST fine.  I get the reagent specified, all it well.  All four reactions for colored glass that use a boulder or no boulder at all work just fine.

For the other four, however, I have the following sort of thing:
   [REAGENT:colorant:1:ANY_RAW_MATERIAL:NONE:INORGANIC:LEAD]
      [PRESERVE_REAGENT]
And I bought and embarked with a lead bar.  I can see it just fine, it's now sitting next to the kiln.
All four reactions for which I have the component in bar form are not registering.  All other necessary components exist and are used fine in the other reactions, but the bar is not registering as ANY_RAW_MATERIAL, despite that, in the reaction_other raw, toady noted that "ANY_RAW_MATERIAL means powder/bars/boulders/globs"... Is this a bug, or am I doing something wrong?

Also: For future reference, the [IS_GLASS] material definition token DOES indeed make the material recognizable to the [GLASS_MATERIAL] token.  It works VERY nicely, which has allowed me to have one reaction that works with all glass to achieve a goal, rather than eight.  Granted, I can't specify the types, but I just want a flamboyant fort anyway, so it's all good.
For example, the following reaction works wonderfully with any of the four glasses I have been able to produce, selecting the closest one to the kiln.  It also works perfectly with regular glass.
Spoiler (click to show/hide)
Logged

Grimlocke

  • Bay Watcher
  • *kobold noises*
    • View Profile
Re: Modding Glass (You know it was bound to come up).
« Reply #13 on: March 17, 2011, 08:45:51 am »

Perhaps this is a bug with the ANY_RAW_MATERIAL tag? I have so far used it only with a specified reaction class tag (or reaction product tags, etc) and its worked fine with bars as well. Perhaps try to use a reaction class tag on lead?
Logged
I make Grimlocke's History & Realism Mods. Its got poleaxes, sturdy joints and bloomeries. Now compatible with DF Revised!

Jay

  • Bay Watcher
  • ☼Not Dead Yet☼
    • View Profile
Re: Modding Glass (You know it was bound to come up).
« Reply #14 on: March 17, 2011, 10:23:07 am »

For example, the following reaction works wonderfully with any of the four glasses I have been able to produce, selecting the closest one to the kiln.  It also works perfectly with regular glass.
Spoiler (click to show/hide)
That's the vanilla glazing reaction :P
Logged
Mishimanriz: Histories of Pegasi and Dictionaries
Pages: [1] 2