intfiction.org

The Interactive Fiction Community Forum
It is currently Wed Jun 19, 2013 1:03 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 59 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next
Author Message
PostPosted: Mon Apr 23, 2012 6:48 am 
Offline
User avatar

Joined: Sun Mar 27, 2011 9:01 am
Posts: 115
Location: South Australia
Sorry to clutter things up, but the other thread is a bit full. This weeks task:
Make a jetpack

That's all - you can make of this what you will. For those that aren't big on jetpacks (if people like that really exist =p) any kind of flying vehicle / article / etc will do the trick. Go!

PS - If a week is too short a time, no worries, we can make it a fortnight if people prefer.

_________________
Ever stop to think and forget to start again?


Top
 Profile Send private message  
 
PostPosted: Mon Apr 23, 2012 11:44 am 
Offline

Joined: Wed Feb 29, 2012 2:00 pm
Posts: 706
Interesting puzzle. Reminds me of little nellie!

_________________
"Will you stop breaking the fourth wall? It's costing me an absolute fortune to replace it!"


Top
 Profile Send private message  
 
PostPosted: Mon Apr 23, 2012 3:10 pm 
Offline
User avatar

Joined: Wed Feb 03, 2010 4:25 pm
Posts: 265
Location: Sweden
Tanga wrote:
Sorry to clutter things up, but the other thread is a bit full.

I think a new thread for each task is a very good idea.

_________________
"The thing I like about deadlines is the wonderful whooshing noise they make as they go past."
- Douglas Adams


Top
 Profile Send private message  
 
PostPosted: Mon Apr 23, 2012 3:18 pm 
Offline
User avatar

Joined: Sat May 08, 2010 9:25 pm
Posts: 1004
Location: The Seattle Massive
Trumgottist wrote:
Tanga wrote:
Sorry to clutter things up, but the other thread is a bit full.

I think a new thread for each task is a very good idea.

Agreed. One new thread per week is hardly clutter.


Top
 Profile Send private message  
 
PostPosted: Mon Apr 23, 2012 3:44 pm 
Offline
User avatar

Joined: Wed Nov 30, 2011 2:43 am
Posts: 228
I think the problem on this forum in general is not too many threads, but long threads with meaningless like "I just have this question..." or "can you help?"


Top
 Profile Send private message  
 
PostPosted: Mon Apr 23, 2012 9:22 pm 
Offline

Joined: Fri May 06, 2011 7:15 pm
Posts: 489
Location: The Big Apple
I've taken a crack at this, but need a bit of guidance as to how to post my code. It's a bit long to include as part of a normal post. I see that some other people have used playfic -- could somebody explain how to go about using that?

Sorry of this is quite basic, but it's not someting I've done before.

Thanks.


Robert Rothman


Top
 Profile Send private message  
 
PostPosted: Tue Apr 24, 2012 12:27 am 
Offline
User avatar

Joined: Mon Oct 03, 2011 12:03 pm
Posts: 645
Location: Stoke Barehills
Hey Robert:

1. Go to playfic.com
2. Set up an account
3. Start a new game
4. Paste your code into the box
5. Give the game a title
6. Click 'save and test'
7. Click 'publish'
This will give a link pointing to a playable version of your game and its source, so:
8. Copy the link and paste it in a post here on the forum.


Top
 Profile Send private message  
 
PostPosted: Tue Apr 24, 2012 12:40 am 
Offline

Joined: Fri May 06, 2011 7:15 pm
Posts: 489
Location: The Big Apple
Thanks.

My quick and dirty implementation of a JetPack is at http://playfic.com/games/RobRothman/jetpack-demo

Robert Rothman


Top
 Profile Send private message  
 
PostPosted: Tue Apr 24, 2012 8:48 pm 
Offline

Joined: Wed Jan 19, 2011 3:36 pm
Posts: 99
@Robert: The actual jetpack seems to work fine.

A couple of points of style:
Code:
Report wearing the jetpack:
   Say "You slip the harness over your shoulders.  It does not seem to fit quite right.";
   Stop the action.
You probably want to use an "after" rule here.
Code:
End the game in death.
This is deprecated; use "End the story saying..." instead (yes, it is less convenient, but the old form may be withdrawn eventually)
To check for deprecated code like that, write this at the top of your program:
Code:
Use no deprecated features.

At least one of the ocean rooms has a description not matching the physical layout of the rooms, leading to this:
Quote:
South of Nowhere
You are in the air above a completely nondescript piece of land. The land extends to your north, and there is apparently endless water on all other sides.

>w

Ocean
You are in the air above a large body of water. You can see land to the west.

>w
You can't go that way.
For a large number of oceans, it might make more sense to have a single "dead end ocean" room and track where the player came from, instead of having lots of separate rooms that you have to keep identical. For a medium sized case (a typical game), you can create a kind of room and have it automagically generate its name and description:
Code:
Leading-from relates a direction (called D) to a room (called R) when the room-or-door D from R is not nothing.

The verb to lead from (it leads from, they lead from, it led from, it is led from, it is leading from) implies the leading-from relation.

An ocean is a kind of room.  An ocean is always wet.  The printed name of an ocean is usually "Ocean".  The description of an ocean is usually "You are in the air above a large body of water.  You can see land to [the list of directions which lead from the location]."
Just make sure every ocean is connected to something and it will produce sensible output. If you're going to allow the player to go up and down as well, just change the "list of directions" to "list of horizontal directions" and add this:
Code:
A direction can be horizontal or vertical.  A direction is usually horizontal.  The up and the down are vertical.

And finally, a somewhat less relevant issue:

You could not realistically use this code in a "real" game of IF, because it's far too easy to produce unwinnable situations (by running out of fuel), unless you provide a refueling station of some kind. Ultimately, the fuel mechanic may overly complicate the gameplay.

But that's okay, because this is just a demo. It's not supposed to be dropped wholesale into a "real" game, and as an implementation of flight, it's quite good.


Top
 Profile Send private message  
 
PostPosted: Tue Apr 24, 2012 11:31 pm 
Offline

Joined: Fri May 06, 2011 7:15 pm
Posts: 489
Location: The Big Apple
Thanks. The code for generating a single Ocean room which appears to the player to be a myriad of rooms is a very handy thing to know. Producing the individual rooms manually was a bit of a pain in the ass, and, as you pointed out, I evidently made an error in the descriptions.

Robert Rothman


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 59 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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