intfiction.org

The Interactive Fiction Community Forum
It is currently Tue Nov 21, 2017 10:48 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Wed Oct 18, 2017 11:48 am 
Offline

Joined: Mon Dec 07, 2009 9:14 am
Posts: 174
Location: Chicago, IL
Maybe this is interesting, maybe not. Consider the following:

Code:
The Test Lab is a room.
The Lobby is a room.

The cleanroom airlock is north of the Lobby and south of the Test Lab.
It is a locked door.
The cleanroom airlock is scenery.

The player is carrying a quantum macro-tunneler.
The quantum macro-tunneler is wearable.
Understand "tunneler" and "macro-tunneler" and "macro tunneler" as the quantum macro-tunneler.

The can't go through closed doors rule does nothing when the quantum macro-tunneler is worn.

The block giving rule is not listed in the check giving it to rules.

Kitty Pryde is a woman in the Test Lab.

Persuasion rule for asking Kitty Pryde to try doing something:
   persuasion succeeds.

Now let's try the player going through the locked door while wearing the tunneler:

Quote:
Test Lab
You can see Kitty Pryde here.

>actions
Actions listing on.

>wear tunneler
[wearing the quantum macro-tunneler]
You put on the quantum macro-tunneler.
[wearing the quantum macro-tunneler - succeeded]

>s
[going south]

Lobby
[going south - succeeded]

>

Okay. Start a new game. Let's try the same thing with Kitty.

Quote:
Test Lab
You can see Kitty Pryde here.

>actions
Actions listing on.

>give kitty tunneler
[giving the quantum macro-tunneler to Kitty Pryde]
You give the quantum macro-tunneler to Kitty Pryde.
[giving the quantum macro-tunneler to Kitty Pryde - succeeded]

>kitty, wear tunneler
[asking Kitty Pryde to try wearing the quantum macro-tunneler]
[(1) Kitty Pryde wearing the quantum macro-tunneler]
Kitty Pryde puts on the quantum macro-tunneler.
[(1) Kitty Pryde wearing the quantum macro-tunneler - succeeded]

[asking Kitty Pryde to try wearing the quantum macro-tunneler - succeeded]

>kitty, go south
[asking Kitty Pryde to try going south]
[(1) Kitty Pryde going south]
[(2) Kitty Pryde opening the cleanroom airlock - silently]
[(2) Kitty Pryde opening the cleanroom airlock - silently - failed the can't open what's locked rule]

[(1) Kitty Pryde going south - failed the can't go through closed doors rule]

Kitty Pryde is unable to do that.
[asking Kitty Pryde to try going south - succeeded]

>

Notice how Kitty is stopped by the "can't open what's locked rule." Why wasn't the player character stopped up by this since it happens before the "can't go through closed doors rule"?


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Oct 18, 2017 11:54 am 
Offline

Joined: Tue Nov 08, 2011 8:11 am
Posts: 2229
Location: US - Central
Code:
The can't go through closed doors rule does nothing when the quantum macro-tunneler is worn.

I think "is worn" only applies to the player. I bet Kitty will succeed if the player wears the tunneller.

I may be wrong, but I think you need something like

Code:
The can't go through closed doors rule does nothing when the quantum macro-tunneler is worn by the person asked.

_________________
http://hanonondricek.wixsite.com/pyramidif
https://pyramidif.itch.io


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Oct 18, 2017 12:10 pm 
Offline

Joined: Mon Dec 07, 2009 9:14 am
Posts: 174
Location: Chicago, IL
Yep, good call. That does the trick. I found I can also do this:

Code:
The can't go through closed doors rule does nothing when the quantum macro-tunneler is worn by anyone.

Thanks for the assist!


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Oct 18, 2017 1:35 pm 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 5116
Location: Burlington, VT
Jeff Nyman wrote:
Yep, good call. That does the trick. I found I can also do this:

Code:
The can't go through closed doors rule does nothing when the quantum macro-tunneler is worn by anyone.

Thanks for the assist!


Although that will let Kitty go through the closed door when the player wears the macro-tunneler, or vice versa.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Oct 18, 2017 2:35 pm 
Offline

Joined: Mon Dec 07, 2009 9:14 am
Posts: 174
Location: Chicago, IL
Indeed. Yeah, I'm actually doing a few things to point out "issues in programming", where intention and code do not exactly match up. So this was an example where the ACTIONS or RULES command may not have helped you diagnose what was happening. And the distinction of "by anyone" and "by person asked" is an example of a (perhaps subtle) bug.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Oct 18, 2017 4:54 pm 
Offline

Joined: Tue Nov 08, 2011 8:11 am
Posts: 2229
Location: US - Central
I'm not sure that's a bug. It is the same type of syntax difference as

Code:
Check jumping:

Check an actor jumping:

If the cloak of darkness is worn:

If the cloak of darkness is worn by someone:

Sometimes it's necessary to distinguish when the rules do or do not also apply to NPCs. With actions and persuasion it happens to be phrased as "by the person asked"

(And sorry if I've misinterpreted what you mean. I tend to do that frequently.)

_________________
http://hanonondricek.wixsite.com/pyramidif
https://pyramidif.itch.io


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Oct 18, 2017 9:32 pm 
Offline

Joined: Sun Oct 11, 2015 5:09 pm
Posts: 276
It's not a bug. The questions, "is the hat currently being worn by anyone?" and "is the hat currently being worn by the person performing the action?" are asking two distinctly different things.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Oct 18, 2017 9:56 pm 
Offline

Joined: Fri Oct 18, 2013 10:13 am
Posts: 2468
Location: The Midwest
I think Jeff meant that it would be the source of a subtle bug in the resulting game. Realizing that anyone can go through the door while anyone is wearing the tunneler is the sort of thing that I might spend hours trying to reproduce, if the game involved NPCs wandering around doing things on their own.

_________________
Daniel Stelzer


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu Oct 19, 2017 3:57 am 
Offline

Joined: Mon Dec 07, 2009 9:14 am
Posts: 174
Location: Chicago, IL
Ah, yes, Draconis was correct here and I was unclear. I meant it's possible to introduce subtle bugs into your game that may be hard to find.

If anything, speaking of other odd things that may look like bugs, consider that the PC was not stopped up by the "can't open what's locked rule" in my original example whereas the NPC (Kitty Pryde) was. So Kitty Pryde has this problem:

failed the can't open what's locked rule
failed the can't go through closed doors rule

But the player character has a rule that does nothing only for the "can't go through closed doors rule" -- yet, that shouldn't (at first glance) have had any effect on the "can't open what's locked rule." So it's these kind of interesting situations I'm looking for.


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: No registered users and 5 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