Beyond cloning...

hello,

not sure if i should put this here or the inform7 board, since i am new and the question might be too simplistic for that. ideally what i want is for the player to be able to create unique objects in game, not by duplicating or recombining ones that i’ve created. not sure how crazy of a demand this is…
things i can do so far:
Duplicate an existing object, take it, move it from room to room
transmutations–create a relational device that turns a set of objects into another predetermined set of objects.
make a paintbrush and palette that can paint one object one color
create a notebook that allows the player to write and read what they’ve written, but only up to about 80 characters per entry. 15-20 words. (but this is a portable object, not something that can be added to the scenery of rooms at the player’s discretion).

any insight is helpful.

Inform is pretty clumsy at this sort of thing, as you’ve certainly found by getting this far.

You’ll have to have a clear notion of what range of “unique item” you’re going to allow. Is this a situation where the player types “create purple anaphylactic frog” and a purple anaphylactic frog object appears? (Possible, but if the player goes nuts and creates fifty random objects, the parser will probably bog down.)

I was thinking the range would be variations on the objects already present in the rooms. If there is a simple aquarium object, the player might “create neon goldfish” and the object appears. Is this a custom action?
Thank you.

Well, you can certainly make a new action that acts on an arbitrary string of text:

[code]Understand “create [text]” as creating.

Creating is an action applying to a topic.[/code]
And then you could attach that to a set of code that summons an undescribed thing, gives it a name and plops it down in front of the player:

[code]A wotsit is a kind of thing. A wotsit can be created or uncreated. A wotsit is usually uncreated. There are 20 wotsits.

A wotsit has some indexed text called create-name. Understand the create-name property as describing the wotsit.

The description of a wotsit is usually “A perfectly ordinary [create-name].”

Carry out creating:
if there is an uncreated wotsit begin;
let N be a random uncreated wotsit;
let Z be the topic understood;
now the printed name of N is Z;
now the create-name of N is Z;
now N is in the location of player;
otherwise;
say “You’ve meddled with the fabric of reality quite enough for one day.”;
end if;
[/code]

getting this error message:
“it looks as if you intend ‘printed name of N is Z’ to be a condition, but that would mean comparing two kinds of value which cannot mix - a text and a snippet - so this must be incorrect.”

Ah. Yes. This is the issue where Inform has three different kinds of text, all of which hate one another unless gently introduced under quite specific circumstances.

The following works fine:

[code]Understand “create [text]” as creating.

Creating is an action applying to a topic.

A wotsit is a kind of thing. A wotsit can be created or uncreated. A wotsit is usually uncreated. There are 20 wotsits.

A wotsit has some indexed text called create-name. Understand the create-name property as describing the wotsit.

The description of a wotsit is usually “A perfectly ordinary [create-name].”

Carry out creating:
if there is an uncreated wotsit begin;
let N be a random uncreated wotsit;
let Z be indexed text;
let Z be the topic understood;
now the create-name of N is Z;
now N is in the location of player;
otherwise;
say “You’ve meddled with the fabric of reality quite enough for one day.”;
end if;

The printed name of a wotsit is “[create-name]”.[/code]

now this action runs in my tester!
“let z be indexed text” is the point i was missing. so indexed text and the topic understood cannot be written as the same thing, they have to be introduced separately. I think that I was assuming “the topic understood” was indexed text, that there was an implied relationship. I’ll have to take a walk through the manuals again.
Also, after specifying that the create-name changes, then the printed name can change…instead of both happening within the conditional rule. yes?
brilliant, thank you.