Door needs two keys script no effect - 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: Door needs two keys script no effect (/thread-6907.html) |
Door needs two keys script no effect - Raymond - 03-16-2011 As the title said, my .hps is like this: Code: void Onstart() Did i put something wrong? If i did please tell me . RE: Door needs two keys script no effect - Anxt - 03-16-2011 You need an if statement that is called when the "KeysUsed" int has a value of 2. So it would be like this: Keep your OnStart the same, but have this as your function: void KeyCounter(string &in asItem, string &in asEntity) { AddLocalVarInt("KeysUsed", 1); if(GetLocalVarInt("KeysUsed")==2) { SetSwingDoorLocked("mansion_3", false, true) PlaySoundAtEntity("", "unlock_door", "mansion_3", 0, false); } } Also, there's no need to post a new thread about this. You already have one about this exact function. Just go back to it and post in it instead of starting another new topic. RE: Door needs two keys script no effect - Raymond - 03-16-2011 (03-16-2011, 05:52 AM)Anxt Wrote: You need an if statement that is called when the "KeysUsed" int has a value of 2. So it would be like this: Okay, thanks for the tip . Still no effects, my collide and function is like this: Code: void Onstart() I copied your code and still no effects . RE: Door needs two keys script no effect - Pandemoneus - 03-16-2011 (03-16-2011, 05:54 AM)Raymond Wrote: I copied your code and still no effects . And there lies the problem. Sorry Raymond, but you really gotta start understanding code instead of just copying from others/letting others make it for you. RE: Door needs two keys script no effect - Viperdream - 03-16-2011 Read this and you will understand variables: http://wiki.frictionalgames.com/hpl2/tutorials/script/entihscript_beginner RE: Door needs two keys script no effect - Raymond - 03-17-2011 (03-16-2011, 01:33 PM)Viperdream Wrote: Read this and you will understand variables: Thanks for the link . The most confusing one is the for(int i = 0;i < 10;i++) from >>> because it's hard to understand . Code: if(ScriptDebugOn()) |