[SCRIPT] Can't make door explode? - 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 - Development (https://www.frictionalgames.com/forum/forum-38.html) +---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html) +---- Thread: [SCRIPT] Can't make door explode? (/thread-13080.html) |
Can't make door explode? - GrAVit - 02-03-2012 Hey, I can't make my "prison_section_plain_2" door explode for colliding with an area. The door is set locked. It's openamount is 0. Code: void OnStart() If the door cannot be destroyed like this, is there any workaround? I do not wish to interact with the door directly. RE: Can't make door explode? - JenniferOrange - 02-03-2012 http://wiki.frictionalgames.com/hpl2/tutorials/script/events#the_exploding_door This should help. :] RE: Can't make door explode? - GrAVit - 02-03-2012 (02-03-2012, 11:42 PM)JenniferOrange Wrote: http://wiki.frictionalgames.com/hpl2/tutorials/script/events#the_exploding_doorI've seen it, and it only includes on how to destroy a door with interaction, I would like it to be destroyed when entering a script area. RE: Can't make door explode? - JenniferOrange - 02-03-2012 Change the door to a script area then. void OnStart() { AddEntityCollideCallback("Player", "NAMEOFSCRIPTAREA", "Explode", true, 1); } void Explode(string &in asParent, string &in asChild, int alState) { SetPropHealth("door1", 0.0f); PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false); PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false); GiveSanityDamage(5.0f, true); } WARNING: not tested, though it should work. EDIT: just realized you tried something like this. The script is perfectly fine, the problem is, the prison section just can't explode. I know for a fact there are some entities/doors that just won't do certain things. Replace the door with a different one, and try the script again. It should explode this time. RE: Can't make door explode? - GrAVit - 02-03-2012 (02-03-2012, 11:50 PM)JenniferOrange Wrote: The script is perfectly fine, the problem is, the prison section just can't explode. I know for a fact there are some entities/doors that just won't do certain things. Replace the door with a different one, and try the script again. It should explode this time.Alright, thanks. I think I'll make it slam open it then since I can't really fit any other door there. RE: Can't make door explode? - RawkBandMan - 02-04-2012 (02-03-2012, 11:42 PM)JenniferOrange Wrote: http://wiki.frictionalgames.com/hpl2/tutorials/script/events#the_exploding_doorHey I noticed a problem there! It says to replace void func_slam(string &in asParent, string &in asChild, int alState) With void func_slam(string &in asEntity) Then the final script is this void OnStart() { SetEntityPlayerInteractCallback("door1", "func_slam", true); } void func_slam(string &in asParent, string &in asChild, int alState) { SetPropHealth("door1", 0.0f); PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false); PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false); GiveSanityDamage(5.0f, true); } :| RE: Can't make door explode? - JenniferOrange - 02-04-2012 (02-04-2012, 03:43 PM)XxRoCkBaNdMaNxX Wrote:You're right! o:(02-03-2012, 11:42 PM)JenniferOrange Wrote: http://wiki.frictionalgames.com/hpl2/tutorials/script/events#the_exploding_doorHey I noticed a problem there! It says to replace Unfortunately it's not my tutorial so.. |