Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Bit of reaction help?  (Read 982 times)

Xelanthol

  • Bay Watcher
    • View Profile
Bit of reaction help?
« on: June 02, 2011, 12:15:11 am »

Hey everybody here on bay12, just tried modding today. Managed to make myself a type of weapon-however I wanted to make a custom reaction (or several) that use more materials then normal weapons. I was thinking this weapon would require one unit of steel and one unit of gold, just to make it cost a bit more since it's a bit stronger.

I managed to create the weapon, add it to dwarf civs, and use it in arena mode. How would I go about adding a custom work order to a workshop to create it?

thanks guys! Sorry if this is a dumb question, the wiki has a small modding section
Logged

Eldrick Tobin

  • Bay Watcher
  • [ETHIC: MODDING_UNDWARFY: PERSONAL_MATTER]
    • View Profile
Re: Bit of reaction help?
« Reply #1 on: June 02, 2011, 12:57:00 am »

The reaction itself isn't a problem: (going with your gold and steel as goldsteel)

[REACTION:GOLDSTEEL_XELANTHOL_REACTION]
   [NAME:create a goldsteel xelanthol]
   [BUILDING:XELANTHOL:NONE]
   [REAGENT:A:150:BAR:NO_SUBTYPE:METAL:GOLDSTEEL]
   [PRODUCT:100:1:WEAPON:ITEM_WEAPON_XELANTHOL:METAL:GOLDSTEEL]

... until you mentioned multiple materials. The following example is missing brackets for a reason...

REACTION:GOLD_AND_STEEL_XELANTHOL_REACTION
   NAME:create a gold and steel xelanthol
   BUILDING:XELANTHOL:NONE
   REAGENT:A:150:BAR:NO_SUBTYPE:METAL:STEEL
   REAGENT:B:150:BAR:NO_SUBTYPE:METAL:GOLD
   PRODUCT:100:1:WEAPON:ITEM_WEAPON_XELANTHOL: ... as it breaks right here.

I don't think you can make a GET_MATERIAL_FROM_REAGENT:A followed by GET_MATERIAL_FROM_REAGENT:B to have it create a material C that it doesn't already have built. You'd have to build all the alloys you plan. Thus it would end up as either of the following:

A)

[REACTION:GOLD_AND_STEEL_XELANTHOL_REACTION]
   [NAME:create a gold and steel xelanthol]
   [BUILDING:SMELTER:NONE]
   [REAGENT:A:150:BAR:NO_SUBTYPE:METAL:STEEL]
   [REAGENT:B:150:BAR:NO_SUBTYPE:METAL:GOLD]
   [PRODUCT:100:1:WEAPON:ITEM_WEAPON_XELANTHOL:METAL:GOLDSTEEL]

B)

[REACTION:GOLD_AND_STEEL_BAR_REACTION]
   [NAME:create a gold and steel bar]
   [BUILDING:SMELTER:NONE]
   [REAGENT:A:150:BAR:NO_SUBTYPE:METAL:STEEL]
   [REAGENT:B:150:BAR:NO_SUBTYPE:METAL:GOLD]
   [PRODUCT:100:1:BAR:NO_SUBTYPE:METAL:GOLDSTEEL]
      [PRODUCT_DIMENSION:150]

[REACTION:GOLDSTEEL_XELANTHOL_REACTION]
(blahblah)

With of course the need for [INORGANIC:GOLDSTEEL] already defined for either of these methods.


I hope all that text was helpful ^^; And that you don't mind my spamming your username all over the reactions... but at least I didn't just type "no not really" and hit send right? And yes I'll be monitoring the thread just in case I'm way off base and you just want the reaction to consume a gold bar as well as a steel bar to encourage the weaponsmith to build the weapon.
Logged
--
Eldrick Tobin
Behold the unimpressive Aspectus Lolin mod. || My Little Arachnid Fortress attempt...
I mumble to myself on tumblr... Sometimes about DF Modding.

Xelanthol

  • Bay Watcher
    • View Profile
Re: Bit of reaction help?
« Reply #2 on: June 02, 2011, 12:54:35 pm »

Hey Eldrick! I was a bit worried no one was going to reply, thanks for taking some time out of your day to help.

So if I follow correctly, we cant use multiple reagents to create the weapon, so we have to create an alloy of the stated metals and then use the alloy to create the weapon? Or is it shorter then that?

Could you walk through what is happening in the last step of reaction A? I understand the first parts, at the smelter using a bar of gold and a bar of steel, and the product is my weapon using the goldsteel material as stats?

And B) Is the creation of the actual goldsteel bar?

Thanks a lot! Just started modding the other day so i'm trying to pick it up quickly.
« Last Edit: June 02, 2011, 01:25:54 pm by Xelanthol »
Logged

Eldrick Tobin

  • Bay Watcher
  • [ETHIC: MODDING_UNDWARFY: PERSONAL_MATTER]
    • View Profile
Re: Bit of reaction help?
« Reply #3 on: June 02, 2011, 02:22:04 pm »

Hey Eldrick! I was a bit worried no one was going to reply, thanks for taking some time out of your day to help.

So if I follow correctly, we cant use multiple reagents to create the weapon, so we have to create an alloy of the stated metals and then use the alloy to create the weapon? Or is it shorter then that?
Keyphrase 'create an alloy' but yeah.

Could you walk through what is happening in the last step of reaction A? I understand the first parts, at the smelter using a bar of gold and a bar of steel, and the product is my weapon using the goldsteel material as stats?
Walkthrough coming, but kinda. In A you already have [INROGANIC:GOLDSTEEL] built, and we're just skipping making a bar -or bars- first.

And B) Is the creation of the actual goldsteel bar?

Thanks a lot! Just started modding the other day so i'm trying to pick it up quickly.

B is creating the bar first, and then making the Item from the bar.

Stepping through each example with copious comments! (Using spoiler tags to cut down on the size of the wall of text.)

In the very first unlabeled reaction the assumptions are:
[INORGANIC:GOLDSTEEL] exists, and you just needed the reaction built for you.

Spoiler (click to show/hide)

The Second Unlabeled reaction would have attempted to have SOMETHING LIKE the following structure at the end. I'm sure the errorlog would have a field day with it:

Spoiler (click to show/hide)

Labeled Reaction A:

Spoiler (click to show/hide)

Labeled Reaction B:

Spoiler (click to show/hide)

How's that?
Logged
--
Eldrick Tobin
Behold the unimpressive Aspectus Lolin mod. || My Little Arachnid Fortress attempt...
I mumble to myself on tumblr... Sometimes about DF Modding.

Xelanthol

  • Bay Watcher
    • View Profile
Re: Bit of reaction help?
« Reply #4 on: June 02, 2011, 02:37:37 pm »

Hah phenomenal! Thanks a lot man you seem to know your stuff. I'd like to have a strong weapon that's hard/takes a handful of resources to build.

When I go create the goldsteel in the inorganic raws, I was just going to copy and paste the values from steel and make it a bit heavier/dense. Will this allow the material to be used for all weapons and armor enabled for the race? Or only for the Rip Blade (the custom weapon) specified in the reaction?
Logged

Eldrick Tobin

  • Bay Watcher
  • [ETHIC: MODDING_UNDWARFY: PERSONAL_MATTER]
    • View Profile
Re: Bit of reaction help?
« Reply #5 on: June 02, 2011, 02:53:30 pm »

Hah phenomenal! Thanks a lot man you seem to know your stuff. I'd like to have a strong weapon that's hard/takes a handful of resources to build.

When I go create the goldsteel in the inorganic raws, I was just going to copy and paste the values from steel and make it a bit heavier/dense. Will this allow the material to be used for all weapons and armor enabled for the race? Or only for the Rip Blade (the custom weapon) specified in the reaction?

Material availability is determined by the availability of it's components. If you can smelt gold and can smelt steel you've got your ticket to goldsteel. You might startle yourself by seeing it already available after you generate your world.

For Example... I have a reaction only metal... there's no way to mine it. I can make it into armor, and all kinds of other things. The problem? That would require making the bolt swords (custom weapon using the custom material) and melting them down to make anything else from it. But it's still available. Fun huh?
Logged
--
Eldrick Tobin
Behold the unimpressive Aspectus Lolin mod. || My Little Arachnid Fortress attempt...
I mumble to myself on tumblr... Sometimes about DF Modding.

Xelanthol

  • Bay Watcher
    • View Profile
Re: Bit of reaction help?
« Reply #6 on: June 02, 2011, 03:17:23 pm »

Myes.... *Rubs chin* Alright I'm learning!, let me fire this up, put in my new alloy and weapon, and run a new world.

Thanks so much! I'll  be back if I run into a problem.

*EDIT* Where would I put the reaction required to create the goldsteel Rip Blade? I only see reaction_other and reaction_smelter however these don't seem to have all the other weapon reactions. What do!
« Last Edit: June 02, 2011, 03:36:24 pm by Xelanthol »
Logged

Kweri

  • Bay Watcher
    • View Profile
Re: Bit of reaction help?
« Reply #7 on: June 02, 2011, 04:36:18 pm »

Myes.... *Rubs chin* Alright I'm learning!, let me fire this up, put in my new alloy and weapon, and run a new world.

Thanks so much! I'll  be back if I run into a problem.

*EDIT* Where would I put the reaction required to create the goldsteel Rip Blade? I only see reaction_other and reaction_smelter however these don't seem to have all the other weapon reactions. What do!
You can put them in either. The "default" weapon reactions are hardcoded.

To keep things nice and tidy, I usually prefer to put my modded stuff into new files so I can find/update everything a bit easier.

For reactions, the filename of the file has to be "reaction_*.txt" so you could make a new file "reaction_xelanthol.txt".

The very first line of the file has to be the name of the file, minus extension - so in the above case, your first line would be "reaction_xelanthol".

Then you need to tell the game what kind of file it is, so add [OBJECT:REACTION].

After that, paste away. :)
Logged