HPL2 sound and add entitles, on area. //script need help - 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: HPL2 sound and add entitles, on area. //script need help (/thread-10874.html) |
HPL2 sound and add entitles, on area. //script need help - johnbanana - 10-20-2011 Im hoppeing im puting this on the right place. i have dyslexria and ADD. so dont rip your head off if my stupidity is overwhelming. i have try to find tutorials and read on other forums and never found a simple way just to add (on player,collide,area,script ==> ad enitis/sound(ad just a scary sound "once") i do know some scripting, like adding a grunt and give him pathnods. i do also know how to ad a lever that open a secret shalf. my questions is. 1. how do you script to an "area" the player runs into and plays a sound (only once) 2. player runs into an "area" and a entity pop up. lika an statue or a naked guy falling from the celling. yes i have tryd find sulutions on http://wiki.frictionalgames.com/hpl2/start never found any.(or just simply missunderstod.) sooo.. i wuld be wery happy if you shared your way how to ad a simple-script "player" walk into "area" that trigger a sound or an entity i really shuld stop wasting 5 hours on just testing one script that never works. i better ask you people. my english sucks ^^ need better explnation just tell me. [attachment=2129] RE: HPL2 sound and add entitles, on area. //script need help - Obliviator27 - 10-20-2011 Use the area tool in the level editor, and make an area in your map. Make sure it's a script area (not slime, liquid, insanity, etc) Then, in your OnStart function add AddEntityCollideCallback (parameters and such can be found on the wiki) then create another function that has PlaySoundAtEntity in it (again, parameters in the wiki) For the second one, create another AddEntityCollideCallback in your OnStart function Then, in another function, have SetEntityActive (parameters in the wiki) For this to work right, you have to place the entity in the map, and uncheck the "active" box. Script Examples Code: void OnStart() Code: void OnStart() RE: HPL2 sound and add entitles, on area. //script need help - johnbanana - 10-20-2011 (10-20-2011, 06:47 PM)Obliviator27 Wrote: Use the area tool in the level editor, and make an area in your map. Make sure it's a script area (not slime, liquid, insanity, etc)have alredy try the second one. and it work! thanks alot. still its silly that i didnt mange to get none of these simple scripts to work... (when im work on it alone) i wonder where did i go wrong. :/ |