Frictional Games Forum (read-only)
script fail - 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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: script fail (/thread-8460.html)



script fail - klacke - 06-05-2011

Hello, i got a help with a script, but when i tries to load my custom it just ends up with an error,

Here is the script

void MakePrisonerDisapear_1(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);
PlaySoundAtEntity("", "leather_walk.snt", "prisoner", 0.0f, false);
PlaySoundAtEntity("", "react_scare.snt", "Player", 0.0f, false);
StartPlayerLookAt("LookAtPrisoner", 5.0f, 5.0f, "");
Addtimer("", 1.0f, "MakePrisonerDisappear_2");
}
void MakePrisonerDisappear_2(string &in asTimer);
{
GiveSanityDamage(5, true);
SetEntityActive("prisoner", false);
SetPlayerActive(true);

Do you see anything wrong with it?
Plz reply with a fix it would be awesome! Big Grin


RE: script fail - Apjjm - 06-05-2011

(06-05-2011, 12:58 PM)klacke Wrote: void MakePrisonerDisappear_2(string &in asTimer);
You shouldn't have a semi-colon at the end of that line.


RE: script fail - Kyle - 06-05-2011

Is this your complete script? If not, here is the modified version:

Code:
void MakePrisonerDisapear_1(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);
PlaySoundAtEntity("", "leather_walk.snt", "prisoner", 0.0f, false);
PlaySoundAtEntity("", "react_scare.snt", "Player", 0.0f, false);
StartPlayerLookAt("LookAtPrisoner", 5.0f, 5.0f, "");
AddTimer("", 1.0f, "MakePrisonerDisappear_2");
}
void MakePrisonerDisappear_2(string &in asTimer)
{
GiveSanityDamage(5, true);
SetEntityActive("prisoner", false);
SetPlayerActive(true);
}



RE: script fail - klacke - 06-05-2011

(06-05-2011, 01:16 PM)Kyle Wrote: Is this your complete script? If not, here is the modified version:

Code:
void MakePrisonerDisapear_1(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);
PlaySoundAtEntity("", "leather_walk.snt", "prisoner", 0.0f, false);
PlaySoundAtEntity("", "react_scare.snt", "Player", 0.0f, false);
StartPlayerLookAt("LookAtPrisoner", 5.0f, 5.0f, "");
AddTimer("", 1.0f, "MakePrisonerDisappear_2");
}
void MakePrisonerDisappear_2(string &in asTimer)
{
GiveSanityDamage(5, true);
SetEntityActive("prisoner", false);
SetPlayerActive(true);
}

Saw now that i forgot 1 line

AddEntityCollideCallback("Player", "DisapearGuy1", "MakePrisonerDisappear_1", true, 1);

cuz when i copied yours i still got that error message...



RE: script fail - ferryadams10 - 06-08-2011

Dude, I had fixed that allready before u posted this thread Big Grin