Frictional Games Forum (read-only)

Full Version: Locked Hatch found being open by itself?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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]
Perhaps because it can't be locked when it's upside down. I'm not sure though.
Try turning it around.
(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
Hm, maybe it can't be locked.
Or it's being unlocked when the map begins
Try using a block box that is deactivated when you solve the puzzle.
(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?
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.
As far as I know, block box blocks (C-C-C-combo breaker) only player, not entities. But I can be wrong.
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?
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.
Pages: 1 2