Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [40d] [Hack] How do I hack a rock nut?  (Read 1058 times)

qoonpooka

  • Bay Watcher
    • View Profile
[40d] [Hack] How do I hack a rock nut?
« on: December 20, 2010, 11:48:26 pm »

I admit it, this is a bit of a rage cheat.

Rhino lizards ate my rock nuts (no dwarven civ to buy more from, 40d so no possibility of forage) until I had 1 left.  I got it into the ground, but the bag to process the quarry bush hit the stockpile like, four frames after the bush was eaten by more lizards.

I'm trying to hack a rock nut in via a smelter. 

Why isn't this working?

[REACTION:HACK_ROCK_NUT]
[NAME:hack a rock nut]
[SMELTER]
[PRODUCT:100:1:SEEDS:1:BUSH_QUARRY:1]
Logged

NecroRebel

  • Bay Watcher
    • View Profile
Re: [40d] [Hack] How do I hack a rock nut?
« Reply #1 on: December 20, 2010, 11:59:07 pm »

The reaction HACK_ROCK_NUT probably didn't exist prior to when you embarked, so it will never work. Modify an existing reaction, like the one for black bronze, instead.

Also, the item subtype should probably be NO_SUBTYPE instead of 1, the material type should probably be PLANT, and the material subtype should then be BUSH_QUARRY. I think. It's been quite some time since I've modded 40d and I never dealt much with seed production even then.
Logged
A Better Magma Pump Stack: For all your high-FPS surface-level magma installation needs!

Dradym

  • Bay Watcher
  • if its hard, overly complex, but fun, its a dwarf
    • View Profile
Re: [40d] [Hack] How do I hack a rock nut?
« Reply #2 on: December 21, 2010, 01:30:29 am »

aww this shoulda been a dirty joke
Logged

qoonpooka

  • Bay Watcher
    • View Profile
Re: [40d] [Hack] How do I hack a rock nut?
« Reply #3 on: December 21, 2010, 09:56:10 am »

The reaction HACK_ROCK_NUT probably didn't exist prior to when you embarked, so it will never work. Modify an existing reaction, like the one for black bronze, instead.

Ah!  Didn't realize that. Thank you.

Also, the item subtype should probably be NO_SUBTYPE instead of 1, the material type should probably be PLANT, and the material subtype should then be BUSH_QUARRY. I think. It's been quite some time since I've modded 40d and I never dealt much with seed production even then.

I guess I'm lost as to the syntax, then.  I just copied the format for seeds from my embark profile.  Can you give me an example (ideally with labels)?  The wiki's modding section is useless when it comes to plants.
Logged

NecroRebel

  • Bay Watcher
    • View Profile
Re: [40d] [Hack] How do I hack a rock nut?
« Reply #4 on: December 21, 2010, 11:45:43 am »

Ah!  Didn't realize that. Thank you.
Yeah, the [REACTION:] line in a reaction tells the game what to refer to for reactions, and it saves that list when you embark, so to add a completely new reaction like that takes a world regen. Modding old, preexisting reactions works, though, and at least some people I know of have habitually added ~10 "dummy" reactions that don't do anything prior to generating a world so they have something free to mod.

Quote
I guess I'm lost as to the syntax, then.  I just copied the format for seeds from my embark profile.  Can you give me an example (ideally with labels)?  The wiki's modding section is useless when it comes to plants.
Yeah, the embark profiles' syntax is quite different from the reaction syntax... Let's see... Have you looked through the 40d page on reaction modding? That's actually a fairly good source, though it doesn't really say specifics, particularly not for plants.

Um. As far as an example... Let's see if I can't dig something that uses seeds up in the modding section.
...
Done! This line apparently works:
[PRODUCT:100:2:SEEDS:NONE:SAGUARO:NO_MATGLOSS]
Where SAGUARO refers not to the default tree but to a custom plant with that name. So, to get the product line for rock nuts, you'd change SAGUARO to BUSH_QUARRY.

What the different arguments in the product line mean:
PRODUCT: fairly obvious, tells the game it's what the reaction produces

100: the percentage chance of the reaction successfully producing this thing. 100 is standard.

2: how many items of this product type are produced when the reaction successfully produces one

SEEDS: in this case, the Item token, which tells the game what type of item it's trying to produce:

NONE: the first NONE here is the item subtype. For instance, if you were producing ARMOR, you'd have to tell it what specific kind of armor you wanted it to produce. For seeds, there's no different "types" of seed items, so we need NONE here.

BUSH_QUARRY: This is the appropriate Material token for the material you want the thing to be made out of. As it says near the bottom of that page, for things that use the PLANT and SEEDS item types use the name of the plant in question from the matgloss_plant.txt, which in this case is BUSH_QUARRY (in matgloss_plant.txt, the "name" is the game's reference line, the one that says [MATGLOSS_PLANT:]), and we use NO_MATGLOSS for the material subtype.

NO_MATGLOSS: This is the material subtype; if you were making something out of metal, for instance, you'd have METAL as the material token and then a subtype for a particular type of metal. Again, though, as it says at the bottom of the Material Token page, you need NO_MATGLOSS for lines involving the PLANT or SEEDS item tokens, so that's what we use here.



...Modding is complicated. Don't feel bad if you can't get it on your own  :-\
Logged
A Better Magma Pump Stack: For all your high-FPS surface-level magma installation needs!

moki

  • Bay Watcher
    • View Profile
Re: [40d] [Hack] How do I hack a rock nut?
« Reply #5 on: December 21, 2010, 04:44:55 pm »

What NecroRebel said, will probably work... anyway, I'd do it the dwarfy way: Open up the caverns and send down some plant gatherers. They will find someting eventually. When you were able to embark with rock nuts, that means that they do exist in the caves.
Logged
But my good sir, the second death was for Dwarven Science!

NecroRebel

  • Bay Watcher
    • View Profile
Re: [40d] [Hack] How do I hack a rock nut?
« Reply #6 on: December 21, 2010, 04:56:13 pm »

What NecroRebel said, will probably work... anyway, I'd do it the dwarfy way: Open up the caverns and send down some plant gatherers. They will find someting eventually. When you were able to embark with rock nuts, that means that they do exist in the caves.
Except it's 40d, so there's no such thing as caverns. It's possible that he can forage for rock nuts if, and only if, he has an underground pool or river on his site, but that's unlikely.
Logged
A Better Magma Pump Stack: For all your high-FPS surface-level magma installation needs!

qoonpooka

  • Bay Watcher
    • View Profile
Re: [40d] [Hack] How do I hack a rock nut?
« Reply #7 on: December 21, 2010, 05:58:27 pm »

Necro, that is quite possibly the most perfect explanation for modding in 40d I have ever seen.  You should consider putting that up on the wiki.

Thank you so much for that!
Logged

qoonpooka

  • Bay Watcher
    • View Profile
Re: [40d] [Hack] How do I hack a rock nut?
« Reply #8 on: December 21, 2010, 06:01:12 pm »

Of course, the whole thing is moot as my save corrupted. :(
Logged