Frictional Games Forum (read-only)
Piano scare. Scripting 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: Piano scare. Scripting help (/thread-14044.html)



Piano scare. Scripting help - EthanLancaster - 03-16-2012

I am absolutley terrible at scripting. I need help and lots of it. can someone please fix the script?

void OnStart ()
{
AddUseItemCallback("", "LibraryKey", "mansion_2", "KeyOnDoor", true);
AddEntityCollideCallback("Player", "StartPoint_Quest", "GetStartPoint", true, 1);
AddEntityCollideCallback("Player", "StartPoint_Quest", "FinishStartPoint", true, 1);
AddEntityCollideCallback("Player" , "pianostop" , "pianostop" , true , 1);
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_2", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_2", 1, false);
RemoveItem("LibraryKey");
GiveSanityBoostSmall();
}

void pianostop(string &in asParent, string &in asChild, int alState)
void GetStartPoint(string &in asParent, string &in asChild, int alState)
{
AddQuest("investigate","Investigate");
PlaySoundAtEntity("", "general_piano02", piano_1", "Player", 0.5f, false);
PlayGuiSound("react_breath_slow", 0.5f);
}

void FinishStartPoint(string &in asParent, string &in asChild, int alState)
{
CompleteQuest("investigate","Investigate") ;
GiveSanityBoostSmall();
}




RE: Piano scare. Scripting help - Strembitsky - 03-16-2012

You are missing quotations. Read through your entire script, or maybe even where the error message says to.


RE: Piano scare. Scripting help - PythonBlue - 03-17-2012

What Strembitsky said. When I script and the game crashes, it generally gives me the specific line that contains the error(s).


RE: Script Help! - Equil - 03-18-2012

Code:
void pianostop(string &in asParent, string &in asChild, int alState)

void GetStartPoint(string &in asParent, string &in asChild, int alState)

{

AddQuest("investigate","Investigate");

PlaySoundAtEntity("", "general_piano02", piano_1", "Player", 0.5f, false);

PlayGuiSound("react_breath_slow", 0.5f);

}

1. void pianostop(string &in asParent, string &in asChild, int alState) // Is basically just floating in the middle of your script without any braces, being { and }

2. PlaySoundAtEntity("", "general_piano02", piano_1", "Player", 0.5f, false); // No quotation at the start of piano_1.

3. PlaySoundAtEntity("", "unlock_door", "mansion_2", 1, false); // Not sure if it's required or not, but I think you're supposed to include the extension for the sound. i.e, "unlock_door.snt"




RE: Piano scare. Scripting help - Xanthos - 03-20-2012

We actually started a message thingy Here's what I did. He said it didn't work
--------
void OnStart ()
{
AddUseItemCallback("", "LibraryKey", "mansion_2", "KeyOnDoor", true);
AddEntityCollideCallback("Player", "StartPoint_Quest", "GetStartPoint", true, 1);
AddEntityCollideCallback("Player", "StartPoint_Quest", "FinishStartPoint", true, 1);
AddEntityCollideCallback("Player" , "pianostop" , "pianostop" , true , 1);
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_2", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_2", 0.5f, false);
RemoveItem("LibraryKey");
GiveSanityBoostSmall();
}

void pianostop(string &in asParent, string &in asChild, int alState)
{
[align=-webkit-auto]PlaySoundAtEntity("", "general_piano02", piano_1", "Player", 0.5f, false);
[/align][align=-webkit-auto]}[/align]
void GetStartPoint(string &in asParent, string &in asChild, int alState)
{
AddQuest("investigate","Investigate");
PlayGuiSound("react_breath_slow", 0.5f);
}

void FinishStartPoint(string &in asParent, string &in asChild, int alState)
{
CompleteQuest("investigate","Investigate") ;
GiveSanityBoostSmall();
}