intfiction.org

The Interactive Fiction Community Forum
It is currently Mon Oct 23, 2017 1:12 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: New and need help
PostPosted: Wed Jan 11, 2017 3:39 am 
Offline

Joined: Tue Jan 10, 2017 3:40 pm
Posts: 3
I am just getting started and I am having trouble finding answer to what is likely simple problems.

- I have the player starting on a road with a broken down car. I want them to have to smash a window with a stick to get the items inside. How do I do this?
- How do I keep items or objects hidden until the player searches?

Thanks for any help.


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: New and need help
PostPosted: Wed Jan 11, 2017 8:05 am 
Offline

Joined: Mon Dec 15, 2014 9:15 am
Posts: 205
Code:
"Car" by "JRB".

The Road is a room.

The car is an enterable container in the road. The car is closed. The window is part of the car.

The big stick is a thing in the road.

Rule for writing a paragraph about the car:
        say "An old car sits here idly rusting. [if the car is closed]It's locked up, but you can't see anything valuable inside it from here[otherwise]The windscreen is broken, and you could search inside it if you wanted to[end if]."

Breaking it with is an action applying to one thing and one carried thing.
Understand "break [a thing] with [a thing]", "smash [a thing] with [a thing]" and "hit [a thing] with [a thing]" as breaking it with.
Instead of attacking the window:
        if the big stick is carried:
                try breaking the window with the big stick;
        otherwise:
                say "You're not holding anything suitable for that."
Carry out breaking the window with the big stick:
        remove the window from play;
        now the car is open.
Report breaking the window with the big stick:
        say "Smash! There is fragmented windscreen glass everywhere."

The set of keys is a thing.
Carry out searching the car for the first time:
   now the keys are in the car;
   say "You find a set of keys in the compartment."


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: New and need help
PostPosted: Wed Jan 11, 2017 2:01 pm 
Offline

Joined: Fri Oct 18, 2013 10:13 am
Posts: 2451
Location: The Midwest
(If you use "attack" instead of "break" as your main verb, it'll include all the other synonyms like "hit", "break", etc automatically.)

_________________
Daniel Stelzer


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: New and need help
PostPosted: Wed Jan 11, 2017 3:29 pm 
Offline

Joined: Mon Dec 15, 2014 9:15 am
Posts: 205
Good catch. I didn't know that.


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: New and need help
PostPosted: Thu Jan 12, 2017 1:35 am 
Offline

Joined: Tue Jan 10, 2017 3:40 pm
Posts: 3
Jrb, I really appreciate your help and how quickly you responded. This is what I wrote:

Code:
When play begins:
   Say "Oh great...

In your hurry to get to your friend's house before supper you were not paying attention to the red engine light going off. Now your car has broken down in the middle of nowhere.

You hear a crack of thunder. Examing your options you decide to head down the street hoping to either flag down a car or find a gas station to make a call."

The Lonely road is a room."You are on the lonely road in front of your crappy, broken down car. You hear a crack of thunder in the distance."
A car is an enterable container in the Lonely road. The car is closed. The window is part of the car.  The car is fixed in place.
Rule for writing a paragraph about the car:
   Say "Your useless crap car is sitting here. [If the car is closed] You can see your stuff through the window. [otherwise] your useless crap car is now even crappier with a smashed window. At least now you can get your stuff.[end if]"
Breaking it with is an action applying to one thing and one carried thing.
Understand "break [a thing] with [a thing]", "smash [a thing] with [a thing]" and "hit [a thing] with [a thing]" as breaking it with.
Instead of breaking the window:
   if the Heavy branch is carried:
      Try breaking the window with the Heavy branch;
      otherwise:
         say "What are you gonna break it with? your forehead?"
Carry out breaking the window with the Heavy branch:
            remove the window from play.
            now the car is open.
Report breaking the window with the Heavy branch:
   say: "You break the window, now your car is even more worthless."
   A map, gum and flashlight are in the car.
   Carry out searching the car for the first time:
      now the map, gum and flashlight are in the car;
      say: "You find your stuff sitting losely on the car floor."


A heavy branch is in the Lonely road. The description of the Heavy branch is "It must have fallen off a dead tree."

The description of the map is "This thing is impossible to understand."
The description of the gum is "Mmmm... mint!"
The description of the flashlight is "Good thing I just put in fresh batteries."

Instead of going north in the Lonely road, say "It would take hours to go back the way you came."
Instead of going east in the Lonely road, say "Nothing but woods. You are no outdoors person and they would surely find you dead before you got anywhere."
Instead of going west in the Lonely road, say "A steep cliff. I doubt Superman is around to catch you."



The South road is south of Lonely road.
A creepy house is here. The description of the creepy house is "You stand before a creepy abandoned house that is mostly hidden by trees and overgrowth."
A wood door is south of the South road. The wood door is closed and locked. The wood door is a door.


I am still getting errors and unsure why.

Thanks for everyone's help and I appreciate your patience.


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: New and need help
PostPosted: Thu Jan 12, 2017 11:07 am 
Offline

Joined: Mon Dec 15, 2014 9:15 am
Posts: 205
Firstly, looks like there's a problem with your indentations in the "Instead of breaking the window" rule. The "otherwise" needs to have the same indentation as the "if" that it's responding to.

Your "rule for writing a paragraph about the car" needs a closing period or blank line. (A final period inside the " " works, and is actually best because otherwise the line-breaking may come out wrong. So just get rid of the periods in the two [if] cases, and put one after the [end if] instead.)

In two places you have a : after say which shouldn't be there.

You don't want the map, gum and flashlight to be in the car until the player searches it. (Counter-intuitive maybe, but trust me.) So just say "The map, the gum and the flashlight are things." This will create them, but won't put them anywhere yet.

It looks like Inform is objecting to "now the map, the gum and the flashlight are in the car;". I'm not sure why, but never mind. You can separate it into three statements: "now the map is in the car; now the gum is in the car; now the flashlight is in the car;".

Try putting those things right, and see if you're still getting errors. if you are, let us know what they say.

As Draconis said above, you can get rid of the line
Code:
"Understand "break [a thing] with [a thing]", "smash [a thing] with [a thing]" and "hit [a thing] with [a thing]" as breaking it with."
and replace it with
Code:
 Understand "attack [a thing] with [a thing]" as breaking it with.
You will get all the synonyms for free.


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: New and need help
PostPosted: Thu Jan 12, 2017 1:08 pm 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 5082
Location: Burlington, VT
jrb wrote:
It looks like Inform is objecting to "now the map, the gum and the flashlight are in the car;". I'm not sure why, but never mind. You can separate it into three statements: "now the map is in the car; now the gum is in the car; now the flashlight is in the car;".


This is consistent with the way Inform treats conditions (that can be checked with "if" phrases and the like); you have to write out complete sentences. So if you were doing an if test you'd have to write:

Code:
if the map is in the car and the gum is in the car and the flashlight is in the car:


rather than

Code:
If the map, the gum and the flashlight are in the car:


Although "the map, the gum and the flashlight are in the car" has a clear English meaning, Inform doesn't know how to break this up properly; you have to have complete sentences on either side of the "and."

Since "Now..." always has to be followed by a condition (see Writing with Inform ยง8.11), you also have to write out the complete sentences if you want to do a "now." (And you have to put them in separate "now" statements because, as the compiler explains, "Inform can only make one wish come true at a time.")

You can use the abbreviated form in initial declarations like

Code:
A map, gum and flashlight are in the car.


(though as jrb said you don't actually want that line) but in most other cases you need to write out the complete sentence.


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: New and need help
PostPosted: Thu Jan 12, 2017 1:21 pm 
Offline

Joined: Mon Dec 15, 2014 9:15 am
Posts: 205
Yes, you're right, it does make sense. (Though I'm guess I'm still not sure why the condition syntax is different from the statement syntax.)


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: New and need help
PostPosted: Fri Jan 13, 2017 1:13 pm 
Offline

Joined: Tue Nov 08, 2011 8:11 am
Posts: 2182
Location: US - Central
Peripheral question: Is there a plot reason that the player needs to break into their own car that they were just driving?

I know you're not to story troubleshooting yet, but it seemed odd! Was the player so concerned about breaking down that they accidentally locked the keys in the car?


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: New and need help
PostPosted: Wed Jan 18, 2017 12:35 am 
Offline

Joined: Tue Jan 10, 2017 3:40 pm
Posts: 3
HanonO wrote:
Peripheral question: Is there a plot reason that the player needs to break into their own car that they were just driving?

I know you're not to story troubleshooting yet, but it seemed odd! Was the player so concerned about breaking down that they accidentally locked the keys in the car?


Partly to give the player a chance to learn the mechanics, and partly because they broke down and in a fit of pique forgot to get their keys before shutting the door.


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

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 3 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