Zippy-Egoboo Home EgoWiki > Documentation > MakingModules > UsingPassages EgoWiki webs:
Main | TWiki | Know | Sandbox
Documentation . { Changes | Index | Search | Go }
Passages are Egoboo's way of marking an area. The main uses for them are: Having a shop Having doors that can open or close Detecting a character's presence in an area.

Passages are contained in the file passage.txt in a module's gamedat folder. It looks like this (this is from the adventurer starter's passage file).

//             TopleftXY  BottomrightXY  Open    ShootThrough  SlippyClose
0 Deadend:     3  51      4  52          F       T             F
1 Deadend:     53 7       54 8           F       T             F
2 Door:        40 53      41 54          F       F             F
3 Armor:       48 27      49 28          F       F             F
4 Trog:        17 18      18 19          F       F             F
5 MamaLeft:    24 25      25 26          F       F             F

Here's what it all means:

The number at the left is the number of that passage. You'll need this number later for scripting. The name is just to help you remember which passage is which. Neither of these are read by Egoboo and are just there to help you out.

The TopleftXY and BottomrightXY are the boundaries of the passage. Unfortunately, as of right now you can't set the coordinates in EgoMap, so you'll have to do it manually. The easiest way is like this.

  1. Open your module in Egoboo
  2. Hold F5. This will display the coordinates of your character.
  3. Go to the top left and bottom right corners of each passage you want and write down the coordinates.

Open is T or F. This is asking whether the passage is open or closed when the module begins. Set it to whichever is true. Open or closed refers to whether the tiles the passage is over are passable or impassable; set this by changing flags in Egomap.

Shoot Through refers to whether or not you can shoot through the passage. If set to T, projectiles will go through; if F, projectiles will be stopped when they hit the passage.

I've never used slippy closing, but I think what it does is set the tiles in the passage as slippy tiles instead of regular tiles. Try it and find out (or just leave it F and play it safe).

So, now you've got a file, passage.txt, which has the info for all the passages in your module. Now open up spawn.txt. You'll notice that one of the values that can be set for each object is the Pas value, which refers to passage. For each object that uses a passage, set that object's Pas value to the number of the passage that is relevant (you remember those numbers from before, right?). One object can interact with any number of passages; the Pas value is just an easy way of remembering which object goes with which passage, and the scripts for doors and buttons use it, so if you don't want to modify the scripts, set the value.

Now, on to the uses of passages: For doors, set the door to its associated passage. The standard ones are all scripted to use that, and will work without any further need for changes. All you have to do to get the door to open and close is call OpenPassage and ClosePassage (Egoscript commands) on the associated passage. Note that OpenPassage will only work if the passage is closed, and ClosePassage will only work if the passage is open. Buttons can do this automatically; for a standard button, just make sure that it's associated with the same passage as the door you want and it will open/close the door with no further need for changes (just make sure you have the right button; some require keys, some can close/open, and some can only either close or open). Any object can close and open doors/passages.

For shops. Please, don't script your own shop. Open the shopkeep object from Zippy City and base your shop on that. Basically, there is an Egoscript command, AddShopPassage, that turns a passage into a shop where you get paid for any item you drop and must pay for any item you pick up. The shop will function as long as the object that called it into existence is still alive.

Detecting character presence: The Egoscript function SetTargetToWhoeverIsInPassage does exactly what it sounds like it does. From that, you can test if the target is a player, is alive/dead, etc. for whatever you want.

Making your first passage will probably be annoying, but once you've made one it should be pretty intuitive.

-- AeoluS - 27 Feb 2004

Topic UsingPassages . { Edit | Attach | Ref-By | Printable | Diffs | r1.1 | More }
Revision r1.1 - 27 Feb 2004 - 18:35 GMT - AeoluS
Parents: WebHome > MakingModules
Copyright © 1999-2003 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding EgoWiki? Send feedback.