Frictional Games Forum (read-only)

Full Version: Entity unlock
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
ok so here's the deal,

I wanna unlock my ironmaiden so a prop impulse can happen but i dont want someone to be able to open it before the event.
So i locked it, but i dont know if there is a coding for unlocking entitys.
Is it the SetSwingDoorLocked command?

Does anybody know? :3
It would be easier to try the script in a dev environment.
You can do it like they did in the main game by putting a script and when the player walks into it, it pops up playing a sound and creating a particle effect. but if you want it to be a trap so when a player goes to it and it's locked then coming back later it pops up, just put a script in-game past the iron maiden activateing the script to scare.

Also instead of locking and unlocking it you can just place two ironmaidens, one that locked and active and one thats open and unactive. so when the player walks into the script, the locked ironmaiden disappear and the unlocked ironmaiden gets active and addpropimpulse can work.

EDIT: Not sure if this works on the ironmaiden tho

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "UnlockDoor", true, 1);
}

void UnlockDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("iron_maiden_1", false, true);
}
(05-17-2011, 12:38 PM)Tanshaydar Wrote: [ -> ]It would be easier to try the script in a dev environment.
I dont know how you found out that i just switched from the dev enviroment to the original... HAX!


(05-17-2011, 12:42 PM)Rownbear Wrote: [ -> ]You can do it like they did in the main game by putting a script and when the player walks into it, it pops up playing a sound and creating a particle effect. but if you want it to be a trap so when a player goes to it and it's locked then coming back later it pops up, just put a script in-game past the iron maiden activateing the script to scare.

Also instead of locking and unlocking it you can just place two ironmaidens, one that locked and active and one thats open and unactive. so when the player walks into the script, the locked ironmaiden disappear and the unlocked ironmaiden gets active and addpropimpulse can work.

EDIT: Not sure if this works on the ironmaiden tho

void UnlockDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("iron_maiden_1", false, true);
}

SetSwingDoorLocked does not work but ill go with the 2 ironmaidens idea.
(05-17-2011, 12:49 PM)Greven Wrote: [ -> ]
(05-17-2011, 12:38 PM)Tanshaydar Wrote: [ -> ]It would be easier to try the script in a dev environment.
I dont know how you found out that i just switched from the dev enviroment to the original... HAX!

If you like, here's what I did. I have two Main folders under Documents/Amnesia, one of them is MainD (stands for developer), and other one is MainG (stands for gamer).

Whenever I need to switch to dev environment, I rename MainD to Main and everything is ready, which is already set to dev environment in the folder.
Whenever I need to switch to normal, I rename Main to MainD and MainG to Main, voilĂ !
(05-17-2011, 12:58 PM)Tanshaydar Wrote: [ -> ]
(05-17-2011, 12:49 PM)Greven Wrote: [ -> ]
(05-17-2011, 12:38 PM)Tanshaydar Wrote: [ -> ]It would be easier to try the script in a dev environment.
I dont know how you found out that i just switched from the dev enviroment to the original... HAX!

If you like, here's what I did. I have two Main folders under Documents/Amnesia, one of them is MainD (stands for developer), and other one is MainG (stands for gamer).

Whenever I need to switch to dev environment, I rename MainD to Main and everything is ready, which is already set to dev environment in the folder.
Whenever I need to switch to normal, I rename Main to MainD and MainG to Main, voilĂ !

Yeah i have something similar but in my case i have 2 sorts of main settings and user settings documents and replace the documents inside. But your way was better Smile
Can anything be "locked" or is it only specific entities? I.e., can you "lock" a desk drawer or metal stove?
(05-17-2011, 05:10 PM)dragonlordsd Wrote: [ -> ]Can anything be "locked" or is it only specific entities? I.e., can you "lock" a desk drawer or metal stove?

It's door-like entities only.
So there is no way to actually "lock" a desk or other entity?

Just a random thought; what if you made a static model of the desk and then switched it with a regular desk model when the player used a key on it?
Would that work?
Does that even make sense?
Regular desk has a door, which is simply a door entity and can be locked.

From other entities, you should open them in level editor and see in Entity settings if there is an option to be locked. Door-like entities has a checkbox which reads Locked.
Pages: 1 2