Synopsis: How ships work on Abandoned Reality. May 98 Date: Mon, 25 May 1998 18:56:44 +0200 (MET DST) From: "Erwin S. Andreasen" X-Sender: erwin@shire.shire.dk To: Colin Scheriff cc: rom@rom.org Subject: Re: Sailing ships On Mon, 25 May 1998, Colin Scheriff wrote: > As long as we're talking about places that have things like that, moongate > has an interesting one. Pretty much you walk onto a dock which is just Here's a description of Abandoned Reality's system. There is a list of ships, editable online. Each ship has certain attributes like range of room vnums assigned to it, ship name, ship flags: what terrain can it go over?, ship object and current location. Ships are like rooms, i.e. the template is the instance, thus they cannot be dynamically generated. The ship object is a kind of a portal: it knows what ship it portrays, and so when you enter it, you enter a certain room on the ship. You enter it using the normal ENTER command. The ship object moves around as the ship moves around. The ship move around when someone enters the 'control room', types 'control' and uses the normal movement commands. When the ship moves, everyone in the vnum range gets some information about the ship moving. Those in rooms without indoors flag (which are then assumed to be on the surface of the ship) get the new room's description (ships mostly move through the wilderness, so that is the map around the new room). Since the ship is really just a bunch of rooms, you can put whatever you want in there. Exiting is achieved by walking through an exit with a special flag which means that the exit should lead to the room that this ship is located in (I should mention that exits are virtualised, thus all access to an exit happens via a getExit function, never via direct access to the exit structure). Ship schedule is done entirely via mobprogs: The '@walkto' mob command puts an event on a mob that makes it move towards a destination every N seconds. If the mob that executes @walkto however is in control of a ship, the path plotted is the one from the location of the ship rather than location of the mob. We then use some mobprogs to ease navigation between waypoints; the mob in cotnrol of a ship sets a variable to something like "vnum:1 vnum:2 vnum:3" when it is created and calls the waypoing navigation program. That programs makes sure it visits each vnum in turn. Other things that vnums can be inserted too, like 'call' which makes the waypoint navigation call a certain program when it arrives there. ============================================================================== Herlev, Denmark UNIX System Programmer <*> (not speaking for) DDE ==============================================================================