intfiction.org

The Interactive Fiction Community Forum
It is currently Mon Dec 17, 2018 8:32 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Thu Jul 05, 2018 6:04 am 
Offline

Joined: Thu Mar 22, 2018 3:34 pm
Posts: 33
Hi everyone! In my IF I have a pitchfork and I need to put a feather on it. I wrote this:
Code:
the pitchfork is in room1. "A pitchfork made of wood and iron. Its teeth are dirty with blood and feathers.".
the feather is on the pitchfork. "A bloodstained black feather.".


If I only write about the pitchfork, It (the pitchfork) can be taken and be carried by the player. But if I write also the second line about the feather, the pitchfork cannot be taken anymore. Why this? is it wrong the "on" preposition? I need that if the player doesn't take tha feather but takes the pitchfork and then he change room, he can take the feather anyway... What can I do to fix this?
Bye!


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu Jul 05, 2018 7:03 am 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 5447
Location: Burlington, VT
There's nothing wrong with your code so far! When you write "the feather is on the pitchfork" Inform figures out that the pitchfork has to be a supporter. Supporters are by default fixed in place (often they're things like tables), but you can change that by explicitly saying they're "portable":

Code:
The pitchfork is portable.


You can read more about this in §3.7 of Writing with Inform.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu Jul 05, 2018 7:21 am 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 5447
Location: Burlington, VT
...though a side effect of having the pitchfork be a supporter is that you will be able to put anything whatsoever on the pitchfork. You might not want this. If you don't, you could make the feather part of the pitchfork; then the feather will come along with the pitchfork when you move it.

Code:
The feather is part of the pitchfork.


But if you do this, you will find that the player can't take the feather.

Quote:
>take feather
That seems to be a part of the pitchfork.

>


The way to get around this is to figure out what rule is preventing the taking action from working. We can do this by typing "rules" at the game prompt and then trying the action. This will list all the rules that are being tried:

Quote:
>rules
Rules tracing now switched on. Type "rules off" to switch it off again, or "rules all" to include even rules which do not apply.

>take feather
[Rule "declare everything initially unmentioned rule" applies.]
[Rule "announce items from multiple object lists rule" applies.]
[Rule "set pronouns from items from multiple object lists rule" applies.]
[Rule "before stage rule" applies.]
[Rule "instead stage rule" applies.]
[Rule "investigate player's awareness before action rule" applies.]
[Rule "player aware of his own actions rule" applies.]
[Rule "check stage rule" applies.]
[Rule "can't take yourself rule" applies.]
[Rule "can't take other people rule" applies.]
[Rule "can't take component parts rule" applies.]
That seems to be a part of the pitchfork.

[Rule "A first turn sequence rule" applies.]
[Rule "every turn stage rule" applies.]
[Rule "A last turn sequence rule" applies.]
[Rule "notify score changes rule" applies.]
>


It's the "can't take component parts" rule that is stopping the action. So we turn that rule off for the specific case of taking the feather:

Code:
The can't take component parts rule does nothing when taking the feather.


Not really related, but when you put text in quotation marks right after an object name like that, it usually creates an initial appearance property, which shows up in the room description, rather than the description, which shows up when you examine it. You probably want the description here. You can specify that explicitly:

Code:
The description of the pitchfork is "A pitchfork made of wood and iron. Its teeth are dirty with blood and feathers."


...and it might be nice to allow "blood" and "feathers" to refer to the feather so the player is directed to the words that will let them refer to the object, and to give the feather a different description depending on whether it's on the pitchfork. So:

Code:
room1 is a room. 

the pitchfork is in room1. The description of the pitchfork is "A pitchfork made of wood and iron. Its teeth are dirty with blood and feathers."

the feather is part of the pitchfork.
The description of the feather is "[if the feather is part of the pitchfork]One particular bloodstained black feather sticks up from the pitchfork[otherwise]A bloodstained black feather[end if]."
Understand "blood" or "feathers" as the feather.

The can't take component parts rule does nothing when taking the feather.


Quote:
room1
You can see a pitchfork here.

>x pitchfork
A pitchfork made of wood and iron. Its teeth are dirty with blood and feathers.

>x blood
One particular bloodstained black feather sticks up from the pitchfork.

>x feathers
One particular bloodstained black feather sticks up from the pitchfork.

>take feather
Taken.

>i
You are carrying:
a feather

>x feather
A bloodstained black feather.


(You might also want to create a special object for the leftover feathers, which starts out of play but becomes part of the pitchfork once you've taken the black feather, so the player can look at the rest of the feathers once they've got the black one. But that's for another time, perhaps.)


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu Jul 05, 2018 1:35 pm 
Offline

Joined: Thu Mar 22, 2018 3:34 pm
Posts: 33
matt w wrote:
...though a side effect of having the pitchfork be a supporter is that you will be able to put anything whatsoever on the pitchfork. You might not want this. If you don't, you could make the feather part of the pitchfork; then the feather will come along with the pitchfork when you move it.

Code:
The feather is part of the pitchfork.


But if you do this, you will find that the player can't take the pitchfork.

Quote:
>take feather
That seems to be a part of the pitchfork.

>


The way to get around this is to figure out what rule is preventing the taking action from working. We can do this by typing "rules" at the game prompt and then trying the action. This will list all the rules that are being tried:

Quote:
>rules
Rules tracing now switched on. Type "rules off" to switch it off again, or "rules all" to include even rules which do not apply.

>take feather
[Rule "declare everything initially unmentioned rule" applies.]
[Rule "announce items from multiple object lists rule" applies.]
[Rule "set pronouns from items from multiple object lists rule" applies.]
[Rule "before stage rule" applies.]
[Rule "instead stage rule" applies.]
[Rule "investigate player's awareness before action rule" applies.]
[Rule "player aware of his own actions rule" applies.]
[Rule "check stage rule" applies.]
[Rule "can't take yourself rule" applies.]
[Rule "can't take other people rule" applies.]
[Rule "can't take component parts rule" applies.]
That seems to be a part of the pitchfork.

[Rule "A first turn sequence rule" applies.]
[Rule "every turn stage rule" applies.]
[Rule "A last turn sequence rule" applies.]
[Rule "notify score changes rule" applies.]
>


It's the "can't take component parts" rule that is stopping the action. So we turn that rule off for the specific case of taking the feather:

Code:
The can't take component parts rule does nothing when taking the feather.


Not really related, but when you put text in quotation marks right after an object name like that, it usually creates an initial appearance property, which shows up in the room description, rather than the description, which shows up when you examine it. You probably want the description here. You can specify that explicitly:

Code:
The description of the pitchfork is "A pitchfork made of wood and iron. Its teeth are dirty with blood and feathers."


...and it might be nice to allow "blood" and "feathers" to refer to the feather so the player is directed to the words that will let them refer to the object, and to give the feather a different description depending on whether it's on the pitchfork. So:

Code:
room1 is a room. 

the pitchfork is in room1. The description of the pitchfork is "A pitchfork made of wood and iron. Its teeth are dirty with blood and feathers."

the feather is part of the pitchfork.
The description of the feather is "[if the feather is part of the pitchfork]One particular bloodstained black feather sticks up from the pitchfork[otherwise]A bloodstained black feather[end if]."
Understand "blood" or "feathers" as the feather.

The can't take component parts rule does nothing when taking the feather.


Quote:
room1
You can see a pitchfork here.

>x pitchfork
A pitchfork made of wood and iron. Its teeth are dirty with blood and feathers.

>x blood
One particular bloodstained black feather sticks up from the pitchfork.

>x feathers
One particular bloodstained black feather sticks up from the pitchfork.

>take feather
Taken.

>i
You are carrying:
a feather

>x feather
A bloodstained black feather.



Wow, amazing! exactly what I was looking for! thank you very very much, you saved me many times!
Quote:
(You might also want to create a special object for the leftover feathers, which starts out of play but becomes part of the pitchfork once you've taken the black feather, so the player can look at the rest of the feathers once they've got the black one. But that's for another time, perhaps.)

No, no, I only needed this, but thank you anyway! :D


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

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users 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