Creating a loot table, why is this not working?

Hey Everyone,

I am currently attempting to create a loot table, very simple stuff or so i thought. Can anyone tell me why this isen’t working? what kind of relation is it Inform 7 is confused about?

Every turn:
	repeat with loot_set running through monsters:
		if loot_set is a goblin:
			now loot_set is carrying a stone.

*this is a very simplified piece of the code to make the problem i am having alot more prominent.

Problem. You wrote 'now loot_set is carrying a stone'  : 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.)

 See the manual: 8.11 > 8.11. Now...

i get the gist of it, “goblin” is appearantly not specific enough, but why isen’t it? how can i make it more specific than the current “loot_set” event running through the current “goblin”? This code should simply give all goblins a stone? should it not?

The problem isn’t actually the goblin, it’s the stone.

“loot_set” is properly one specific goblin that was found by running through monsters. However, a stone is a kind that isn’t specific. It’s as if you did “now the goblin is carrying a supporter”.

I’m not sure about all the details of your game, but I think you want something along the lines of “now loot_set is carrying a random off-stage stone” when you have some stones off-stage (this prevents the game from stealing a stone from another goblin when doing this).