I finally got the BUY [something] action working but I want to BUY [Nbr] [something].
I have not seen an action that takes two nouns, except for people. I can’t seem to get the two-noun form working because it conflicts with the original default BUY.
Currently, I use BUY [something], then ask the player how many? I use that number to do what I want, but that is cumbersome. Any suggestions?
No, I get a parser error on the first line:
Repeat-buying it of is an action appying to one number and one thing’: but the action definition contained text I couldn’t follow, and may be too complicated.
Before buying something:
try bulk-buying one of the noun instead.
Bulk-buying is an action applying to one number and one thing.
Understand "buy [number] [thing]" as bulk-buying.
Check bulk-buying something:
if noun is not purchasable:
say "That [noun] is not being sold. Perhaps you can just take it.";
stop the action;
otherwise:
say "Trying to buy the [noun]";
Carry out bulk-buying something:
say "1st noun = [first noun] ";
say "2nd noun = [second noun][line break]";
if the player has something (called sibling) that pairs the noun: [check if player already has it]
say "You already have [sibling]. You can't wear another one, and it's too bulky to carry around with you." instead;
otherwise:
say "You slap down some coins to pay for [noun].";
decrement qty of noun;
now sibling is in location;
now player is carrying sibling;
say "You pick up the [sibling]."
What am I doing wrong?
(A few of these statements are for debugging.)
Interestingly, the parser error says "Try using ‘something’ rather than ‘it’, but I didn;t use ‘it’. PROBLEM: You wrote ‘Check bulk-buying something’, which seems to introduce a rule taking effect only if the action is ‘bulk-buying something’. But that did not make sense as a description of an action. (I notice that there’s an action called ‘Bulk-buying’: the ‘it’ in the name is meant to be where something is specified about the first thing it acts on. Try using ‘something’ rather than ‘it’?) I am unable to place this rule into any rulebook.
No, similar parser error. Problem You wrote ‘try bulk-buying the noun’, but ‘bulk-buying the noun’ is not an action I can try. This looks as if it might be because it contains something of the wrong kind. My best try involved seeing if ‘noun’ could be a number, which might have made sense, but it turned out to be an object.
I think I’m going to give up on “BUY (number) (something)” because the parser can’t seem to handle a number and a noun.
I did that but the parser seems to have a problem with the block checking rule.
When I click on the doc to unlist it, another parser error!
I think I’ll report a bug in INFORM since the unlisting action is verbatim from the docs.
I have solved the blocking rule for BUY. The docs give a parser error, but someone’s example worked fine.
Understand "buy (something)" as buying.
The block buying rule is not listed in the check buying rules. [Needed to allow BUY to work.]
Check buying something:
if noun is not purchasable:
say "That [noun] is not being sold. Perhaps you can just take it.";
stop the action;
Carry out buying:
if the player has something (called sibling) that pairs the noun: [check if player already has it]
say "You already have [sibling]. You can't wear another one, and it's too bulky to carry around with you." instead;
otherwise:
say "You slap down some coins to pay for [noun].";
if VSpace contains something (called sibling) that pairs the noun:
now player is carrying the sibling;
say "You now have the [sibling]";
decrement qty of noun;
Since I have to tip the player that they need to enter a number (like 9 arrows), I will merely ask for how many after a BUY action.
Did you investigate that old thread I linked? I’m pretty sure BUY N OBJECTS is doable. I think it’s safe to say players will develop a frown at having to type two commands per purchase after the first time they experience it.