Frictional Games Forum (read-only)

Full Version: Hatch Won't Lock!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
So I put a hatch on the ground in my mod, and I have it locked so that the player needs to pry it open with a crowbar in order to advance to the next map. Unfortunately, the damn hatch refuses to lock!!! Every time I enter the level, I can simply open the hatch with no crowbar, even though I have it set to "locked" in the level editor. Hell, I even threw in a "SetSwingDoorLocked" and a "SetSwingDoorClosed" at the beginning of the "void OnStart()" in the scripting, and the freaking thing STILL won't lock!!! And yes, I checked to make sure that it wasn't clipping into the ground and that the floor wasn't keeping it from closing properly. Not the problem. Closes just like it should. Could I have possibly, through sheer s**t luck, have picked the only hatch in the game that can't be locked (hatch_ceiling)?

[Image: 727-computer-reaction-face-gun-shoot-hea...n-hero.png]

Any and all advice would be greatly appreciated, because I'm out of ideas.
Could it be that you have a .cache file in your maps folder, so that changes you make don't change ingame?

(If so delete the .cache file)
Probably you did. Check what the entity file it is. I had the same problem, because I used drain grate or whatev. I simply used SetPropStaticPhysics so player can't open it and then turned it off so it is possible. Then I also used a block box entity, because it was possible to walk through it (it had no body to collide with).
Despite having a "Lock" box, they can't be locked. At least not all trapdoors can. I do believe the hatch you're using cannot be locked. I encountered a similar issue myself once upon a time.
Thanks you guys! What I eventually did was replace the hatch that I was using with a different one and it started working. I got a new question for you guys now. Is there any way to use a black tile (static objects>technical) as a level door? Or will I just have to use the hatch itself as the level door? Is it possible to have a door that can be opened by a crowbar be a level door?
You can make anything a level door if you want. You can either make a custom entity for it, or do something simpler by activating an area over it, add an interaction callback that calls ChangeMap(); and add a LevelDoor crosshair icon. The only thing you won't be able to add (if I remember correctly) is the string that tells where this door is leading. You can use the entity method if you need that.
(03-01-2015, 10:13 PM)Mudbill Wrote: [ -> ]You can make anything a level door if you want. You can either make a custom entity for it, or do something simpler by activating an area over it, add an interaction callback that calls ChangeMap(); and add a LevelDoor crosshair icon. The only thing you won't be able to add (if I remember correctly) is the string that tells where this door is leading. You can use the entity method if you need that.

When I go into the model editor, I try to open up the jet black tile (static_objects>technical>plane_black) but the folder is empty and won't load. Suggestions?
It's a static object, therefore it has no .ent file. Use File > Import Mesh instead. That's how you make a new .ent file. If it has a .dae file, you can import it and make it.
(03-01-2015, 10:13 PM)Mudbill Wrote: [ -> ]The only thing you won't be able to add (if I remember correctly) is the string that tells where this door is leading.

With a little more scripting you can easily simulate it.
It'll get more advanced, and seem like a work around, but meh, if you want it, you can do it.

You can either do it by scripting or by level editting.

By scripting you'd use "GetEntityPosX" (for all axises) and check both the area and the player, when looking at the area.

If the distance between them is close enough, show a message.


Or, you could create another area. If the player is inside this area, show the message. (And enable the level-change area, perhaps)
(03-02-2015, 12:54 AM)FlawlessHappiness Wrote: [ -> ]
(03-01-2015, 10:13 PM)Mudbill Wrote: [ -> ]The only thing you won't be able to add (if I remember correctly) is the string that tells where this door is leading.

With a little more scripting you can easily simulate it.
It'll get more advanced, and seem like a work around, but meh, if you want it, you can do it.

You can either do it by scripting or by level editting.

By scripting you'd use "GetEntityPosX" (for all axises) and check both the area and the player, when looking at the area.

If the distance between them is close enough, show a message.


Or, you could create another area. If the player is inside this area, show the message. (And enable the level-change area, perhaps)

Or a simpler, but not as great method, making use of a Sign Script Area.
Pages: 1 2 3