HPS Files - 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: HPS Files (/thread-16408.html) |
HPS Files - coldron1 - 06-22-2012 Hey Guys just want a bit of help with the HPS file Ive programmed a key to unlock a door so far and now i want to trigger that door to close again behind me once i get through the door. I know the scripts but do i add those scripts to the same HPS or another one? also if its same one could you show me how to set one up? Sorry im new heres what ive got so far... //////////////////// // Run First time Starting map void OnStart() { AddUseItemCallback("", "Awesomekey_1", "mansion_1", "UsedKeyOnDoor", true); } void UsedKeyOnDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked("mansion_1", false, true); PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false); RemoveItem("Awesomekey_1"); } { AddEntityCollideCallback("Player", "RoomTwoArea", "CollideRoomTwo", true, 1); } void CollideRoomTwo(string &in asParent, string &in asChild, int alState) { void SetSwingDoorClosed("mansion_1", true, true); } RE: HPS Files - drunkmonk - 06-22-2012 you can setup a script area on the other side of the door use an AddEntityCollideCallback for when the player enters that area the door will close behind them. something like this void OnStart() { AddEntityCollideCallback("Player", "name of the area here", "CloseDoorFunction", true, 1); } void CloseDoorFunction(string &in asParent, string &in asChild, int alState) { //you can maybe use 3 different scripts here// SetSwingDoorClosed("name of your door", true, true); //or// AddPropImpulse("name of your door", 0, 0, 10, "World"); //may need to play around with this AddPropForce("name of your door", 0, 0, 10, "World"); //may need to play around with this } |