![]() |
Monster Play Sound After PathNode!!!! - 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: Monster Play Sound After PathNode!!!! (/thread-20322.html) |
Monster Play Sound After PathNode!!!! - VeNoMzTeamHysterical - 02-14-2013 Anyone knows how to the script when a monster is at the pathnode and he is be gone i want to get a sound ![]() AddEntityCollideCallback("monsterscene1", "RocksSound", "RocksFunc", true, 1); So i want to if the monster hits the script area rocksound it wil activate a function called rocksfunc. void RocksFunc(string &in Entity) { PlaySoundAtEntity("", "break_wood1.snt", "monsterscene1", 0, false); } But it doesnt work ;( link of my story file http://www.mediafire.com/?ba1a5xycwdqvdp8 RE: Monster Play Sound After PathNode!!!! - FlawlessHappiness - 02-14-2013 Make sure the player cannot see the monster when he is supposed to disappear. Put an area where the monster will despawn. When the monster collides with the area, set it inactive, and play the sound RE: Monster Play Sound After PathNode!!!! - VeNoMzTeamHysterical - 02-14-2013 (02-14-2013, 04:04 PM)BeeKayK Wrote: Make sure the player cannot see the monster when he is supposed to disappear. Well monster walks around a corner... player dont see it after 2 sec player cant see monster i want an BAM sound and then they way is collapsed with rocks.... but i dont know the script to do it >< i just want if the monster is at the last pathnode its be gone and activate that BAM sound. RE: Monster Play Sound After PathNode!!!! - FlawlessHappiness - 02-14-2013 It happens if you make it collide with a script area. You must understand what the script does. AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates); This is the entity that collides with something. In your case, a monster. This is the object that entity_1 collides with. In your case, a scriptarea When the monster collides with the script area it will call the function: SetEntityActive("Monster", false); and PlaySoundAtEntity("", "soundfile.snt", "Entity", 0, false); Which you have probably used before RE: Monster Play Sound After PathNode!!!! - VeNoMzTeamHysterical - 02-14-2013 (02-14-2013, 04:14 PM)BeeKayK Wrote: It happens if you make it collide with a script area. So you mean i can just make the same as on a Player 'if player walks on a script it activates an function' so you mean i can do it also with a monster Pathnode where the monster go's and then script file where its the end of his pathnode since there is the script file where he collides its activating a function that is activates a sound ![]() RE: Monster Play Sound After PathNode!!!! - FlawlessHappiness - 02-14-2013 You can do that with every entity in the game! That's how scripting works. You type a name, and the script will look through your map for an entity that has the same name. Then it will use it. It's that simple! You just learned something important about scripting! Keep doing that RE: Monster Play Sound After PathNode!!!! - VeNoMzTeamHysterical - 02-14-2013 (02-14-2013, 04:48 PM)BeeKayK Wrote: You can do that with every entity in the game! Well its still not working lol xD I dont know what i do wrong.... RE: Monster Play Sound After PathNode!!!! - FlawlessHappiness - 02-14-2013 You could post your script now ![]() If this is the one you are using: AddEntityCollideCallback("monsterscene1", "RocksSound", "RocksFunc", true, 1); Then i'll just fix it for you: AddEntityCollideCallback("MonsterNameGoesHere", "RocksSound", "RocksFunc", true, 1); RE: Monster Play Sound After PathNode!!!! - VeNoMzTeamHysterical - 02-14-2013 (02-14-2013, 05:00 PM)BeeKayK Wrote: You could post your script now The monster name is 'monsterscene1 i will test it k ![]() RE: Monster Play Sound After PathNode!!!! - FlawlessHappiness - 02-14-2013 oh, ok.... Ah i see it! (string &in Entity) These parameters are for interacting, not for colliding. (string &in asParent, string &in asChild, int alState) is the correct one. Maybe this will help (Sorry for selfpromotion) http://www.frictionalgames.com/forum/thread-18368.html |