Discussion:
Inform 7, how do i programatically add items in a room?
(too old to reply)
AJohn
2017-05-03 15:27:36 UTC
Permalink
I have a problem that i have been trying to solve all day with no luck.

This is what i am trying to achieve:
Every time i touch a certain character, he should drop a piece of cheese.

The cheese looks like this:
The plural of cheese is pieces of cheese. cheese is a kind of food. The description of cheese is "A part of the moon.".

Wich allows for placement of an arbitrary amount of cheese anywhere, i.e "one cheese is in the kitchen."

And every time i touch the NPC, Alan, i want him to drop one cheese in the room he is in. To the effect of this: "one cheese is now at the location of Alan."

My whole command is:

Instead of touching Alan:
say "Alan drops some cheese";
one cheese is now at the location of Alan.

The error i get is:

I was trying to match this phrase:

(one cheese is now - rule) at (location of Alan - time)
I recognised:
location of Alan = an instruction to work out a room
But I didn't recognise 'one cheese is now'.

I have been trying every kind of permutation, and scoured the books and internet and i find not even a reference to this. How can i programatically add stuff?

I am at a loss, what am i missing here?
Gregory Ewing
2017-05-03 23:07:56 UTC
Permalink
I don't think Inform lets you create multiple instances of
an object out of the box, but there seems to be an extension
for doing it:

http://inform7.com/extensions/Jesse%20McGrew/Dynamic%20Objects/doc_5.html
--
Greg
AJohn
2017-05-04 03:32:45 UTC
Permalink
Post by Gregory Ewing
I don't think Inform lets you create multiple instances of
an object out of the box, but there seems to be an extension
http://inform7.com/extensions/Jesse%20McGrew/Dynamic%20Objects/doc_5.html
--
Greg
Thanks, i'll look in to it
AJohn
2017-05-04 14:35:42 UTC
Permalink
Post by Gregory Ewing
I don't think Inform lets you create multiple instances of
an object out of the box, but there seems to be an extension
http://inform7.com/extensions/Jesse%20McGrew/Dynamic%20Objects/doc_5.html
--
Greg
For some reason the dependency, Dynamic Tables, doesn't seem to work. The problem is related to inform 6 and i have no knowledge of that language. I am falling back on the very messy idea of having creating a room full of cheese and then moving pieces one by one from that room haha. Oh well..
Loading...