MAKING PASSAGES
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.
Zefz Notes: Personally, I just use EgoMap to edit and add passages. Set Show Passages to True (Done
in EgoMap) and modify passage.txt. Now reload the module and see how the passage changed.
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).
Egoboo 2.7.6 Game Manual 48 of 53
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. _________________ http://egoboo.sourceforge.net
"The pen is mightier than the sword- IF it is sharpened, dipped in poison and thrown really really hard at your target. But seriously, you are better off with a sword."
It took some time before I figured it out myself, but once you do, it is really simple. _________________ http://egoboo.sourceforge.net
"The pen is mightier than the sword- IF it is sharpened, dipped in poison and thrown really really hard at your target. But seriously, you are better off with a sword."
Joined: 19 Apr 2008 Age: 13 Posts: 2792 Location: Finland
Posted: Tue Apr 29, 2008 6:49 pm Post subject:
Are we some... Some... BUGS!? I mean, me and Clonks (sorry Clonkinator), but I mean that 2.6.0 won't work for us, and that passage thing... I'm really sorry about calling you a bug, I should say "Am I a bug?" _________________
Joined: 03 Nov 2007 Age: 15 Posts: 3043 Location: Germany
Posted: Tue Apr 29, 2008 7:07 pm Post subject:
What's wrong about calling me a bug (other than I don't see any sense in doing so... )? Anyway, I'm still waiting for 2.6.0b to be uploaded. All my hopes are for that version... Anyway, it actually should work for me, as it would make absolutely no sense if it didn't.
And well, everyone has his problems. Noone's perfect! _________________ Yes, it's true. I fail. Epicly so.
"The pen is mightier than the sword- IF it is sharpened, dipped in poison and thrown really really hard at your target. But seriously, you are better off with a sword."
Just make the floor lower than level 0 and make any script run the function PitsKill. _________________ http://egoboo.sourceforge.net
"The pen is mightier than the sword- IF it is sharpened, dipped in poison and thrown really really hard at your target. But seriously, you are better off with a sword."
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 vote in polls in this forum