One-way Doors

Post any topic here, DW related or not.

Moderator: Admin

Post Reply
User avatar
ShadoKnight
Nomad
Posts: 28
Joined: Mon Mar 21, 2005 2:05 pm

One-way Doors

Post by ShadoKnight »

This is for ongoing discussion of one-way door techniques ;-).

So, my thought was that you'd script all the cells surrounding the two squares in question, so you could set variables to know exactly which square you came from. It would get tricky, in the variable handling, but if each square sets a different value, you can determine facing by knowing where the cells are relative to each other. You're right, incidentally, that the engine doesn't expose entrance details (which would make this a *lot* easier). Should be a simple addition for those who are currently maintaining the code ;-).

Other thoughts or suggestions?

SK
User avatar
Growler
Necrolord
Posts: 1740
Joined: Mon Feb 14, 2005 10:37 pm
Location: Sputnik
Contact:

Post by Growler »

Use real magic? :?

So there's no way (via normal/accessible moddin' techniques) to 'tap' into the automap's positioning info &/or the compass's directional info? -realize the compass isn't always active

Don't know if this'll affect technicalities involved, but maybe we need to first ask/decide what a 1-way door is all about...like, who put it there? & why? Does it last forever? If not, then does it devolve into a solid wall, or an open space? Or does it fluctuate over time?
Remember, once we decide these things--there's no going back..:wink:
No Contraries : No Progression.
Opposition is true friendship, unless one is opposed to true friendship or (try) Resisting here http://www.cafepress.com/notheresistor
User avatar
origen
Dark Sidhe Lord
Posts: 903
Joined: Thu Feb 10, 2005 5:54 pm
Location: Secret League of Nirulat Headquarters
Contact:

Post by origen »

Actually, what ShadoKnight says about scripting may work. By setting flags on different spaces, you can tell which direction you walked, and what will happen is if you try to walk back through the door, it will rebound you back to where you started, based on the flags. So while you will be going through the door, you will then get kicked back out. I am not sure how seamless it will be for the user, but it will keep the automap accurate.

I may try this if I get a chance.
User avatar
Growler
Necrolord
Posts: 1740
Joined: Mon Feb 14, 2005 10:37 pm
Location: Sputnik
Contact:

Post by Growler »

How about any time you step into a square (or turn 'round in it) with a 1-way door, then a simple script activates either GHWA or OPWA spell.

That'll 'open' the wall/door for one turn allowing you to pass thru from one direction but not back since these spells last only 1 turn...effectively/functionally = 1-way door, right??

As long as any move into or 'within' (i.e., turning) the cell activates the script, then shouldn't have to worry 'bout tracking direction, etc...and auto-map should be fine since casting GHWA or OPWA don't affect it otherwise, afaik.

All that flag-plantin'&settin'&yappin' sounded a bit overly blindly patriotic anyhows!
:?
No Contraries : No Progression.
Opposition is true friendship, unless one is opposed to true friendship or (try) Resisting here http://www.cafepress.com/notheresistor
User avatar
origen
Dark Sidhe Lord
Posts: 903
Joined: Thu Feb 10, 2005 5:54 pm
Location: Secret League of Nirulat Headquarters
Contact:

Post by origen »

Well, I was just able to successfully able to make a one-way door, and, with smooth walking turned off (I haven't tested it with it on), it works seamlessly, ie no jumps or obvious distortions.

All I needed was a new way of approaching the problem...
User avatar
origen
Dark Sidhe Lord
Posts: 903
Joined: Thu Feb 10, 2005 5:54 pm
Location: Secret League of Nirulat Headquarters
Contact:

Post by origen »

Here is the first script, which will be placed on the side of the door that you walk from (point of origin)

Code: Select all

#One-Way Door
from eventAPI import *
from APIUtils import *

def fireEvent(e):
    DKOneWay = getTag(e, "DKOneWay")
    if(DKOneWay == 2):
        NoPass(e)
    else:
        return 1

def Pass(e):
    return 1

def NoPass(e):
    return 0
And this script will be placed on the other side (destination) of the door:

Code: Select all

#One Way Door
from eventAPI import *
from APIUtils import *

DKOneWay = 0

def fireEvent(e):
    setTag(e, "DKOneWay", 2)
    return 1
And then, in the event file, you need the following information:

Code: Select all

16 16 2000
17 16 90 dkoneway
17 16 2000
17 16 90 dknopass
In this case, the door is on the East wall between 16, 16 and 17, 16. As the player approaches from the East side (lower numbers going higher), he first passes through the script which checks the tag DKOneWay. At this point, the tag is set to 0. Once through the door, a script sets the tag to 2. You have successfully passed through the door.

When returning in the other direction, you pass through the door, and since the script is now set to 2, returns a 0, which will send you to your rebound location (as defined in your events file), which is back to the Eastern side of the door.

If you are familiar with scripting, I hope this makes sense. If you are not, they it probably means very little to you.
Last edited by origen on Sun Mar 27, 2005 7:27 pm, edited 2 times in total.
User avatar
HGamer
War Monger
Posts: 188
Joined: Thu Feb 10, 2005 7:59 pm
Location: Land of fruits & nuts, i.e. SoCal
Contact:

Post by HGamer »

Previous message needs an edit, because the two code snippets look identical to me and there's no setTag anywhere.
But it sounds good. I was over-analyzing the problem, when all that's needed is to prevent normal movement in just one direction.
1 point 21 jigawatts!
User avatar
origen
Dark Sidhe Lord
Posts: 903
Joined: Thu Feb 10, 2005 5:54 pm
Location: Secret League of Nirulat Headquarters
Contact:

Post by origen »

Okay. I was just testing you on that one. I guess I was just excited that it worked that I didn't bother to check my post. But it is all correct now.
User avatar
ShadoKnight
Nomad
Posts: 28
Joined: Mon Mar 21, 2005 2:05 pm

Post by ShadoKnight »

Problem solved! Very elegant, Origen - no need to over-do it, you don't really care where the person came from beyond one side of the door or the other... Cool ;-)

SK
User avatar
HGamer
War Monger
Posts: 188
Joined: Thu Feb 10, 2005 7:59 pm
Location: Land of fruits & nuts, i.e. SoCal
Contact:

Post by HGamer »

Hate to rain on the parade, but has this been tested with all the strange things people can pull to subvert the game?
I particularly wonder what happens if the party tries to use GHWA or OPWA spells to vanish the annoying door/wall. It looks like all that we care about is the map coordinates, regardless of how the party gets there, and they'll be nicely bounced back as if the one-way was still working. And IIRC, setting Anti-Magic in the area won't prevent casting the spell as that flag is only checked on movement and not at time of casting. Unless that was changed - don't remember.
1 point 21 jigawatts!
User avatar
Growler
Necrolord
Posts: 1740
Joined: Mon Feb 14, 2005 10:37 pm
Location: Sputnik
Contact:

Post by Growler »

Look several posts back & you'll see where I was asking if GHWA or OPWA could be used to Create the 1-way door in a simple script on just 1 side of the door/wall...in effect, that's what a player's doing by casting either spell--they're temporarily making their own 1-way passage, right?

So any reason why a script couldn't just invoke one of those spells any time a player steps into the square &/or rotates within the square? Thus, no need to track any particular direction..
No Contraries : No Progression.
Opposition is true friendship, unless one is opposed to true friendship or (try) Resisting here http://www.cafepress.com/notheresistor
User avatar
origen
Dark Sidhe Lord
Posts: 903
Joined: Thu Feb 10, 2005 5:54 pm
Location: Secret League of Nirulat Headquarters
Contact:

Post by origen »

There is no way to script the casting of a spell, that I know of.
User avatar
origen
Dark Sidhe Lord
Posts: 903
Joined: Thu Feb 10, 2005 5:54 pm
Location: Secret League of Nirulat Headquarters
Contact:

Post by origen »

The only downfall that comes to my mind is if the person once again comes to that door from their original , they system will still think they are trying to get back through, and will push them through the door. So, for any space surrounding the original side of the door (but not the space that checks the script), there would have to be a script that resets the script once again so they can go through the door again (or not, if they don't want to fall for it again.)

But, if the person uses a spell to make the door go away, they will still be bounced back (although I am not sure how it would look to them (will they see their movement and get bounced back, or will the door just appear in front of them again.
Post Reply