intfiction.org

The Interactive Fiction Community Forum
It is currently Thu Oct 18, 2018 10:54 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Sun Oct 07, 2018 10:51 pm 
Offline

Joined: Sun Oct 07, 2018 10:37 pm
Posts: 3
Hello, I'm a bit new to inform as I am trying to make my own story but I have hit a couple of snags.

My main problem is that I can't find a way to give the player items:

So in this story, the player must fold paper into a paper key (cause that makes sense), but I can't find a way to give him the paper key:


Check folding:
if the five star paper is not carried:
say "What are you gonna fold? The air? Well you can Mr Choi but that's not the point.";

Carry out folding:
say "Mr Choi uses his nimble and percise hands to fold the key to the lock only by looking at the keyhole.";
remove the noun from play;
/this is the area of trouble/;

Understand "fold [something]" as folding. Folding is an action applying to one thing.




Furthermore, is there a way to disable the automatic description the game gives you in certain rooms?


Thank you if you can help
~ Beginner


Top
 Profile Send private message  
Reply with quote  
PostPosted: Mon Oct 08, 2018 10:07 am 
Offline
User avatar

Joined: Tue Nov 08, 2011 8:11 am
Posts: 2642
Location: US - Central
Within a rule, just declare it using "now".

Code:
The paper key is a thing.
The unfolded paper is a thing. It is carried by the player.

Check folding:
     if the noun is not the unfolded paper:
          say "Folding that wouldn't accomplish anything useful." instead.

Carry out folding the unfolded paper:
     remove the unfolded paper from play;
     now the player carries the paper key.

Report folding the unfolded paper:
     say "Mr. Choi uses his nimble and precise hands to fold the key to the lock only by looking at the keyhole.";


(This assumes you have already defined "folding" as an action applying to one thing, preferably held.)

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


Top
 Profile Send private message  
Reply with quote  
PostPosted: Mon Oct 08, 2018 8:31 pm 
Offline

Joined: Sun Oct 07, 2018 10:37 pm
Posts: 3
Thanks for the huge help. I also don't know how to turn off the automatic descriptions that a room gives you when you enter it, like when you enter a room and it says: "You can see a Storage Closet door here."

Is it possible to disable that?


Top
 Profile Send private message  
Reply with quote  
PostPosted: Mon Oct 08, 2018 8:46 pm 
Offline
User avatar

Joined: Sun May 21, 2017 4:59 pm
Posts: 282
Location: Michigan
Davuuu wrote:
Thanks for the huge help. I also don't know how to turn off the automatic descriptions that a room gives you when you enter it, like when you enter a room and it says: "You can see a Storage Closet door here."

Is it possible to disable that?


Code:
Rule for listing nondescript items: do nothing.


See this page: http://inform7.com/learn/man/WI_18_25.html

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


Top
 Profile Send private message  
Reply with quote  
PostPosted: Mon Oct 08, 2018 9:20 pm 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 5384
Location: Burlington, VT
The other thing is that, if you want something specific that will always be in the room to be excluded from the "You can also see" sentence, you can declare it "scenery." See http://inform7.com/learn/man/WI_3_8.html.

So if you write:

Code:
The Storage Closet Door is a scenery door.


then it won't show up after the room description. (Which means you'd better put it in the room description!)


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sun Oct 14, 2018 7:36 pm 
Offline

Joined: Sun Oct 07, 2018 10:37 pm
Posts: 3
This code is not working, the program I use says it's because of the if statement in the check but I do not understand how to change it.

"Test Me Daddy"

The aa is a room.
The Metal Door is a locked closed door. the Metal door is east of the aa. The Metal Door is west of the b.
The b is a room.

Understand "press [something] with [a number]" as pressing it with. Pressing it with is an action applying to one thing and one number.

Check pressing it with:
if the noun is not the the Metal Door, say "Of course Mr Choi would have his reasons for pressing [the noun], but it yielded no results"

After pressing the Metal Door with 972:
now the Metal Door is open.

Report pressing it with:
say "The Door unlocks and opens revealing the Chemical Lab".


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sun Oct 14, 2018 8:49 pm 
Offline
User avatar

Joined: Sun May 21, 2017 4:59 pm
Posts: 282
Location: Michigan
It compiles and runs in inform 7 for me...

Though any number at all results in the report saying "The Door unlocks and opens revealing the Chemical Lab"

Here's my attempt at a rework of what you've got going...

Code:
The aa is a room.
The Metal Door is a locked closed door.
The Metal door is east of the aa.
The Metal Door is west of the b.
The b is a room.
The cat is in b.

Understand "press [something] with [a number]" as pressing it with.
Pressing it with is an action applying to one thing and one number.

Check pressing it with:
   if the noun is not the the Metal Door:
      say "Of course Mr Choi would have his reasons for pressing [the noun], but it yielded no results";
   else:
      say "You enter the number on the door".

After pressing the Metal Door with 972:
   now the Metal Door is open;
   say "The Door unlocks and opens revealing the Chemical Lab".

After pressing the Metal Door with:
   say "BUZZ! BUZZ! Wrong number!".


Example output:

Code:
aa
You can see a Metal Door here.

>press door with 5555
You enter the number on the door
BUZZ! BUZZ! Wrong number!

>press door with 972
You enter the number on the door
The Door unlocks and opens revealing the Chemical Lab
>e

b
You can see a Metal Door and a cat here.

>press cat with 5555
Of course Mr Choi would have his reasons for pressing the cat, but it yielded no results
>

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


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sun Oct 14, 2018 8:57 pm 
Offline
User avatar

Joined: Sun May 21, 2017 4:59 pm
Posts: 282
Location: Michigan
And this would let you reference the number pressed in your response:

Code:
After pressing the Metal Door with a number (called code):
   say "BUZZ! BUZZ! [code] is the wrong number!".

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


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

All times are UTC - 6 hours [ DST ]


Who is online

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