Problem with Kinds:

When I try to ask Bill for uniform and at the rifle it says
that I’ve already got them when I haven’t taken them.

asking for Bob’s stuff works. asking for Bill’s stuff
doesn’t work at all

Output then code follows:

Parade Grounds
The soldiers and sailors parade around in this huge field.

A soldier named Bob is here.

A Sailor named Bill is here.

x bob
He’s a soldier in the U.S. Army.

Bob is carrying:
a rifle

Bob is wearing:
a uniform

x bill
He’s a sailor in the U.S. Navy.

Bill is carrying:
a rifle

Bill is wearing:
a uniform

ask bob for uniform
Bob gives you his uniform.

ask bob for rifle
Bob gives you his rifle.

ask bill for rifle
Bill has already given you his rifle. <-----NO HE HASN’T

ask bill for uniform
Bill has already given you his uniform. <-----NO HE HASN’T

x bob
He’s a soldier in the U.S. Army.

x bill
He’s a sailor in the U.S. Navy.

Bill is carrying:
a rifle

Bill is wearing:
a uniform


"Military Times"

to say /l: say line break.

clsing is an action applying to nothing.
understand "cls" as clsing.
instead of clsing: clear the screen.
to clear the screen:  (- VM_ClearScreen(0); -).

a soldier is a kind of person.
understand "soldier" as the soldier.
the description is  "He's a soldier in the U.S. Army.". 

a sailor is a kind of person.
understand "sailor" as sailor.
the description  is "He's a sailor in the U.S. Navy.".

a uniform is a kind of thing.
a uniform is usually wearable.
the plural of uniform is uniforms.

a rifle is a kind of thing.
the description of a rifle is usually "An M1 Garand.".
the plural of rifle is rifles.

Parade Grounds is a room.
"The soldiers and sailors parade around in this huge field."

a soldier called Bob is in Parade Grounds.
"A soldier named Bob is here.".
bob is carrying a rifle and wearing a uniform.

a sailor called Bill is in Parade Grounds.
"A Sailor named Bill is here.".
bill is carrying a rifle and wearing a uniform.

before  asking Bill for something (called the wanted2):
	if the wanted2 is a rifle and the wanted2 is carried by Bill:
		say "Bill gives you his rifle.";
		now the wanted2 is carried by yourself instead;
	otherwise if the wanted2 is a rifle and the wanted2 is not carried by Bill:
		say "Bill has already given you his rifle." instead;
		
before  asking  Bill for something (called the duds2):
	if the duds2 is a  uniform and the duds2 is worn by Bill:
		say "Bill gives you his uniform.";
		now the duds2 is carried by yourself instead;
	otherwise if the duds2 is a uniform and the duds2 is not worn by Bill:
		say "Bill has already given you his uniform." instead;

before  asking Bob for something (called the wanted):
	if the wanted is a rifle and the wanted is carried by Bob:
		say "Bob gives you his rifle.";
		now the wanted is carried by yourself instead;
	otherwise if the wanted is a rifle and the wanted is not carried by Bob:
		say "Bob has already given you his rifle." instead;
		
before  asking  Bob for something (called the duds):
	if the duds is a  uniform and the duds is worn by Bob:
		say "Bob gives you his uniform.";
		now the duds is carried by yourself  instead;
	otherwise if the duds is a uniform and the  duds is not worn by Bob:
		say "Bob has already given you his uniform." instead;
		
instead of examining a uniform:
say "Whose uniform? Bob's uniform or Bills uniform?".

instead of examining a uniform:
say "Whose uniform?  Bob's uniform, or  Bill's uniform?".


BobUning is an action applying to nothing.
understand  "Bob's uniform" or "x bob's uniform" or "examine bob's uniform" as BobUning.

BillUning is an action applying to nothing.
understand "Bill's uniform" or "x Bill's uniform" or "examine Bill's uniform" as BillUning.

instead of BobUning:
say "Bob's uniform is that of a soldier's.".

instead of  BillUning:
say "Bill's  uniform is that of a sailor's.".


yourself is wearing a military helmet.

before giving the helmet to someone:
	if the Helmet is worn by someone who is not yourself:
		say " [The holder of the helmet] is already wearing it." instead;
	otherwise if the helmet is worn by yourself:
		say "(first taking off the helmet): [/l]
		You give the helmet to [the second noun] who puts it on.";
		now the Helmet is worn by the second noun instead;
	otherwise if the helmet is carried by yourself:
		say "	You give the helmet to [the second noun] who puts it on.";
		now the Helmet is worn by the second noun instead;
	otherwise if the helmet is not enclosed by yourself:
		say "You haven't got it." instead;
		
instead of asking someone for the helmet:
	if yourself encloses the helmet:
		say "You've already got it.";
	otherwise if the helmet is worn by the second noun:
		now the helmet is carried by yourself;
		say "[The second noun] gives you the helmet.";
	otherwise if the helmet is not worn by the second noun:
		say "[The holder of the helmet] gives you the helmet instead.";
		now the helmet is carried by yourself;
		


instead of taking inventory:
	if yourself carries something and yourself wears something:
		say "You are carrying: [/l]";
		repeat with item running through things carried by yourself:
			say "a [item] [/l]";
		say "[/l]You are wearing: [/l]";
		repeat with item running through things worn by yourself:
			say "a [item] [/l]";
	otherwise if yourself carries something and yourself wears nothing:
		say "You are carrying: [/l]";
		repeat with item running through things carried by yourself:
			say "a [item] [/l]";
	otherwise if yourself wears something and yourself carries nothing:
		say "You are wearing: [/l]";
		repeat with item running through things worn by yourself:
			say "a [item] [/l]";
	otherwise if yourself carries nothing and yourself wears nothing:
		say "You are neither carrying or wearing anything.".

after examining yourself:
	if yourself  carries something and yourself wears something:
		say "You are carrying: [/l]";
		repeat with item running through things carried by yourself:
			say "a [item] [/l]";
		say "[/l]You are wearing: [/l]";
		repeat with item running through things worn by yourself:
			say "a [item] [/l]";
	otherwise if yourself carries something and yourself wears nothing:
		say "You are carrying: [/l]";
		repeat with item running through things carried by yourself:
			say "a [item] [/l]";
	otherwise if yourself wears something and yourself carries nothing:
		say "You are wearing: [/l]";
		repeat with item running through things worn by yourself:
			say "a [item] [/l]";
	otherwise if yourself wears nothing and yourself carries nothing:
		do nothing.

after examining someone who is not yourself:
	if the noun carries something and the noun wears something:
		say "[The noun] is carrying: [/l]";
		repeat with item running through things carried by the noun:
			say "a [item] [/l]";
		say "[/l][The noun] is wearing: [/l]";
		repeat with item running through things worn by the noun:
			say "a [item] [/l]";
	otherwise if the noun carries something and the noun wears nothing:
		say "[The noun] is carrying: [/l]";
		repeat with item running through things carried by the noun:
			say "a [item] [/l]";
	otherwise if the noun wears something and noun carries nothing:
		say "[The noun]is wearing: [/l]";
		repeat with item running through things worn by the noun:
			say "a [item] [/l]";
	otherwise if the noun wears nothing and the noun carries nothing:
		do nothing.			

Gamedesigner,

The overarching problem you’re experiencing is that pretty much everything you’re trying to do is working against the grain of Inform’s built-in object and action model. This is probably making it seem like doing even simple things is very difficult.

You may want to know about the debugging command “actions” and “rules” which will help illustrate how player commands are interpreted and show what logic is being executed in response to player commands. Also of interest is the “showme” command, which can help in diagnosing parser understanding and game state.

You don’t want before rules to get the NPCs to give the player things. You want to understand the built-in rules governing persuasion (See 12.4) and how to disable the default block giving rule.

You don’t want instead rules to override normal parser disambiguation. You absolutely do not want to define new actions to emulate or override normal parser disambiguation.

The specific issue causing the unexpected message is happening because “uniform” refers to either uniform object (one for Bob, one for Bill). The parser seems to be preferentially deciding that you mean the uniform that Bob gave you, and since that uniform is a uniform and is not worn by Bill, you get the message saying that Bill already gave it to you.

Your scenario is actually much trickier than it looks! This might get you a little closer to what you want:

[code]Include Plurality by Emily Short.

To say /l: say line break.

Clsing is an action applying to nothing.
Understand “cls” as clsing.
Instead of clsing: clear the screen.
To clear the screen: (- VM_ClearScreen(0); -).

A soldier is a kind of person.
Understand “soldier” as a soldier.
The description is “He’s a soldier in the U.S. Army.”.

A sailor is a kind of person.
Understand “sailor” as sailor.
The description is “He’s a sailor in the U.S. Navy.”.

A uniform is a kind of thing. Understand “clothes” as a uniform.
A uniform is usually wearable.
The plural of uniform is uniforms. [should not be necessary for regular plural forms.]

A rifle is a kind of thing. Understand “gun” as a rifle.
The description of a rifle is usually “An M1 Garand.”
The plural of rifle is rifles. [should not be necessary for regular plural forms.]

Parade Grounds is a room. “The soldiers and sailors parade around in this huge field.”

A soldier called Bob is in Parade Grounds. “A soldier named Bob is here.”
Bob is carrying a rifle (called Bob’s rifle) . Bob is wearing a uniform (called Bob’s uniform).

A sailor called Bill is in Parade Grounds. “A sailor named Bill is here.”
Bill is carrying a rifle (called Bill’s rifle). Bill is wearing a uniform (called Bill’s uniform).

Persuasion rule for asking someone to try giving something to the player: persuasion succeeds.

The block giving rule is not listed in any rulebook.

Does the player mean asking someone for something when the second noun is enclosed by the player: it is unlikely.

The player is wearing a military helmet.

After giving something wearable (called item) to someone (called recipient):
now the item is worn by the recipient;
say “You give [the item] to [the recipient], who puts it on.”

Before giving the helmet to someone when the helmet is not enclosed by the player: [before rule necessary here to prevent implicit take action]
say “You haven’t got it.” instead.

To show inventory listing for (subject - a person): [uses some special phrases from ‘Plurality’ extension]
if subject carries something:
say “[The subject] [is-are] carrying: [/l]”;
repeat with item running through things carried by subject:
say “[an item] [/l]”;
if the subject carries something and the subject wears something, say “[/l]”;
if subject wears something:
say “[The subject] [is-are] wearing: [/l]”;
repeat with item running through things worn by subject:
say “[an item] [/l]”;
otherwise if subject carries nothing and subject wears nothing:
say “[The subject] [is-are] neither carrying or wearing anything.”.

Instead of taking inventory:
show inventory listing for the player.

Instead of examining yourself when the player encloses at least one thing:
try taking inventory.

after examining someone (called viewee) who is not yourself:
show inventory listing for the viewee.[/code]

Otistdog: I appreciate your feedback but there is a major problem with your code:

you’ve told me the block giving rule is to be used but when I try to ask bob for his rifle
or uniform a 2nd time there is an error.
(bob first taking the rifle)
Bob has better things to do.

Instead I’ve made a workaround.
I’ve removed the kinds and given each rifle and each uniform a different name
and hard coded bob and bill separately.

It appears that kinds may not be able to be used with giving and asking.

The reason you see that error is because when you ask Bob for a rifle a second time, the “does the player mean” rule makes the parser assume you mean the rifle you’re not holding, i.e. Bill’s rifle. Bob then tries to take it from Bill but this is disallowed by other rules (you can see the rule that applies using the “rules” command). The “has better things to do” is a generic message that is shown whenever an NPC tries to execute the command it understood but fails.

Like I said, your scenario is more complicated than it looks, due to the fact that NPCs are involved and a bunch of default rules are designed to prevent this type of action, plus some complexity due to multiple objects with the same name. Nonetheless, working “with the grain” is the right way to do things, and all the functionality you want is available – it’s just not the typical beginner stuff, so there is a lot more reading to do to cover it all.

Good luck!

Yeah I’m still messing around with it.