Frictional Games Forum (read-only)
Please 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: Please Help! (/thread-14006.html)



Please Help! - EthanLancaster - 03-15-2012

Ive been trying to find the error in this script for about an hour! Im really bad at it please help!

void OnStart ( )
{
AddUseItemCallback("", "LibraryKey, mansion_1, UsedKeyOnDoor, true);
AddEntityCollideCallback("Player", "StartPoint_Quest", "GetStartPoint", true, 1);
AddEntityCollideCallback("Player", "StartPoint_Quest", "FinishStartPoint", true, 1);
}
void UsedKeyOnDoor(string &in asEntity, int alState)
void GetStartPoint(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorLocked("mansion_1", false, true);
AddQuest ( "investigate", "Investigate" ) ;
}

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




RE: Please Help! - Your Computer - 03-15-2012

Do research on how to define a function.


RE: Please Help! - Equil - 03-15-2012

Um, could you explain exactly what you're trying to achieve with this script? Unlock a door then start a quest?



RE: Please Help! - Strembitsky - 03-15-2012

You're missing an immense amount of quotations in your script. Do what Your Computer said.


RE: Please Help! - Xanthos - 03-16-2012

I see this error
AddUseItemCallback("", "LibraryKey, mansion_1, UsedKeyOnDoor, true);

See this ["LibraryKey]
Add them "
FIXED ["LibraryKey"]
See this [mansion_1]
FIXED ["mansion_1"]

--And I would add this to the scripts--
GiveSanityBoostSmall();
OR
GiveSanityBoost();
----

PlaySoundAtEntity("", "unlock_door", "Player", 0, false);
RemoveItem("LibraryKey");
-----------------Now Here I fix it all At once--------------
void OnStart ()
{
AddUseItemCallback("", "LibraryKey", "mansion_1", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "StartPoint_Quest", "GetStartPoint", true, 1);
AddEntityCollideCallback("Player", "StartPoint_Quest", "FinishStartPoint", true, 1);
}
void UsedKeyOnDoor(string &in asEntity, int alState)
{
SetSwingDoorLocked("mansion_1", false, true);

PlaySoundAtEntity("", "unlock_door", "Player", 0, false);
RemoveItem("LibraryKey");
GiveSanityBoostSmall();
}

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();
}

-----------------------------
Plug that shit in and if a message pops up.
Reply that message so I can fixy


RE: Please Help! - EthanLancaster - 03-16-2012

Thank you!!! I no longer get an error but the key will not go to the door. It says cannot use item this way. :/ Do I have to connect the props somehow? Thanks again for your help!


RE: Please Help! - EthanLancaster - 03-16-2012

Here is my current script. Please help im so lost. It says cannot use item this way every time. Thanks in advance!

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

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();
}






RE: Please Help! - Xanthos - 03-16-2012

(03-16-2012, 08:12 PM)EthanLancaster Wrote: Here is my current script. Please help im so lost. It says cannot use item this way every time. Thanks in advance!

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

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();
}
I decided to post this on your thread so others can see.
The Error
void KeyOnDoor(string &in asEntity)

This Fixed
void KeyOnDoor(string &in asItem, string &in asEntity)



RE: Please Help! - EthanLancaster - 03-16-2012

(03-16-2012, 09:42 PM)Xanthos Wrote:
(03-16-2012, 08:12 PM)EthanLancaster Wrote: Here is my current script. Please help im so lost. It says cannot use item this way every time. Thanks in advance!

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

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();
}
I decided to post this on your thread so others can see.
The Error
void KeyOnDoor(string &in asEntity)

This Fixed
void KeyOnDoor(string &in asItem, string &in asEntity)


That fixed it! Thank you!!!