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  [ 9 posts ] 
Author Message
 Post subject: Scenery supporters rule
PostPosted: Mon Nov 05, 2018 12:46 pm 
Offline

Joined: Sat May 07, 2016 5:57 pm
Posts: 390
I'm trying to alter the 'describe what's on scenery supporters in room descriptions rule'--and therefore other related rules--because I have an NPC that I want to be able to fully describe--even when sitting on furniture, for instance--whenever the player 'looks' or examines the supporter. This NPC is the only 'thing' that I want described in this way. I am trying various things with that rule but nothing seems to be panning out. I am planning to write a complicated initial appearance paragraph for the NPC to be printed instead of the usual 'On the wood steps is Judith.', for instance (and of course, including other items that are there, if any, saying 'On the [holder of Judith] you see [list of things which are on the holder of Judith].)'

Do I need to abolish the above-mentioned rule, and then write a 'rule for printing a locale paragraph about a scenery supporter', like so--

Code:
The describe what's on scenery supporters in room descriptions rule does nothing.

Rule for writing a locale paragraph about a scenery supporter:
    if the item described is not the holder of Judith:
        say "On the [item described], you see [a list of things which are on the item described].";
    otherwise:
        say "[judithapp]";
        if Judith is marked for listing;
            now Judith is not marked for listing;
        if there is something on the holder of Judith:
            say "Next to Judith, you can see [a list of things which are on the holder of Judith]."


Top
 Profile Send private message  
Reply with quote  
PostPosted: Mon Nov 05, 2018 12:47 pm 
Offline

Joined: Sat May 07, 2016 5:57 pm
Posts: 390
Okay, just tried this, and am still getting 'On the wood steps is Judith.'

By the way, 'judithapp' is the initial appearance paragraph of Judith.

Thanks for any help, of course I'll continue to try other stuff.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Mon Nov 05, 2018 4:52 pm 
Offline

Joined: Mon Dec 15, 2014 9:15 am
Posts: 383
I'd be inclined to cheat --- instead of rewriting the look action, you could just remove the character from the supporter temporarily.

Code:
Judith_position is an object that varies. Judith_position is initially nothing.
Before looking in the presence of Judith when the holder of Judith is not a room:
   now Judith_position is the holder of Judith;
   move Judith to the location.
After looking in the presence of Judith:
   if Judith_position is not nothing:
      move Judith to Judith_position;
   now Judith_position is nothing;
   continue the action.

The initial appearance of Judith is "[if Judith_position is not nothing]Judith is on [the Judith_position].[else]Judith is here.[end if] (Etc.)".


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Nov 06, 2018 9:30 am 
Offline

Joined: Sat May 07, 2016 5:57 pm
Posts: 390
Thanks, JRB, that makes a lot of sense, and I actually did something like that in one of my games (but not for looking). I guess I could do something similar for when the player examines the supporter that 'Judith' is 'on'.

One other thing I didn't think of was maybe I could disable that scenery supporters rule and just alter the body text of the room description with a substitution...?? My head was so buried in rules yesterday that I didn't think of that. Maybe I was just wanting to see if I could replace the 'On the ...is/are...' statement using only rules.

Thanks!


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Nov 06, 2018 11:27 am 
Offline

Joined: Sat May 07, 2016 5:57 pm
Posts: 390
You know I just discovered what was wrong. I had forgotten that I had changed a value belonging to my NPC, such that [judithapp] would be altered to describe that value, and I had not yet written a paragraph reflecting that value, so the routine I had written to 'say [judithapp]' had been returning null string--saying nothing--whenever [judithapp] was called for, after she was moved to her settee. All that time, I had thought that I did not change that value yet, I was merely seeing if [judithapp] would print something after she went from standing in a room to sitting on a settee, then I would write something different for the value change. Here, finally, is something like what worked--

Code:
A herposition is a kind of value.  The herpositions are standface, sitdown.

The describe what's on scenery supporters in room descriptions rule does nothing when the item described is the holder of Judith.

Rule for printing a locale paragraph about the holder of Judith:
   if the holder of Judith is not a room:
      say "[judithapp][paragraph break]".

Definition:  a thing is notjudith if it is not Judith.

Judith is here.  Judith is a woman.  "[judithapp]".  The description of Judith is "[juddesc]".  Judith has a herposition.  The herposition of Judith is standface.
To say judithapp:
   if the herposition of Judith is:
      -- standface:
         say "Judith is standing here, facing you, waiting for you to say something meaningful[period]";
      -- sitdown:
         say "Judith is sitting here, on the [holder of Judith], staring at you expectantly[ellipsis]";
   if there is a notjudith thing on the holder of Judith:
      if the holder of Judith is not a room:
         say "[paragraph break]Next to Judith, on the [holder of Judith], you can see [a list of notjudith things which are on the holder of Judith][period]".



Before, I had changed her position (herposition) from 'standface' to 'sitdown'--but forgot to write an entry for 'sitdown', so [judithapp] was blank. Go figure.

Thanks a lot for your time, JRB.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Nov 06, 2018 2:02 pm 
Offline

Joined: Mon Dec 15, 2014 9:15 am
Posts: 383
Yes, that looks as though it should work very nicely.

I'm not sure you need the standface/sitdown flag, though---can't you just check directly whether Judith is on the sofa or not?


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Nov 07, 2018 8:17 am 
Offline

Joined: Sat May 07, 2016 5:57 pm
Posts: 390
There are actually quite a number of different 'herpositions', where how my NPC is positioned is crucial--that's not the actual source code of the 'game'. It's kind of an experimental game that I am doing.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Nov 07, 2018 9:38 am 
Offline

Joined: Mon Dec 15, 2014 9:15 am
Posts: 383
Have you checked out Postures by Emily Short?
Quote:
"Postures defines three postures -- seated, standing, and reclining -- and allows pieces of furniture to specify which postures are possible and preferred when the player is on those furnishings."

(The description refers to "the player", but it's written to work for NPCs as well.)


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Nov 07, 2018 11:34 am 
Offline

Joined: Sat May 07, 2016 5:57 pm
Posts: 390
Thanks, JRB--I'll check it out.


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

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: matt w and 18 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