intfiction.org

The Interactive Fiction Community Forum
It is currently Thu Oct 18, 2018 5:31 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 13 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Fri Aug 10, 2018 3:48 pm 
Offline

Joined: Wed Aug 13, 2008 11:39 am
Posts: 37
So, I would like I7 to never identify anyone as "your former self". I've read different things saying that "your former self" is the name that I7 gives to "yourself" when you switch to another player. But, I can't reconcile that with, for example:

Code:
The Parlor is a room. Alice, Bob, Claire, Dave, and Eve are people in the parlor. The player is Alice. When play begins: let the subject be a random person in the parlor; now the player is the subject.

A person has a stored action called the next-action.

Instead of jumping:
   say "The stored action is [the next-action of the player].";
   stop.

test me with "jump".


Which gives the very ugly output of:

Code:
The stored action is the your former self waiting.

Anybody have any ideas about what's up here, and how one could ward off all references to "your former self."


Top
 Profile Send private message  
Reply with quote  
PostPosted: Fri Aug 10, 2018 5:52 pm 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 5768
Quote:
I've read different things saying that "your former self" is the name that I7 gives to "yourself" when you switch to another player.


That's correct.

Your sample code doesn't surprise me. The default value for stored actions is "yourself waiting", and after the switch, "yourself" is printed as "your former self".

If you remove the previous player object from play, there aren't a lot of ways that "your former self" could possibly be printed. If you don't do that thing with the stored action, that is.

What references are you trying to ward off?


Top
 Profile Send private message  
Reply with quote  
PostPosted: Fri Aug 10, 2018 6:03 pm 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 5768
The "your former self" text is a response -- print protagonist internal rule response C. So you could change it with the usual response tools to something else, perhaps "somebody" or "John Doe".


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sat Aug 11, 2018 9:53 am 
Offline
User avatar

Joined: Sun May 21, 2017 4:59 pm
Posts: 282
Location: Michigan
This bit seems to solve the immediate issue, but I don't know if it covers everything you want:

Code:
The Void is a room. The player is in The Void.

The Parlor is a room. Alice, Bob, Claire, Dave, and Eve are people in the parlor.

When play begins:
    Now the player is Alice;
    let prevname be the printed name of the player;
    Now the printed name of yourself is prevname;
    let the subject be a random person in the parlor;
    now the player is the subject;

A person has a stored action called the next-action.

Instead of jumping:
    let prevname be the printed name of the player;
    Now the printed name of yourself is prevname;
    let the subject be a random person in the parlor;
    now the player is the subject;
    say "The stored action is [the next-action of the player].";
    stop.

test me with "jump".


Somewhat kludgy, but there you go. Output:

Code:
Testing
An Interactive Fiction by "Phillip J Rhoades" The story headline is "A testbed"
Release 1 / Serial number 180811 / Inform 7 build 6M62 (I6/v6.33 lib 6/12N) SD

Parlor
You can see Alice, Bob, Claire and Eve here.

>jump
The stored action is Dave waiting.

>look
Parlor
You can see Alice, Bob, Claire and Dave here.

>jump
The stored action is Eve waiting.

>look
Parlor
You can see Alice, Bob, Claire and Eve here.

>

_________________
~~~
My ebooks on Amazon
My ebooks on Smashwords


Last edited by howtophil on Sat Aug 11, 2018 9:56 am, edited 1 time in total.

Top
 Profile Send private message  
Reply with quote  
PostPosted: Sat Aug 11, 2018 9:55 am 
Offline
User avatar

Joined: Sun May 21, 2017 4:59 pm
Posts: 282
Location: Michigan
You might be able to clean that up a bit to make it work, or at least it might get you going in the right direction. Best of luck. :)

_________________
~~~
My ebooks on Amazon
My ebooks on Smashwords


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sat Aug 11, 2018 11:18 am 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 5384
Location: Burlington, VT
One thing about the original code is that when you declare "The player is Alice," it automatically starts the "yourself" object out of play. I think this must be some special-casing wizardry--in the Index "yourself" appears in The Parlor, but if you do "showme yourself" on the first turn it's nowhere.

As zarf said, that means that there aren't many occasions where "your former self" will be printed. The reason it prints in your code is because you never set an initial value for the next-action, which means it gets the default value for stored actions--and the actor part of the default value for stored actions is the "yourself" object. You could change that particular thing by specifying a different default:

Code:
The next-action of a person is usually Alice waiting.

[EDIT: This next part was wrong; see post below.] Note that, in default Inform, you can only specify stored actions either by literally specifying them in full ("Alice waiting," "Claire kissing Bob") or getting them out of "the current action" or another stored action variable. (I think "the current action" is the only other option.) If you want to be able to do something like set the next-action of every person to that person waiting, you need the extension Editable Stored Actions by Ron Newcomb, which does seem to be working for the latest version of Inform.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sat Aug 11, 2018 12:05 pm 
Offline

Joined: Mon Dec 15, 2014 9:15 am
Posts: 344
I don't think you need Editable Stored Actions for that. This seems to work.
Code:
When play begins: 
   repeat with Joe running through people:
      now the next-action of Joe is Joe waiting.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sat Aug 11, 2018 4:57 pm 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 5384
Location: Burlington, VT
Ah! I was trying to do it the other way around, by changing "the actor of the next-action," which I guess is something that can only be evaluated rather than changed. But it does seem like you can use a variable in the specification of the action. That's very useful to know!


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sun Aug 12, 2018 1:05 pm 
Offline

Joined: Wed Aug 13, 2008 11:39 am
Posts: 37
Thanks for all this. This is really helpful.

Just so I understand stored actions closer to correctly, am I right to think:

1. That there isn't a way to have a stored action without a specified actor? (My use case for this would be something displaying the action. My assumption is that I'd have to instead have phrase that splices together the action name part and noun part of the stored action.

2. That in order to basically copy person A's action to person B, I would have to use the Editable Stored Actions extension that was mentioned. That is, otherwise there isn't a way to elaborate Zarf's example to the equivalent of:

Code:
When play begins:
    repeat with X running through people:
        now the next-action of X is ((X doing the next-action of person Y))


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sun Aug 12, 2018 2:41 pm 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 5768
Quote:
That there isn't a way to have a stored action without a specified actor?


A stored action always has an actor.

When *saying* a stored action, the actor is omitted (in the printed output) if it's the same as the player. So if your goal is to print the stored action in game output, you might need to use the Editable Stored Actions trick.


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ]  Go to page 1, 2  Next

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 9 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