intfiction.org

The Interactive Fiction Community Forum
It is currently Sat Dec 15, 2018 7:46 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Mon Dec 03, 2018 1:41 pm 
Offline

Joined: Sat May 07, 2016 5:57 pm
Posts: 390
In a game, I have the following code--

Code:
Jade is a woman.  "[jadeapp]".  The description is "She was, of course, quite a bit older than I remembered her.  I hadn't seen her in many years, half my life ago.  But I could still see the youthful beauty of her face, although there was no makeup, and her eyes had a vague frown.  Her dark, Asian hair was done up in a top knot, and she was sitting there, only half-relaxed, in her own lady's trench coat.  Her legs weren't even crossed, as if she were there purposefully."

To say jadeapp:
   say "Jade was sitting there, on the park bench, staring at me intently with her dark eyes[period]"
   
The describe what's on scenery supporters in room descriptions rule does nothing when the item described is the holder of Jade.
The examine supporters rule does nothing when the noun is the holder of Jade.
After the player examining the holder of Jade:
   say "[jadeapp][paragraph break]";
   if there is a notjade thing on the holder of Jade:
      say "[line break]Next to Jade, you can see [a list of notjade things which are on the holder of Jade]."

Rule for printing a locale paragraph about the holder of Jade:
   if the holder of Jade is not a room:
      if the player is not enclosed by the holder of Jade:
         say "[jadeapp][paragraph break]".

Definition:  a thing is notjade if it is not Jade and it is not the yourself.


It seems that whenever my NPC Jade is on the park bench, and the player is not, 'I could see nothing here.' appears at the end of a room description in response to a look. I found that this was a response to a 'you-can-also-see rule'. I suspect this was brought on by the locale paragraph rule above, but I can't see how..?? I added that rule (and cancelled the 'describe' rule) so that Jade's initial appearance paragraph would be printed when the player looks, instead of the bland 'On the bench is Jade'.

Any ideas?

Thanks.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Mon Dec 03, 2018 5:20 pm 
Offline

Joined: Thu Dec 14, 2017 11:31 am
Posts: 12
Quote:
It seems that whenever my NPC Jade is on the park bench, and the player is not, 'I could see nothing here.' appears at the end of a room description in response to a look. I found that this was a response to a 'you-can-also-see rule'. I suspect this was brought on by the locale paragraph rule above, but I can't see how..?? I added that rule (and cancelled the 'describe' rule) so that Jade's initial appearance paragraph would be printed when the player looks, instead of the bland 'On the bench is Jade'.


It's a little more difficult with only partial code, but I think that "the holder of Jade" is the room if she isn't on a supporter, so the "Rule for printing a locale paragraph about the holder of Jade" gets called when printing the room description. You can test this by adding an "otherwise" clause that prints something.

If I'm right, maybe the fix is something like:

Code:
Rule for printing a locale paragraph about the holder of Jade:
   if the holder of Jade is not a room:
      if the player is not enclosed by the holder of Jade:
         say "[jadeapp][paragraph break]";
   otherwise:
      rule succeeds.


I'm not in front of a computer with Inform, so this is only a reasonable guess for now.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Mon Dec 03, 2018 7:36 pm 
Offline

Joined: Mon Dec 15, 2014 9:15 am
Posts: 383
You need to add a command to your "printing a locale paragraph rule", something like
Code:
now the holder of Jade is mentioned;


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Dec 04, 2018 9:56 am 
Offline

Joined: Sat May 07, 2016 5:57 pm
Posts: 390
Thanks, JRB, as always. I added that line at the end of the rule, aligned with the first 'if' clause. Of course, 'the holder of Jade' is always going to be a scenery supporter, so I guess with it being marked as 'mentioned', that will also override the 'you-can-also-see' rule, so things that are 'on' anything will not be 'marked for listing'...? Am I right?

Thanks again.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Dec 04, 2018 12:48 pm 
Offline

Joined: Mon Dec 15, 2014 9:15 am
Posts: 383
There's a Standard Rules rule for writing a locale paragraph, the "don't mention scenery in room descriptions rule", which usually stops scenery objects getting listed. But your "writing a locale paragraph about the supporter of Jade" rule gets in first, and ends the activity. So the other rule never fires, and Inform thinks the object still needs to be mentioned. That's what you need to correct for.

(The scenery object still doesn't actually get mentioned, because at the very end of you-can-also-see rule the whole job is handed over to the content listing activity for the room, with the "not listing concealed items" flag set, which ignores scenery. But that's too late to prevent the rule itself from running.)


Another way you could fix the problem would be to put [park bench] in square brackets in the "To say jadeapp" rule. That substitution calls the "printing the name of something", which automatically causes that thing to be mentioned.


As regards preventing auto-listing of contents: yes, you just need to stop this rule from firing:
Code:
For printing a locale paragraph about a thing (called the item)
   (this is the describe what's on scenery supporters in room descriptions rule):
        [etc]

which you can do by overriding it explicitly or (what you're doing) pre-empting it with a more specific rule.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu Dec 06, 2018 9:08 am 
Offline

Joined: Sat May 07, 2016 5:57 pm
Posts: 390
Thanks a lot JRB. I am always fascinated by the intricacies of Inform 7.


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: matt w and 19 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group