Help With Scripting Sanity Damage With Door! - 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: Help With Scripting Sanity Damage With Door! (/thread-4962.html) |
Help With Scripting Sanity Damage With Door! - Kyle - 10-07-2010 I need help with trying to make it when the door closes, you get sanity damage. I need for this to get combined for it to work nicely. GiveSanityDamage(float afAmount, bool abUseEffect); void OnStart() { AddEntityCollideCallback("Player" , "ScriptArea_1" , "CollideRoomTwo" , true, 1); } void CollideRoomTwo(string &in asParent, string &in asChild, int alState) { SetSwingDoorClosed("cellar_wood01_1", true, true); } void OnEnter() { } void OnLeave() { } Anyone please? RE: Help With Scripting Sanity Damage With Door! - Chilton - 10-08-2010 void OnStart() { AddEntityCollideCallback("Player" , "ScriptArea_1" , "CollideRoomTwo" , true, 1); } void CollideRoomTwo(string &in asParent, string &in asChild, int alState) { SetSwingDoorClosed("cellar_wood01_1", true, true); GiveSanityDamage(25, 1); } void OnEnter() { } void OnLeave() { } Note were i put the "1" in the sanity effect - If that doesnt work, replace it with "True" RE: Help With Scripting Sanity Damage With Door! - Kyle - 10-08-2010 Thank you very much! It works like a charm! Yay! RE: Help With Scripting Sanity Damage With Door! - Chilton - 10-08-2010 (10-08-2010, 11:35 AM)Kyle Wrote: Thank you very much! It works like a charm! Yay! Any time - Glad i could be of assistance |