Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Entity unlock
Greven Offline
Member

Posts: 106
Threads: 13
Joined: May 2011
Reputation: 3
#1
Entity unlock

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

[WIP] Recidivus
(This post was last modified: 05-17-2011, 12:24 PM by Greven.)
05-17-2011, 12:23 PM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#2
RE: Entity unlock

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

05-17-2011, 12:38 PM
Website Find
Rownbear Offline
Member

Posts: 157
Threads: 13
Joined: Apr 2011
Reputation: 2
#3
RE: Entity unlock

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

(This post was last modified: 05-17-2011, 12:47 PM by Rownbear.)
05-17-2011, 12:42 PM
Find
Greven Offline
Member

Posts: 106
Threads: 13
Joined: May 2011
Reputation: 3
#4
RE: Entity unlock

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

[WIP] Recidivus
05-17-2011, 12:49 PM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#5
RE: Entity unlock

(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
Website Find
Greven Offline
Member

Posts: 106
Threads: 13
Joined: May 2011
Reputation: 3
#6
RE: Entity unlock

(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

[WIP] Recidivus
05-17-2011, 01:23 PM
Find
dragonlordsd Offline
Member

Posts: 112
Threads: 7
Joined: May 2011
Reputation: 0
#7
RE: Entity unlock

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
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#8
RE: Entity unlock

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

05-17-2011, 05:44 PM
Website Find
dragonlordsd Offline
Member

Posts: 112
Threads: 7
Joined: May 2011
Reputation: 0
#9
RE: Entity unlock

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?
05-17-2011, 07:55 PM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#10
RE: Entity unlock

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.

05-17-2011, 08:14 PM
Website Find




Users browsing this thread: 2 Guest(s)