Turning the Ship's Wheel; Making the Birds show up on cue

Okay, as long as I’m asking n00bly questions:

1 - I want a ship’s steering wheel, which can be turned. When it’s turned, how do I get it to affect… you know, anything? I can get the player to turn it, and I can say, “The boat turns”, but then I get:

turn wheel to port
The ship tilts slightly as it heels to port.
I only understood you as far as wanting to turn the Wheel.

How do I get rid of the error message?

Also, and I know this is stupid, but I want birds to appear at 12:05 PM. I’ve gotten to where I can notify the player that birds are singing, but I want to vary the message depending on whether or not the player is belowdecks. I have given the rooms a number called belowdecks; 1 is assigned to most rooms, but the main deck and the crow’s nest (which are outside) are given a 0. If the birds appear while the belowdecks of the current room is 1, say “There are birds singing outside!”, otherwise say, “You see birds off the port bow!”

Any thoughts?

And thanks!

CP

CP

Could you post the code you’ve got for those two situations?

Skinny Mike

— Here’s what I’ve got (I’m just piddling with this for the first time; I feel dumb, as I’m a computer programmer, and I keep wanting to make arrays and assign variables and stuff):

“A Bad Day at Black Rock” by Jim Work

When play begins:
change the time of day to 12:00 PM;

At 12:03 PM:
say “Neat!”

Include Version 1/071115 of Shipboard Directions by Mikael Segercrantz.

A room has a number called belowdecks. Belowdecks is usually 1.

The Deck is a room. Belowdecks is 0. “The deck of the wooden ship shows the wear of many years at sea. A hatch leads down to the crew’s quarters. The crow’s nest is high atop the mainmast, above you. The Captain’s cabin is aft, to the south. The foc[’]sle is forward, to the north.”

[Heading is a kind of value. The headings are centered, port, island, and starboard.]

The Wheel is in the deck. [The wheel has a heading.] The description is “The wheel controls the heading of the ship. You can turn it to port or starboard. After you turn it, the boat will change direction, and the wheel will return to its center position.”

[Wheel commands - Right now it just turns]

After reading a command:
if the player’s command matches “turn the wheel to port”
begin;
say “The ship tilts slightly as it heels to port.”;
end if;

After reading a command:
if the player’s command matches “turn the wheel to starboard”
begin;
say “The ship tilts slightly as it heels to starboard.”;
end if;

After reading a command:
if the player’s command matches “turn wheel to port”
begin;
say “The ship tilts slightly as it heels to port.”;
end if;

After reading a command:
if the player’s command matches “turn wheel to starboard”
begin;
say “The ship tilts slightly as it heels to starboard.”;
end if;

[If the wheel is turned, give the wheel the heading port.]

Instead of taking the wheel: say “It is connected to the rudder, and bolted into place.”

The Crow’s Nest is a room. Belowdecks is 0. It is up from the Deck. The description is “Standing high above the deck, you can see for leagues. Deep water surrounds you, and the gently rolling whitecaps stretch to the horizon in all directions.”

The Deck Hatch is a door and scenery. It is closed. It is down from the Deck and up from the Crew’s Quarters. The description is “The deck hatch is made of a solid piece of teak.”

The Crew’s Quarters is a room. It is down from the Deck Hatch. “The crew’s quarters is a tiny compartment with hammocks strung along the port and starboard walls. Each hammock allows only a few inches of space for reclining. You cannot stand up completely, as the heavy beams of the low ceiling are not quite four feet from the bottom of the ship. The bilge lies aft through a hatch with no door.”

The Bilge is a room. It is aft from the Crew’s Quarters. “The bilge is a large storage space.”

The Captain’s Cabin is a room. It is aft of the Deck. “The Captain’s cabin has a commanding view of the sea through heavy glass windows all about.”

The Forecastle is a room. It is fore of the Deck. “The forecastle (or ‘foc[’]sle’) houses the ship[’]s two massive bronze guns.”


Thanks!

CP

Oops, almost had a solution, but I ran into a snafu. You want to use port, starboard, etc. for onboard ship navigation as well as the actual ship nav, right? (i.e. “go port” means walk to the port side of the ship, while “turn wheel port” means turn the ship toward port?) Also, (if I may) I’m creating a new action for the wheel – check out Ch 12 of the docs. You should hardly ever have to use the “After reading a command” activity. That’s more for parser issues, etc.

SM

Yeah, I ran into the same “port” problem. I might solve it by allowing the player to steer towards landmarks (once land is spotted). Thanks for your help. I’ll check out Ch 12.

I’m sure I’ll get this more as I play with it.

Cheers!

Chainsaw Penguin

CP

Try this for starters (I edited out the extras):

[code]Include Version 1/071115 of Shipboard Directions by Mikael Segercrantz.

A room can be abovedecks or belowdecks. [belowdecks will be the default]

The Deck is a room. “The deck of the wooden ship shows the wear of many years at sea. A hatch leads down to the crew’s quarters. The crow’s nest is high atop the mainmast, above you. The Captain’s cabin is aft, to the south. The foc[’]sle is forward, to the north.”

Heading is a kind of value. The headings are centered, toport, island, and tostarboard. [changed port and starboard so as not to conflict with shipboard directions.]

The Wheel is in the deck. [The wheel has a heading.] The description is “The wheel controls the heading of the ship. You can turn it to port or starboard. After you turn it, the boat will change direction, and the wheel will return to its center position.”

Turning it to is an action applying to one thing and one visible thing. [the extension has established port, etc. as directions, and a directions is considered a visible thing (not touchable) for the purpose of defining actions]
Understand “turn [something] to [direction]” as turning it to.
Understand “turn [something] [direction]” as turning it to.

Check an actor turning something to:
if the noun is not the wheel, say “It doesn’t turn.” instead.

[you might want something like…]
Check an actor turning wheel to aft:
say “You can’t do a 180 in this thing!” instead.

Carry out an actor turning something to:
say “I don’t know how you want to implement headings here.”.

Report an actor turning something to:
say “The ship tilts slightly as it heels to [second noun].”.[ie the direction in the command][/code]

Have fun!

In that case, you might feel more comfortable with TADS 3, which is much more like a traditional programming language and very powerful. If you want to try it, I suggest you download the latest beta - it’s very stable now, and (under Windows) has an excellent IDE.

I’ll second the recommendation to try TADS 3.

You also might want to look at using regions in I7 for belowdecks/abovedecks.

Give Hugo a look as well – Programmer-recommended. :slight_smile: