Prevent party from leaving town

Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /var/www/pied-piper.ermarian.net/includes/common.inc).
AuthorTopic: Prevent party from leaving town
Law Bringer
Member # 2984
Profile Homepage #0
I would like to prevent the party from leaving the town until a certain condition is met.

I've tried to do this by setting the town exit state to execute this:

if (!condition)
{
message_dialog("You can't leave yet!","");
block_entry(1);
}
This works exceedingly well when the player actually steps on a special encounter with this state - they can't walk on.

But apparently, block_entry() does *not* prevent the party from leaving town during the exit town state. The message is displayed, but the party gets to escape.

Is there a way to get what I want without drawing specials over all four borders of the town?

--------------------
Encyclopaedia ErmarianaForum ArchivesForum StatisticsRSS [Topic / Forum]
My BlogPolarisI eat novels for breakfast.
Polaris is dead, long live Polaris.
Look on my works, ye mighty, and despair.
Posts: 8752 | Registered: Wednesday, May 14 2003 07:00
Lifecrafter
Member # 6193
Profile Homepage #1
Not without swapping the entire perimiter to an unpassable terrain.

It's not like it's a huge deal, just draw four special rectanges just outside the town's borders, they don't even have to be inside the town's boundaries.

--------------------
Guaranteed to blow your mind.

Frostbite: Get It While It's...... Hot?
Posts: 900 | Registered: Monday, August 8 2005 07:00
Agent
Member # 8030
Profile Homepage #2
Here's a possibility: Make a custom terrain (one that can't be walked through) that's practically invisible. Place it on the path leaving the town, and when the party meets that condition, have a script to remove the terrain.

[ Tuesday, April 03, 2007 15:14: Message edited by: Excalibur ]

--------------------
WWJD?
Posts: 1384 | Registered: Tuesday, February 6 2007 08:00
Law Bringer
Member # 2984
Profile Homepage #3
Well, that approach works too... but for what I intend, it really seems overkill.

Lazarus, do you mean within the town or outdoors around the town entrance? Because if it's the former, then they *do* need to be inside the boundaries in order to prevent the player from leaving.

Unless I'm completely ignorant of how special areas outside the town boundary are handled...

--------------------
Encyclopaedia ErmarianaForum ArchivesForum StatisticsRSS [Topic / Forum]
My BlogPolarisI eat novels for breakfast.
Polaris is dead, long live Polaris.
Look on my works, ye mighty, and despair.
Posts: 8752 | Registered: Wednesday, May 14 2003 07:00
Lifecrafter
Member # 6193
Profile Homepage #4
You're completely ignorant. :D

I did mean the town, and yes you can put them outside the town boundaries. Obviously it can only be one space outside, but so long as the player can't step outside the boundaries without triggering the special you're fine.

--------------------
Guaranteed to blow your mind.

Frostbite: Get It While It's...... Hot?
Posts: 900 | Registered: Monday, August 8 2005 07:00
Law Bringer
Member # 2984
Profile Homepage #5
quote:
Obviously it can only be one space outside
See, when you're precise, it all makes sense. :P

--------------------
Encyclopaedia ErmarianaForum ArchivesForum StatisticsRSS [Topic / Forum]
My BlogPolarisI eat novels for breakfast.
Polaris is dead, long live Polaris.
Look on my works, ye mighty, and despair.
Posts: 8752 | Registered: Wednesday, May 14 2003 07:00