Bay 12 Games Forum

Dwarf Fortress => DF Modding => Topic started by: TerminatorII on May 07, 2008, 06:56:00 am

Title: TerminatorII's Metal Mod
Post by: TerminatorII on May 07, 2008, 06:56:00 am
I tried to create my first ever mod with mixed results. If someone with knowledge could look this over and let me know what I did wrong, I would appreciate it.


basically I want to make it possiable to smelt all raw ores into multiple bars. However, the only way to do this (I think) is to use a REACTION. I also wanted to remove old metals so the user of the mod wasn't confused by having 2 smelting tasks for all metals.

so I moddified   matgloss_stone_mineral  

code:
 

[MATGLOSS_STONE:GOLD2]
[NAME:native gold][STONE_NAME:gold nuggets][COLOR:6:7:1][TILE:156]
[ENVIRONMENT:IGNEOUS_ALL:VEIN:100]
[ENVIRONMENT:ALLUVIAL:CLUSTER_SMALL:100]
[ITEM_SYMBOL:'*']
[METAL_ORE:GOLD:100]
[SOLID_DENSITY:19320]
[VALUE:30]


every metal ore got renamed. ( I put a 2 on the end of them all.)

then I added reaction_metal  document with the new reactions in them. All the reactions were similar.

code:
 
reaction_metal

[OBJECT:REACTION]

[REACTION:GOLD]
[NAME:Smelt Gold to Bars (uses Ore)]
[SMELTER]
[REAGENT:1:METAL_ORE:GOLD2]
[PRODUCT:100:100:BAR:NO_SUBTYPE:METAL:GOLD]
[FUEL]


what puzzles me is that though I used this format for all the metal ores only gold works. And I also got coal to work.

code:


[REACTION:COAL_BITUMINOUS]
[NAME:Smelt BITUMINOUS COAL to COKE (uses Ore)]
[SMELTER]
[REAGENT:1:STONE:NO_SUBTYPE:STONE:COAL_BITUMINOUS2]
[PRODUCT:100:100:BAR:NO_SUBTYPE:METAL:COKE]
[FUEL]



I don't understand what is happening that the other ones fail to work. I think it is probably either a tag or hard code issue.

Title: Re: TerminatorII's Metal Mod
Post by: Ramirez on May 07, 2008, 11:17:00 am
Looks like the problem is that your new Gold2 ore is still treated as being a normal gold ore due to the [METAL_ORE:GOLD:100] tag. That tag not only makes it count as a normal gold ore, but it also means that there is a 100% chance of getting a gold bar when you smelt it (using the normal smelt native gold command).

If you want to make multiple bars you will either need to change the metal ore tag to be Gold2 or simply placing multiple [METAL_ORE:GOLD:100] tags which should stack. Some of the existing ores already produce multiple bars, so you can use them as reference.

So making the gold2 ore code say:

code:
 [MATGLOSS_STONE:GOLD2]
[NAME:native gold][STONE_NAME:gold nuggets][COLOR:6:7:1][TILE:156]
[ENVIRONMENT:IGNEOUS_ALL:VEIN:100]
[ENVIRONMENT:ALLUVIAL:CLUSTER_SMALL:100]
[ITEM_SYMBOL:'*']
[METAL_ORE:GOLD:100]
[METAL_ORE:GOLD:100]
[METAL_ORE:GOLD:100]
[METAL_ORE:GOLD:100]
[METAL_ORE:GOLD:100]
[SOLID_DENSITY:19320]
[VALUE:30]


Should in theory give 5 gold bars per ore smelted.
Title: Re: TerminatorII's Metal Mod
Post by: TerminatorII on May 07, 2008, 11:38:00 am
my method gives 100 gold bars, but it only works with gold, and coal.


WHY?

Title: Re: TerminatorII's Metal Mod
Post by: Deon on May 07, 2008, 01:12:00 pm
What's the reason to have metal and metal2?

I think your problem is because you've found gold2 gold and it works for your reaction, but other metals are metal not metal2 and as long as you have no metal reactions, just metal2, you can't do it.
Try to rename gold2 to "gold2" instead of gold in game.
The problem is that you have
[MATGLOSS_STONE:GOLD2][NAME:native gold] and [MATGLOSS_STONE:GOLD][NAME:native gold] and you can't say which one is gold 1 and which one is gold 2 when you're on dwarf screen.

But again: WHAT.S.THE.POINT?

[ May 07, 2008: Message edited by: Deon ]

Title: Re: TerminatorII's Metal Mod
Post by: Sean Mirrsen on May 07, 2008, 03:37:00 pm
Why not change all metals to [METAL_ORE:10000:<metalname>]? Has anybody tried that?
Title: Re: TerminatorII's Metal Mod
Post by: Deon on May 07, 2008, 03:54:00 pm
but 100 is percent.
100000 is pointless, it doesn't affect quantity, just change. At least it should.
And if you put multiple [ORE: ] you'll get multiple bars.
Title: Re: TerminatorII's Metal Mod
Post by: TerminatorII on May 07, 2008, 07:11:00 pm
[PRODUCT:100:100:BAR:NO_SUBTYPE:METAL:GOLD]


gives 100 bars

[PRODUCT:100:23:BAR:NO_SUBTYPE:METAL:GOLD]

gives 23 bars.

easiest way to get multiple bars.

Title: Re: TerminatorII's Metal Mod
Post by: TerminatorII on May 07, 2008, 07:58:00 pm
I got it to work. here is the break down:

matgloss_stone_mineral

code:
 

[MATGLOSS_STONE:MALACHITE]
[NAME:malachite][COLOR:2:7:0][TILE:156]
[ENVIRONMENT_SPEC:LIMESTONE:VEIN:100]
[ENVIRONMENT_SPEC:MARBLE:VEIN:100]
[ITEM_SYMBOL:'*']
[METAL_ORE:COPPER:100]
[VALUE:2]


reaction_metals

code:
  

[REACTION:MALACHITE]
[NAME:Smelt MALACHITE to Bars (uses Ore)]
[SMELTER]
[REAGENT:1:METAL_ORE:MALACHITE]
[PRODUCT:100:100:BAR:NO_SUBTYPE:METAL:COPPER]
[FUEL]



This works for all hard codded mineral types.

in the product line the second number is the quantity of product.

[ May 07, 2008: Message edited by: TerminatorII ]

Title: Re: TerminatorII's Metal Mod
Post by: Deon on May 07, 2008, 08:53:00 pm
Do you want to have 2 types of reactions? In your example you have 1) malachite to copper, 2) malachite to malachite bars.