Persephone example not working

I was trying to adjust the inventory rule. I copied it from Example 65: Perspehone in the documentation.

Instead of taking inventory: 
    say "[if the player carries something][We]['re] carrying [a list of things carried by the player][otherwise][We]['re] empty-handed"; 
    say "[if the player wears something]. [We]['re] wearing [a list of things worn by the player][end if]."

When I run it, it prints "You’re carrying . You’re wearing . "
What’s up?

1 Like

I’m actually surprised this compiles. The first of the two lines misses an [end if]. What happens when you add that?

2 Likes

I’m pretty sure the final “end if” is optional - obviously it’s good practice to include it, and if you want something after the conditional phrase it’s necessary, but doubt it’s the issue here - at least, the example compiles and works as expected for me.

Has your project made any alterations to how the list writer works? Looks like the conditionals are triggering but things are broken after that. If you can provide a cut-down example that reproduces the issue, that would be the best way to diagnose what’s going on.

2 Likes

Do you have rules for printing the name of things, or for doing other things while listing?

1 Like

Have you done anything to change who the player is?

1 Like

“The player” is a variable, so changing who the player is shouldn’t impact this I don’t think (“yourself” is the default player character object who may or may not be involved if you change the player, I think).

1 Like

My thought was that yourself acquires an inventory, then player is switched to some other person, making player’s inventory empty.

2 Likes

Maybe, to be sure, could you use a When play begins rule?

Lab is a room. 

The player carries a ticket for the next IFComp.
The player wears a lovely IFComp badge.

Instead of taking inventory: 
	say "[if the player carries something][We]['re] carrying [a list of things carried by the player][otherwise][We]['re] empty-handed"; 
	say "[if the player wears something]. [We]['re] wearing [a list of things worn by the player][end if]."
	
When play begins:
	try taking inventory;
	say paragraph break;
You're carrying a ticket for the next IFComp. You're wearing a lovely IFComp badge.

Welcome
An Interactive Fiction
Release 1 / Serial number 241021 / Inform 7 v10.1.2 / D

Lab

>i
You're carrying a ticket for the next IFComp. You're wearing a lovely IFComp badge.

>
1 Like

No.

That’s a good idea. I have fiddled with how inventory is presented. I’ll check into that. Thx.

That did it. I removed the following lines of code and Persphone worked, but I have no clue as to why.

Before listing contents when not taking inventory:
	group equipment together. 

The code above was trying to group things together so my location description was really, really long. It worked but messed up my inventory action.
Any suggestions as to why?