A couple of hundred items, strewth! Yeah, you definitely don’t want to special-case each one of those.
That seems like something that you probably want to handle with a table somehow. (Since you can’t have three-way relations like “X is meldable with Y to make Z.”) One column for the first item that gets melded, one column for the second, one for the item you get, and another one for any special text you might want to print as the result of the melding. Then instead of setting a “meldable” property by hand you can just check to see if your objects are in the table.
One big advantage of this approach compared to writing a bunch of rules or having a lot of relations you set by hand is that it’s easier to keep everything in sync. If you have to separately set objects as meldable and write the rules for melding them, it’d be easy to write a rule for melding something without setting it as meldable, and then you’ll get failures.
Here’s a little demo I wrote for it:
[code]“Meldability Demo”
The Lab is a room. The small stone, the toothpick, the paper clip, the string, and the useless lump of clay are in the Lab.
There is a rope ladder. There is a hammer. There is a fishing pole. [This creates them off-stage.]
Table of Meldability
first component second component result special message
small stone toothpick hammer –
paper clip string rope ladder –
toothpick string fishing pole “The toothpick and string combine to form a fishing pole. Cool!”
Melding it with is an action applying to two things. Understand “meld [something] with [something]” as melding it with.
Definition: A thing is meldable if it is a first component listed in the Table of Meldability or it is a second component listed in the Table of Meldability
Check melding it with when the noun is not held or the second noun is not held: say “You need to be holding something to meld it.” instead.
Check melding it with when the noun is not meldable: say “You feel a buzzing but [the noun] stays inert. That doesn’t seem to be susceptible to your melding powers.” instead.
Check melding it with when the second noun is not meldable: say “You feel a buzzing but [the second noun] stays inert. That doesn’t seem to be susceptible to your melding powers.” instead.
Carry out melding it with:
repeat through the Table of Meldability:
if (the noun is the first component entry and the second noun is the second component entry) or (the noun is the second component entry and the second noun is the first component entry):
remove the noun from play;
remove the second noun from play;
now the player holds the result entry;
if there is a special message entry:
say the special message entry;
otherwise:
say “You feel a buzzing. [The noun] and [the second noun] stretch out. When the buzzing subsides you are holding [the result entry].”;
rule succeeds; [this ends the whole rulebook with a success, which means we don’t keep repeating; but other carry out melding with rules won’t fire]
say “You feel a buzzing. [The noun] and [the second noun] stretch slightly but then subside. They seem to be things you can meld, but not with each other.” instead. [You’ll only get to this line if you’ve gone through the whole table without finding anything.]
Last carry out melding it with: say “Let’s see what this will do.”
Test first with “meld stone with toothpick/take all/meld stone with lump/meld lump with stone/meld toothpick with stone/i”.
Test second with “take all/meld toothpick with string/i”.
Test third with “take all/meld stone with paper clip”.
[/code]
Remember how I said “don’t print text in carry out rules”? Yeah, well… in this case it might seem better to use a check rule to see if the two objects are meldable, a carry out rule to move the objects around, an after rule to print the special message if there is one, and a report rule to print the generic melding message. But (I think) you would keep losing your place in the Table of Meldability every time you went to a new rulebook. So I wanted to stick everything in a rule, and “Instead” rules run before “Check” rules (see section 12.2), so I used a “Carry Out.”
One disadvantage is that the action counts as a “success” if both nouns are meldable even if they don’t meld with each other, because an action is a success whenever it reaches the “Carry out” rules. But it’s pretty likely that that won’t cause a problem (I think).
Anyway, hope this helps. If you have a lot of stuff to meld, it’s good to have a uniform way of doing it (that you can break if you need to – for instance, you could write an “Instead” rule for two special objects that would bypass all this machinery) and a way of keeping all the stuff you need for it in one place.
[EDIT: Snipped some debug code.]