Frictional Games Forum (read-only)
Entity unlock - 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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Entity unlock (/thread-8065.html)

Pages: 1 2


Entity unlock - Greven - 05-17-2011

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


RE: Entity unlock - Tanshaydar - 05-17-2011

It would be easier to try the script in a dev environment.


RE: Entity unlock - Rownbear - 05-17-2011

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);
}


RE: Entity unlock - Greven - 05-17-2011

(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.


RE: Entity unlock - Tanshaydar - 05-17-2011

(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Ă !


RE: Entity unlock - Greven - 05-17-2011

(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


RE: Entity unlock - dragonlordsd - 05-17-2011

Can anything be "locked" or is it only specific entities? I.e., can you "lock" a desk drawer or metal stove?


RE: Entity unlock - Tanshaydar - 05-17-2011

(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.


RE: Entity unlock - dragonlordsd - 05-17-2011

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?


RE: Entity unlock - Tanshaydar - 05-17-2011

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.