Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: TerminatorII's Metal Mod  (Read 1121 times)

TerminatorII

  • Bay Watcher
  • [PREFSTRING:Adamantine Skeleton]
    • View Profile
TerminatorII's Metal Mod
« 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.

Logged
No, I think the cook would be in charge of sugar-coating the cows.

You are a lifesaver! Round and probably in tropical flavors.

Ramirez

  • Bay Watcher
    • View Profile
Re: TerminatorII's Metal Mod
« Reply #1 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.
Logged

TerminatorII

  • Bay Watcher
  • [PREFSTRING:Adamantine Skeleton]
    • View Profile
Re: TerminatorII's Metal Mod
« Reply #2 on: May 07, 2008, 11:38:00 am »

my method gives 100 gold bars, but it only works with gold, and coal.


WHY?

Logged
No, I think the cook would be in charge of sugar-coating the cows.

You are a lifesaver! Round and probably in tropical flavors.

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: TerminatorII's Metal Mod
« Reply #3 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 ]

Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Sean Mirrsen

  • Bay Watcher
  • Bearer of the Psionic Flame
    • View Profile
Re: TerminatorII's Metal Mod
« Reply #4 on: May 07, 2008, 03:37:00 pm »

Why not change all metals to [METAL_ORE:10000:<metalname>]? Has anybody tried that?
Logged
Multiworld Madness Archive:
Game One, Discontinued at World 3.
Game Two, Discontinued at World 1.

"Europe has to grow out of the mindset that Europe's problems are the world's problems, but the world's problems are not Europe's problems."
- Subrahmanyam Jaishankar, Minister of External Affairs, India

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: TerminatorII's Metal Mod
« Reply #5 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.
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

TerminatorII

  • Bay Watcher
  • [PREFSTRING:Adamantine Skeleton]
    • View Profile
Re: TerminatorII's Metal Mod
« Reply #6 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.

Logged
No, I think the cook would be in charge of sugar-coating the cows.

You are a lifesaver! Round and probably in tropical flavors.

TerminatorII

  • Bay Watcher
  • [PREFSTRING:Adamantine Skeleton]
    • View Profile
Re: TerminatorII's Metal Mod
« Reply #7 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 ]

Logged
No, I think the cook would be in charge of sugar-coating the cows.

You are a lifesaver! Round and probably in tropical flavors.

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: TerminatorII's Metal Mod
« Reply #8 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.
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository