![]() |
[SCRIPT] callback and scripting issues! :( - 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] callback and scripting issues! :( (/thread-25482.html) |
callback and scripting issues! :( - G510s - 06-16-2014 i am a beginner at scripting and i have a few questions...i am using the call back script to change my music in a game but the music wont change...and its not saying theres anything wrong with the script...wjat do i do???HELP PLEASE! ..... RE: callback and scripting issues! :( - MsHannerBananer - 06-16-2014 Post the script you used for the callback. ![]() RE: callback and scripting issues! :( - G510s - 06-16-2014 oid OnStart() { PlayMusic("10_amb", true, 4.3, 7, 2, true); AddUseItemCallback("", "Key_01", "Door_01", "DoorUnlock", true); AddEntityCollideCallback("Player", "Script", "Music", true, 1); } void DoorUnlock(string &in asItem, string &in asEntity) { SetSwingDoorLocked(asEntity, false, true); PlaySoundAtEntity("", "Unlock_Door.snt", asEntity, 0, false); RemoveItem(asItem); } void Music(string &in asParent, string &in asChild, int alState) { PlayMusic("dan_Brute", true, 3.2, 8, 1, true); } void OnEnter() { } void OnLeave() { } void OnStart() { PlayMusic("10_amb", true, 4.3, 7, 2, true); AddUseItemCallback("", "Key_01", "Door_01", "DoorUnlock", true); AddEntityCollideCallback("Player", "Script", "Music", true, 1); } void DoorUnlock(string &in asItem, string &in asEntity) { SetSwingDoorLocked(asEntity, false, true); PlaySoundAtEntity("", "Unlock_Door.snt", asEntity, 0, false); RemoveItem(asItem); } void Music(string &in asParent, string &in asChild, int alState) { PlayMusic("dan_Brute", true, 3.2, 8, 1, true); } void OnEnter() { } void OnLeave() { } ------------------------------------- srry i messed up i forgot to highlight the "V" on void on start. RE: callback and scripting issues! :( - Neelke - 06-16-2014 Your regular musics priority is higher than the brute music. PlayMusic("10_amb", true, 4.3, 7, "2", true); - That is higher than the brutes music. (the one surrounded with "") PlayMusic("dan_Brute", true, 3.2, 8, "1", true); So change them to this below: PlayMusic("10_amb", true, 4.3, 7, 0, true); PlayMusic("dan_Brute", true, 3.2, 8, 10, true); RE: callback and scripting issues! :( - Mudbill - 06-16-2014 It might be important to name the dan_brute track correctly with case as well. The original sound file is named dan_brute with a lower B. |