Secret Doors -- How Do They Work?

Moderator: Event DM

Post Reply
User avatar
Buddha
Head of Production
Head of Production
Posts: 2957
Joined: Tue Mar 15, 2005 11:06 pm
Timezone: GMT-4 (EST)
Location: Sitting Down
Contact:

Secret Doors -- How Do They Work?

Post by Buddha » Sun Aug 30, 2009 10:33 pm

Ok, I've been mucking about with secret doors a bit, specifically a trap door. I've figured out how to draw the trigger for the area where you can actually sense it. I've tied that to a waypoint that then makes a secret trap door appear.

Now I'm kind of baffled. Does a secret door behave like a normal door? I can't see how, as I can't right click on the waypoint and tell it anything about hardness, special keys or the like. So how do you communicate those types of properties to the secret door that the trigger spawns via waypoint? How do you add a transition to it? What is 11+31?
User avatar
Krator
Elder Sage
Posts: 4935
Joined: Thu Jun 10, 2004 6:44 pm
Timezone: GMT
Location: Amsterdam

Re: Secret Doors -- How Do They Work?

Post by Krator » Sun Aug 30, 2009 11:02 pm

Check the comments of the code involved. There's a lot of secret door scripts out there: I believe there's separate systems for SoU and HotU, and I'm sure a custom Avlis one or two. The SoU is the most basic one and works fine, and is what I explain below.

The script on the trigger determines the type of door, a placeable in the bioware palette in all cases. The x0_02_sec_*door# series of scripts notes the type of placeable they use in the introductory comments.

All the secret doors have a generic use script on them that looks up the tag of the trigger that spawned the secret doors, and then transports the PC to a waypoint depending on the tag of that trigger. This works for area transitions too.

Reference:

Code: Select all

//:://////////////////////////////////////////////////
//:: X0_I0_SECRET
//:: Copyright (c) 2002 Floodgate Entertainment
//:://////////////////////////////////////////////////
/*
Shared functions for secret/hidden items. Based on work
by Bioware's Robert Babiak for the secret doors.

The modifications I've made are to use a trigger instead of
an invisible item with an OnHeartbeat. This method is
considerably less CPU-intensive and more flexible in determining
the shape of the area in which the secret item can be detected.
The trade-off is that you have to create one additional waypoint
to specify where the item should appear.

Process:
- Create a trigger marking off the area where the secret
  item can be detected. There are several varieties already
  pre-created in the blueprints for different items.

- edit the properties of the trigger as follows:
  o Set the tag to something unique;
  o On the "Scripts" tab, for "On Enter", pick "x0_o2_sec_<item type>"
  o On the "Advanced" tab, put an integer into the "Key Tag"
    field: this will be the DC for detection;

- create a waypoint named "LOC_<tag of trigger>" and place it
  where you want the item to appear. Note that some items (like
  the trap door) have their orientation reversed; test to make sure
  the item appears with the desired orientation.

- if you are creating a secret transport object like a door or
  portal, create a waypoint named "DST_<tag of trigger>" and
  place it where you want the user to appear after use. Associates
  will be brought along for the ride even within the same area.

- both the secret item and the detection trigger will be sent a
  user-defined event with the value EVENT_SECRET_REVEALED. To
  cause a reset, you can simply choose the 'x0_o2_sec_reset' script
  as the user-defined event handler for the detection trigger, or
  you can put something else in if you want to do something fancy.

- you can get a reference to the revealed secret item by using
  "GetSecretItemRevealed(<trigger object>)".

 */
//:://////////////////////////////////////////////////
//:: Created By: Naomi Novik
//:: Created On: 10/06/2002
//:://////////////////////////////////////////////////
Playing as: Sir Douglas Hope of Gorethar, old school paladin | Krator Blackfist, gold mage | Warren, half nymph barbarian
User avatar
Krator
Elder Sage
Posts: 4935
Joined: Thu Jun 10, 2004 6:44 pm
Timezone: GMT
Location: Amsterdam

Re: Secret Doors -- How Do They Work?

Post by Krator » Sun Aug 30, 2009 11:36 pm

After spending half an hour, I've come to the conclusion that you'll have to code locks yourself.
Playing as: Sir Douglas Hope of Gorethar, old school paladin | Krator Blackfist, gold mage | Warren, half nymph barbarian
User avatar
Sephira
Team Member; Retired with Honors
Posts: 4587
Joined: Wed Mar 08, 2006 2:29 pm
Timezone: US Eastern, -5/-4
DM Avatar: Formerly Yeraiah
Location: Michigan, US
Contact:

Re: Secret Doors -- How Do They Work?

Post by Sephira » Mon Aug 31, 2009 2:54 am

Buddha wrote:What is 11+31?
Fourty t-


Oooh clever.
User avatar
Buddha
Head of Production
Head of Production
Posts: 2957
Joined: Tue Mar 15, 2005 11:06 pm
Timezone: GMT-4 (EST)
Location: Sitting Down
Contact:

Re: Secret Doors -- How Do They Work?

Post by Buddha » Mon Aug 31, 2009 7:44 pm

Thanks, Krator -- turns out I was almost there, and your help finished it off. And thanks for spending an inordinately long time searching for a way to lock/key it. No worries on the negative result for that -- I'll work around it. :wink:
User avatar
PsiOmega
Team Member; Retired with Honors
Posts: 4886
Joined: Tue Jun 08, 2004 4:55 pm
Timezone: GMT+1/+2 (DST)
Location: Sweden

Re: Secret Doors -- How Do They Work?

Post by PsiOmega » Mon Aug 31, 2009 8:00 pm

If at all of interest, there is a recent set Avlis script which works as follows:
The script is attached to a placeable and two waypoints are put where needed.
When the placeable is used and the user has the correct key, a secret door is revealed at one of the WPs.
When used, the secret door sends the used to the second WP.
The secret door soon disappears.


So, a key check instead of a search check.
Post Reply