I’m working on something under Inform 6 and stick to the basic ASK/TELL (/show/give/order/…) stuff regarding communication with NPCs. I have a room which is a shop, the shop owner X is present, and I want to have object Y which costs money but I don’t have any. As a player, how would you interact with X in order to get Y, given the limitations described above? Like, “X, i want Y but i have no money” just yields a “X says ~What?~” answer because only the first word after "X, " is being parsed.
It sounds like you’re asking a design question, rather than an implementation question.
This is tricky. If you put an item in a shop with a price on it, it’s a pretty strong signal that this is a puzzle and you need to come up with the cash to continue. To keep the player from immediately leaving, you’d have to make the shopkeeper proactively suggest alternate means of barter, perhaps on “X ITEM” or “ASK ABOUT ITEM”. Or have a sign up explaining that prices are negotiable.
(The player might try “BUY ITEM” or “TAKE ITEM” even knowing they’re broke, but I wouldn’t want to rely on it.)