![]() |
Lever and Entity - 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: Lever and Entity (/thread-21432.html) |
Lever and Entity - Smackdown - 05-07-2013 Hello I want that when I turn a lever, there appear and disappear some Entities I want, I also want to add a sound. So it should look like that? void OnStart() { ??????("mechanismus2", "lever2", "????", true, false, 0); } void func2(string &in asEntity) { AddLocalVarInt("Var1", 1); lever2(); } void lever2() { if(GetLocalVarInt("Var1") == 1) { PlaySoundAtEntity("", "explosion_rock_large.snt", "player", 0.5f, false); GiveSanityBoostSmall(); SetEntityActive("wine02_1", true); } } Or how do I script that? I don't get it. Please help RE: Lever and Entity - Tomato Cat - 05-07-2013 So...You want to pull a lever and have an entity appear/disappear? You have it mostly right. You don't really need the variable, though. For example, this should be a SetEntityConnectionStateChangeCallback PHP Code: void OnStart() The callback function's syntax would look like this: PHP Code: void YourFunction(string &in asEntity, int alState) RE: Lever and Entity - Smackdown - 05-07-2013 Thank you very much. All things work, except the sound. It does not play the explosion thing on player: PHP Code: void explosion(string &in asEntity, int alState) RE: Lever and Entity - Tomato Cat - 05-07-2013 I'm not sure if it matters, but try capitalizing "player." RE: Lever and Entity - DnALANGE - 05-07-2013 player must be Player. try that and remove the other line, it is useless there : PlaySoundAtEntity("", "", "player", 0.5f, false); RE: Lever and Entity - Smackdown - 05-07-2013 Ill try How do I delet posts? ^^ Thank you, that was the fault. Now it works with Player ![]() |