Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Custom reactions and item names  (Read 466 times)

Poldon

  • Bay Watcher
    • View Profile
Custom reactions and item names
« on: January 22, 2023, 12:45:05 pm »

Okay, I've been working with some custom reactions for a custom entity revolving around growing crystals colored with powdered gems. The end goal is to have grown crystals whose color is based on the gem that was ground up and used in its creation.

The problem I'm having right now is that I can grind the gems, but they don't get any kind of name change, it just calls the powder by the gem name. Looking through the various options I have, it looks like I could create a new material for each and every gem with the powder name and use that as the product of the reaction... but surely there's an easier way? It doesn't look like I can add product templates to inorganics like animals or plants. Does anyone more experienced have any ideas?
Logged

brewer bob

  • Bay Watcher
  • euphoric due to inebriation
    • View Profile
Re: Custom reactions and item names
« Reply #1 on: January 22, 2023, 04:18:24 pm »

When I've needed a powder name I've just added [STATE_NAME:SOLID_POWDER:<insert name> powder] to the inorganic.

Example:
Code: [Select]
[INORGANIC:SILVER]
[USE_MATERIAL_TEMPLATE:METAL_TEMPLATE]
[STATE_NAME:SOLID:silver]
[STATE_NAME_ADJ:ALL_SOLID:silver]
[STATE_NAME:SOLID_POWDER:silver dust]
[STATE_NAME_ADJ:LIQUID:molten silver]
[STATE_NAME_ADJ:GAS:boiling silver]
...

But I'm not sure if that'll be enough with gems, since they use the IS_GEM material definition token and they have OVERWRITE_SOLID in them (e.g., [IS_GEM:onyx:onyxes:OVERWRITE_SOLID]).

So, you might need to remove the overwrite part (according to the Wiki it's optional anyway).

Poldon

  • Bay Watcher
    • View Profile
Re: Custom reactions and item names
« Reply #2 on: January 22, 2023, 10:11:08 pm »

Well... it may be optional, but a quick test of removing it from all vanilla gems results in all gem walls being "You have struck Stone!" and Stone walls, and just Stone. So that doesn't seem to be the answer.

I could try to add state tokens to all of them as well, but man that's a lot of work if I'm not sure it'll work... Maybe I can remove all but one temporarily and see if that one works actually.


Edit: Okay, so keeping the overwrite and giving it a powder name works for the powder! Cool. However, now if I make it back into a solid it's still the same material and goes back to the basic gem name. I'm pretty sure I'm just going to have to add entries for every gem... but at least I think I know what I need now. I think and hope.
« Last Edit: January 22, 2023, 10:34:02 pm by Poldon »
Logged