Frictional Games Forum (read-only)
Locked Hatch found being open by itself? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Locked Hatch found being open by itself? (/thread-24516.html)

Pages: 1 2


Locked Hatch found being open by itself? - Radical Batz - 02-02-2014

I made a ceiling hatch in my map and I made it locked, so I want the player to solve a puzzle to make it open, but when I tested my map to see the room with the hatch, I found it swinging open, why is this? I made it locked

[Image: JMvYFxB.jpg][/img]


RE: Locked Hatch found being open by itself? - FlawlessHappiness - 02-02-2014

Perhaps because it can't be locked when it's upside down. I'm not sure though.
Try turning it around.


RE: Locked Hatch found being open by itself? - Radical Batz - 02-02-2014

(02-02-2014, 05:09 PM)FlawlessHair Wrote: Perhaps because it can't be locked when it's upside down. I'm not sure though.
Try turning it around.

If I make it upside down then it will not open by itself but it will be not locked and the player can open it without doing the puzzle, then why is it called a ceiling hatch, so not true Angry


RE: Locked Hatch found being open by itself? - FlawlessHappiness - 02-02-2014

Hm, maybe it can't be locked.
Or it's being unlocked when the map begins


RE: Locked Hatch found being open by itself? - i3670 - 02-02-2014

Try using a block box that is deactivated when you solve the puzzle.


RE: Locked Hatch found being open by itself? - Radical Batz - 02-02-2014

(02-02-2014, 06:33 PM)i3670 Wrote: Try using a block box that is deactivated when you solve the puzzle.

a what what? what's a black box? and where do I find it?


RE: Locked Hatch found being open by itself? - DnALANGE - 02-02-2014

BLOCK box.
Go to entities -> Technical -> Blockbox.
A block box is just a "invicible" box.
Put that box really close underneath your hatch. { also make it a bit small \ thinner to look better if players would try jumping to it. }
SO the hatch is "hanging"on the block box.
WHen the charactor has finished th quest do this :
SetEntityActive("YOURBLOCKBOXNAMEHERE", false);
THEN if you did it correct the hatch will open.
-
Try that and let us know if it works.


RE: Locked Hatch found being open by itself? - Slanderous - 02-02-2014

As far as I know, block box blocks (C-C-C-combo breaker) only player, not entities. But I can be wrong.


RE: Locked Hatch found being open by itself? - Radical Batz - 02-02-2014

No it doesn't work with entities so what am I going to do with the hatch, i really want the player to solve a puzzle to open it, even if I turn it upside down, it's still stays open, even though it's locked. why is this happening?


RE: Locked Hatch found being open by itself? - Slanderous - 02-02-2014

You can, perhaps, hit "static physics" in the entity tab.
Then do an script area around the hatch, like this:

Spoiler below!
[Image: szg03m.jpg]

Now I guess you want to make player say "it's locked" when touching it. Go to your map script, and paste this code:

void int01(string &in asEntity)
{
SetMessage("Messages", "name_of_the_message_to_show", 5);
}

Put the "int01" here:

Spoiler below!
[Image: 14soaci.jpg]

(Tick also "item_interaction" in the same window, below)

Of course "Messages" is the category in your extra_english.lang file, and "name_of_the_message_to_show" is the entry name of the message to appear.

When you do script, simply make the key or everything else you want to be used on the script area, like this:

Spoiler below!
PHP Code:
void OnStart()
{
AddUseItemCallback("""key_name""ScriptArea_1""UnlockHatch"true);
}
void UnlockHatch(string &in asItemstring &in asEntity)
{
  
SetPropStaticPhysics("hatch_ceiling_1"false);
  
SetEntityActive("ScriptArea_1"false);
  
PlaySoundAtEntity("""unlock_door.snt""hatch_ceiling_1"0false);
  
RemoveItem("key_name");



It should work fine, if you do this correctly.

EDIT: Forgot to put one thing, fixed.