Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Secret Doors?
Cranky Old Man Offline
Posting Freak

Posts: 986
Threads: 20
Joined: Apr 2012
Reputation: 38
#9
RE: Secret Doors?

You know what? I'll post my Secret_doors.txt extensive documentation:

Spoiler below!


===================
SECRET DOORS
===================



==============
OVERLOOK
==============


I remember there being three points where a secret door was used:
The first secret door, was used in 01_old_archives.map (oddly enough covering the entry to the Entrance Hall) where you had to pull a lever to open it.
The second secret door, was used in 03_archives.map, where you had to pull three book switches in order to open it.
The third secret door, was used in maps\ptest\02_library.map (in the DLC Justine), where a slide puzzle opened it.



=========================
GENERAL CONCLUSIONS
=========================

There were two general ways of moving the self. The first secret door was moved through a direct ConnectEntities() connection made between the state of the bookshelf, and the state of the lever. The other two were moved through SetMoveObjectState().

Depending on the type of shelf, it can either move straight in a sidewise direction, or rotate. (It rotates either around itself, a predefined joint, or around a script area that is then referred to in the "AngularOffsetArea" of the shelf.)


You can find four types of secret shelf doors (all starting with "shelf_secret_door") in the "gameplay" category (or in the shelf_secret_door\ folder), and a fifth in Justines "ptest" category. While almost all of them use the same fancy model, "shelf_secret_door_interact" is instead a crude shelf, and better suited to cover something up, especially in a castlebase environment.



DOOR SHELVES

While most shelves can't be directly interacted with, two of these shelves - "shelf_secret_door_interact.ent" and ""shelf_secret_door_joint.ent" - actually works like doors, but in different ways. They rotate 90 degrees around their respective hinges just like doors, and they can even be locked.
Here are some functions that may or may not improve on them:
The interaction icon will normally give these shelves away as secret doors, even in their locked state, and even locked shelves can be shaken. Some function may be able to disable the interaction icon. Maybe SetEntityInteractionDisabled() works. ( void SetEntityInteractionDisabled(string& asName, bool abDisabled); - Disallows interaction with an entity. ) (Check it out later.)
You might also be able to turn off the ability for the shelf to be pushed (CAN it be pushed without interaction?) or shook, if it counts as a prop, by using SetPropStaticPhysics() ( void SetPropStaticPhysics(string& asName, bool abX); - Activates/deactivates the physics of a prop. Setting as true will make entities static in midair. )
While there exist functions for altering the sound and message of locked doors, those seem to only apply to LEVEL doors.



"shelf_secret_door_interact" can be opened and closed like a normal door. It rotates around an invisible rightside hinge. Take care to elevate the shelf a tiny amount (0.01 units) above the floor, or it may end up more or less stuck in it for some reason.
It's somewhat smaller than the other secret door shelves, meaning that it will not cover a "door_way_secret.dae" doorframe. A "castlebase/wall/door_frame.dae" works better.



"shelf_secret_door_joint" rotates around a bottom hinge, simulating a shelf that slowly falls over (forward) and that can be raised again. Take care to not let a player survive the shelf falling on top of him, as if you let him live, he either phases through a fallen shelf, or gets stuck in the dark beneath it somehow.

Haven't tested if these types of shelves can be affected by lever states.




OTHER SHELVES

These can all be opened and closed. At least "shelf_secret_door" seems to ignore static things (and won't get stuck in them).
Although all these shelves have a default direction in which they open, setting them to open as the map loads, will make them "open" in the opposite direction.


"shelf_secret_door"
Opens by sliding sideways to the left. (It makes a scraping sound.)

"shelf_secret_door_rot"
Opens by turning clockwise around an axis (ending up facing right). (It makes a rumbling of sliding along welloiled tracks.)

"shelf_secret_door_rotate"
Opens by turning anti-clockwise around an axis (ending up facing left). (It makes a scraping sound.)





OTHER SECRET DOORS


There is also the "door\castlebase_secret_door", but it is not exactly invisible. It raises into the ceiling.


"gameplay\carpet_moveable" can be slid back and forth between two positions, probably revealing hidden trapdoors with ladders underneath.
Note that these positions are not states, so at least ConnectEntities() doesn't affect them.
While the carpet can be interacted with, it's not as obvious as the interactable shelves.
It doesn't work as a door, and therefor cannot be locked (without scripting, at least).



The above does not includes the numerous destructible obstacles that can reveal unintended "passages".








===================
OLD ARCHIVES
===================



This puzzle is located in 01_old_archives.map, and is solved through simply flipping a switch. Note that the secret door itself, is in a castlebase setting.
The shelf opens by swinging open, and the wall behind it raises up.


The bookcase is a "shelf_secret_door_rot.ent" named "secret_shelf". (It is filled with normal physics objects, like books and jars.)
The lever is a "lever_small01.ent" named "secret_lever".
The bookcase covers a "castlebase_secret_door.ent" wall section, named "secret_door". (It doesn't at all look like it's seamlessly part of the wall.)
This is fitted inside a "door_way_secret.dae" static doorframe, named "wall_door_way_secret_1". It seems to be the only doorway that doesn't require a doorframe to cover the gap between the walls.
Tracks in front of it are made by a group of what may be decals, named "Compound_3".

This door works a little differently than other secret shelves: The shelf and door behind it, has two states, that is connected (via ConnectEntities() ) to the state of the lever pulled.

The "AngularOffsetArea" of the shelf, is set to "area_rotate". (Corrected) description of AngularOffsetArea: "When mode is angular, this is the point it rotates around. If empty, it rotates around its center."
"area_rotate" is a script area, located at the corner that the shelf swings around.

Note that while there is no script referring to the "area_rotate" entity, there is a commented out line referring to something called "rotatearea". This means that additional hps scripting for the hinge, is not required.
Note that even if the script mentions "shelf_secret_door_joint_1", this cannot be located in the map nor in the hps file.

Developer commentary in this room:
commentary/01_mikael_intro.comment
commentary/01_mikael_start.comment



---

(Note that the BEGIN OPEN SECRET DOOR section, is just for extra effects. ConnectEntities() is the only function required.)
Related scripts in "01_old_archives.hps":



//////////////////////////
//BEGIN OPEN SECRET DOOR//
void CreateDust(string &in asConnectionName, string &in asMainEntity, string &in asConnectEntity, int alState)
{
//for(int i=1;i<10;i++) AddPropForce("jara_"+i, 1.0f, 1.0f, 1.0f, "world");
//for(int i=1;i<4;i++) AddPropForce("jbok_"+i, 1.0f, 1.0f, 1.0f, "world");

if(GetLocalVarInt("DoSecretDoorEffects") == 1) return;

CreateParticleSystemAtEntity("PSDoorDust", "ps_dust_falling_door.ps", "secret_door", false);

AddTimer("sucess_music", 2, "TimerMusic");

AddTimer("Hint", 0.5f, "TimerHint");

StartScreenShake(0.006f, 0.5f, 2.0f,2.0f);

SetLocalVarInt("DoSecretDoorEffects", 1);
}
void TimerMusic(string &in asTimer)
{
PlayMusic("01_puzzle_passage.ogg", false, 0.7f, 0, 10, false);
}
//END OPEN SECRET DOOR//
////////////////////////




void OnStart()
{
//----ITEM CALLBACKS----//
SetSwingDoorLocked("shelf_secret_door_joint_1", true, false);
SetEntityInteractionDisabled("shelf_secret_door_joint_1", true);


//----CONNECT CALLBACKS----//
/*Secret hole in wall
*/
ConnectEntities("door_connection", //Name of connection
"secret_lever", //Parent entity (Affects)
"secret_door", //Child entity (Affected)
false, //Invert the state sent
1, //States used (0=both), checked before invertion.
"CreateDust"); //callback

ConnectEntities("shelf_connection", //Name of connection
"secret_lever", //Parent entity (Affects)
"secret_shelf", //Child entity (Affected)
false, //Invert the state sent
1, //States used (0=both), checked before invertion.
""); //callback

//SetMoveObjectAngularOffsetArea("secret_shelf", "rotatearea");

}





==============
ARCHIVES
==============


This puzzle is located in 03_archives.map, and is solved through pulling three secret book switches, within a certain time limit. Note that it is in a wood(?)base setting.
The shelf opens by moving to the left.


The bookcase is a "shelf_secret_door.ent" named "shelf_secret_door_1". (It is filled with a few normal physics objects (books).)
The bookswitches are "book_moveable.ent" named "SecretBook_x" (where "x" is 1, 2 or 3). Each has a script area in front of it, named "AreaSecretBook_x".
The bookswitches are all situated in normal "shelf01.ent" shelves.
The bookcase covers an empty static doorframe ("door_frame.dae"), which can be clearly seen when the bookcase is covering it.
Tracks beside the shelf is made by a "dirt_floor02.dae" named "_dirt_floor02_2".
A script area named "AreaDoorParticle" above the doorframe, will probably just generate falling dust as the door opens.


Developer commentary in this room:
None.



---

Related scripts in "03_archives.hps"(?):


///////////////////////////
//BEGIN SECRET SHELF DOOR//

void CollideSecretBook(string &in asParent, string &in asChild, int alState)
{
if(alState == 1) {
SetLocalVarInt("Var"+asParent, 1);

AddTimer(asParent, 20, "PushBackBook");

SetPropObjectStuckState(asParent, 1);

PlaySoundAtEntity("Sound"+asParent, "gameplay_tick", asParent, 0.0f, false);

StartScreenShake(0.001f, 0.5f, 0.5f, 0.5f);

PlayGuiSound("16_lever_stuck", 0.3f);

/*DEBUG
*/
AddDebugMessage("Book in area: "+asParent, true);
} else {
SetLocalVarInt("Var"+asParent, 0);

RemoveTimer(asParent);

PlaySoundAtEntity("Sound2"+asParent, "lock_door", asParent, 1.5f, false);
PlayGuiSound("16_lever_stuck", 0.2f);

StopSound("Sound"+asParent, 1.0f);

/*DEBUG
*/
AddDebugMessage("Book out of area: "+asParent, true);
}

/*All books are pulled before time is out and the secret room is revealed.
*/
if(GetLocalVarInt("VarSecretBook_1") == 1 && GetLocalVarInt("VarSecretBook_2") == 1 && GetLocalVarInt("VarSecretBook_3") == 1) {

FadeLightTo("PointLight_30", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 3.0f);

SetMoveObjectState("shelf_secret_door_1", 1); // I suspect that this line is what is moving the shelf.
// (Justine did it with SetMoveObjectState as well, and it is the only line referring to the shelf.)

SetPropObjectStuckState("SecretBook_*", -1);

SetEntityInteractionDisabled("SecretBook_*", true);

PlaySoundAtEntity("BooksDone", "lock_door", "Player", 0, false);

CreateParticleSystemAtEntity("dust", "ps_dust_falling_door_quick", "AreaDoorParticle", false);

for(int i=1;i<=3;i++){ RemoveTimer("SecretBook_"+i); StopSound("SoundSecretBook_"+i, 0.0f); }

GiveSanityBoostSmall();

PlayMusic("03_puzzle_secret.ogg", false, 0.7f, 0, 10, false);

CompleteQuest("03Books", "03Books");

/*DEBUG
*/
AddDebugMessage("All books in position, move shelf!", true);
}

}
void PushBackBook(string &in asTimer)
{
SetPropObjectStuckState(asTimer, -1);

AddTimer("2"+asTimer, 0.25f, "PushBackBook02");

/*DEBUG
*/
AddDebugMessage("Push back book: "+asTimer, true);
}
void PushBackBook02(string &in asTimer)
{
if(asTimer == "2SecretBook_1") SetPropObjectStuckState("SecretBook_1", 0);
else if(asTimer == "2SecretBook_2") SetPropObjectStuckState("SecretBook_2", 0);
else SetPropObjectStuckState("SecretBook_3", 0);
}

//END SECRET SHELF DOOR//
/////////////////////////



////////////////////////////
// Run first time starting map
void OnStart()
{
//----COLLIDE CALLBACKS----//
for(int i=1;i<=3;i++) AddEntityCollideCallback("SecretBook_"+i, "AreaSecretBook_"+i, "CollideSecretBook", false, 0); //Pull books to reveal room

}












=========================
JUSTINE - LIBRARY
=========================



This puzzle is located in "maps\ptest\02_library.map", and is solved through inserting the correct stencils ("stencil0x.ent") into a slot machine ("slot_machine.ent"), and pulling its lever. Note that its woodbase(?) setting doesn't matter.
The shelf opens by swinging open. (?) As the player isn't around to see it, it is possible that the shelf just instantly pops into the open state.

The bookcase is a "shelf_secret_door_rotate.ent" named "shelf_secret_door". (It is completely empty of contents.)
The "AngularOffsetArea" of the shelf, is set to "AreaShelfRotatePoint". (Corrected) description of AngularOffsetArea: "When mode is angular, this is the point it rotates around. If empty, it rotates around its center."
"AreaShelfRotatePoint" is a script area, located at its side. The shelf seems to hinge around it. The area also plays sounds as the shelf opens.



The stencils aside, the activation lever is a script area, named "AreaLeverEffect".
The bookcase covers a normal "door_frame.dae" door frame, completely visible behind the closed shelf.
Tracks in front of it are made by several "scratches.mat" decals, named "scratches_x" (where x is a number).




Developer commentary in this room:
None.




---

Related scripts in "02_library.hps":



//////////////////////////////////////////////////////////
// OPEN DOOR TO CELLAR
//////////////////////////////////////////////////////////

//------------------------------------------------------------------------------------------

void OpenSecretDoor()
{
SetMoveObjectState("shelf_secret_door", 0.43f);

AddTimer("start", 2.0f, "TimerStartShelfSound");
AddTimer("stopshelfsound", 6.0f, "TimerStopShelfSound");
}

void TimerStartShelfSound(string &in asTimer)
{
PlaySoundAtEntity("clank", "L02_start", "AreaShelfRotatePoint", 0.0f, false);
PlaySoundAtEntity("moveshelf", "L02_scrape", "AreaShelfRotatePoint", 2.0f, false);

FadeLightTo("PointLight_44", 0, 0, 0, 0, 0, 4);

StartScreenShake(0.005f, 4.0f, 2.0f, 2.0f);
}

void TimerStopShelfSound(string &in asTimer)
{
StopSound("moveshelf", 0.5f);
PlaySoundAtEntity("clank2", "L02_stop", "AreaShelfRotatePoint", 0.0f, false);
}







=================
MISCELLANEOUS
=================


This is some code (found in "03_archives.hps") that isn't used, seemingly cooncerning a lever affecting a large painting.



//----CONNECT CALLBACKS----//
/*Secret hole in wall
*/
ConnectEntities("secret_painting", //Name of connection
"lever_small01", //Parent entity (Affects)
"painting_large03_1", //Child entity (Affected)
false, //Invert the state sent
1, //States used (0=both), checked before invertion.
""); //callback




Noob scripting tutorial: From Noob to Pro

(This post was last modified: 04-05-2012, 12:40 AM by Cranky Old Man.)
04-05-2012, 12:28 AM
Find


Messages In This Thread
Secret Doors? - by Tripication - 01-11-2012, 07:14 AM
RE: Secret Doors? - by flamez3 - 01-11-2012, 07:17 AM
RE: Secret Doors? - by Tripication - 01-11-2012, 07:40 AM
RE: Secret Doors? - by flamez3 - 01-11-2012, 07:48 AM
RE: Secret Doors? - by Tripication - 01-11-2012, 07:57 AM
RE: Secret Doors? - by Damascus - 03-06-2012, 04:31 AM
RE: Secret Doors? - by Cranky Old Man - 04-04-2012, 11:33 AM
RE: Secret Doors? - by SilentStriker - 04-04-2012, 09:41 PM
RE: Secret Doors? - by Cranky Old Man - 04-05-2012, 12:28 AM
RE: Secret Doors? - by SilentStriker - 04-05-2012, 07:42 AM
RE: Secret Doors? - by Cranky Old Man - 04-05-2012, 09:05 AM
RE: Secret Doors? - by SilentStriker - 04-05-2012, 09:27 AM



Users browsing this thread: 1 Guest(s)