Creating items after conversation.

So I’m working on creating an item in a room after a conversation, and I keep getting an error of not being explicit enough?

The Dancing Pony is a room. "The sign of the Dancing Pony is one of rough wood and aged white paint, the silhouette of a rearing, stubby equine speckled with dirt and age. As you pass the door and walk inside, you see a set of stairs leading upwards into the darkness. The taproom inside is warm, and lit by a cheery fire in the hearth. The sweet smell of pinesmoke wafts into your nose as you look around the low tables and rude stools. A low wooden bar is at the far end of the room." A man called a burly barkeep is in The Dancing Pony. A man called a bearded farmer is in The Dancing Pony. A man cakked a hawk nosed farmer is in The Dancing Pony. A bar is scenery in The Dancing Pony. The bar is a supporter. A fireplace is scenery in the Dancing Pony. A long table is scenery in the Dancing Pony. Two long benches are scenery in The Dancing Pony.

Understand "barkeep" as burly barkeep.
Understand "Gawell" as burly barkeep.

After asking a burly barkeep about a topic listed in the Table of Gawell's Conversation, say "[conversation entry][paragraph break]".;

After asking burly barkeep about "name":
	say "'My name is Gawell. Welcome to [bold type]The Dancing Pony[roman type], traveller, What are you called?'[line break]
'[player's name],' you say.[line break]
Gawell grins. 'Nice to meet you, [player's name].'";
	now the printed name of burly barkeep is "Gawell";
	now the burly barkeep is proper-named.
	
Instead of asking a burly barkeep about "ale":
	if a bottle of ale is not on the bar:
		say "Gawell pulls a bottle of ale out from under the bar. 'That's 1 silver piece, [player's name].'";
		now a bottle of ale is on the bar;
	otherwise:
		say "Gawell gestures to the bottle of ale on the bar. '1 silver piece.'".

I’ve previously defined a bottle of ale as a drink, which is an edible kind of thing with a description. But this code gives me the error:

You wrote ‘now a bottle of ale is on the bar’ : but this is not explicit enough, and should set out definite relationships between specific things, like ‘now the cat is in the bag’, not something more elusive like ‘now the cat is carried by a woman.’ (Which woman? That’s the trouble.)

I’m being a total noob here, but how am I supposed to fix that? I can’t find an example that would work–I’m assuming it has something to do with my use of ‘Instead’, which I’m only trying because ‘After’ threw up the same error…

M

Try “now a random bottle of ale is on the bar”. You might also want to try “now a random off-stage bottle of ale is on the bar”, though first you’d have to check that there are some bottles of ale off-stage (and have the bartender say “we’re all out” or something if there aren’t); this prevents the game from teleporting a bottle of ale from you inventory to the bar.

I assume you’ve defined bottle of ale as a kind – you should also know that Inform doesn’t create objects as play goes on (unless you use an extension), so you’ll have to define the number of bottles of ale you want at the beginning, with a line like “There are twenty bottles of ale.” This will create the bottles off-stage, which is probably what you want.

I also think, but I’m not sure, that “if a bottle of ale is not on the bar” won’t do what you want; I think this condition will hold true if there are any bottles of ale that aren’t on the bar. I think you want “If no bottles of ale are on the bar” or “Unless a bottle of ale is on the bar.” But I haven’t checked this.

The bottle of ale shouldn’t be defined as a kind of thing if there is just one bottle, just a thing like so.

The bottle of ale is a thing. The description of the bottle on ale is "Lot of description stuff.".

The you should say this.

now the bottle of ale is on the bar;

Hope this helps.

PS. On second glance, if you have more than one bottle, matt w’s solution covers that.

More generally: Inform cannot create new objects at runtime. Rather, you need to manipulate existing objects – bring them on or offstage, change their descriptions and so on – to give that effect. This is fine for games which only need small amounts of dynamic object creation; and for games that require a lot of it, Inform is not likely to be an ideal language anyway.

Though there is the Dynamic Objects extension which allows you to do just that.

Just so; I thought about mentioning it, but in this sort of situation it’d be like using a five-ton, gold-plated bulldozer to repot a nasturtium.

Thanks for that guys! I’ll try it when I get back home.

I’ve ended up using this:

Instead of asking a burly barkeep about "ale": if a bottle of ale is off-stage: if a bottle of ale is on the bar: say "Gawell gestures to the bottle of ale on the bar. '1 silver piece.'"; otherwise: now a random off-stage bottle of ale is on the bar; say "Gawell pulls a bottle of ale out from under the bar. 'That's 1 silver piece, [player's name].'"; otherwise: say "'Sorry,' Gawell says, 'We're out of ale right now.'".

It didn’t work for a while, but then I realised I needed to set plurals for ‘a bottle of ale’ and it worked like a charm.

I’d recommend rearranging the conditionals – if there’s a bottle of ale on the bar but no bottle of ale off-stage Gawell will say “Sorry, we’re out of ale,” which seems like it isn’t what you want to happen.

ETA: And whoops on the plural of bottle of ale. Glad you caught that!

Something like this should fix the aforementioned issue.

Instead of asking a burly barkeep about "ale": if a bottle of ale is on the bar begin; say "Gawell gestures to the bottle of ale on the bar. '1 silver piece.'"; otherwise if a bottle of ale is off-stage; now a random off-stage bottle of ale is on the bar; say "Gawell pulls a bottle of ale out from under the bar. 'That's 1 silver piece, [player's name].'"; otherwise; say "'Sorry,' Gawell says, 'We're out of ale right now.'"; end if.

Hope this helps.

hope this typo isn’t in your original code