Frictional Games Forum (read-only)
Whats wrong with my script? - 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: Whats wrong with my script? (/thread-10254.html)



Whats wrong with my script? - Henriksen - 09-10-2011

Hi, I cant see whats wrong with me script but it doesnt work ingame. I get a error Tongue

Script:

////////////////////////////
// Run first time starting map
void OnStart()
{
SetEntityPlayerInteractCallback("", "OpenCurtain", true);
SetEntityPlayerInteractCallback("", "Sleep", true);
SetEntityPlayerInteractCallback("", "StartConversation", true);
}

void StartConversation(string &in asEntity)
{
SetPlayerActive(false);
FadeOut(1);
AddTimer("", 2.0f, "TeleToDesk");
AddTimer("", 3.0f, "FadeToDesk");
}

void TeleToDesk(string &in asTimer)
{
AddTimer("", 2.0f, "InnkeeperHello");
SetEntityActive("block_box_1", true);
SetEntityActive("block_box_2", true);
SetEntityActive("block_box_3", true);
SetEntityActive("block_box_4", true);
SetEntityActive("StartConversation", false);
SetPlayerActive(true);
TeleportPlayer("PlayerStartArea_3");
}

void InnkeeperHello(string &in asTimer)
{
AddTimer("", 3.0f, "InnkeeperWhatDoYouWant");
SetMessage("TheInnkeeper", "Hello", 0);
}

void InnkeeperWhat(string &in asTimer)
}
SetMessage("TheInnkeeper", "What", 0);
}

void FadeToDesk(string &in asTimer)
{
FadeIn(3);
}

void Sleep(string &in asEntity)
{
SetPlayerActive(false);
FadeOut(1);
AddTimer("", 2.0f, "Tele");
AddTimer("", 3.0f, "SleepNow");
}

void Tele(string &in asTimer)
{
TeleportPlayer("PlayerStartArea_2");
}

void SleepNow(string &in asTimer)
{
FadeIn(1);
MovePlayerHeadPos(1.7, 0.03, 0.0, 0.5, 0.2);
AddTimer("", 6.0f, "Look1");
}

void Look1(string &in asTimer)
{
FadeOut(3);
}

void OpenCurtain(string &in asEntity)
{
FadeOut(1);
AddTimer("", 3.0f, "ActuallyOpen");
AddTimer("", 2.0f, "TheyAreOpen");
}

void TheyAreOpen(string &in asEntity)
{
SetEntityActive("curtain01_closed_1", false);
SetEntityActive("curtain01_open_1", true);
SetEntityActive("OpenCurtains", false);
}

void ActuallyOpen(string &in asTimer)
{
FadeIn(1);
}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}



RE: Whats wrong with my script? - Darion97 - 09-10-2011

What is the error? When the game crashes what it says?


RE: Whats wrong with my script? - Henriksen - 09-10-2011

(09-10-2011, 06:10 PM)Darion97 Wrote: What is the error? When the game crashes what it says?
It does'nt crash it says something about something being wrong with a "," or ";"



RE: Whats wrong with my script? - Your Computer - 09-10-2011

You didn't properly open InnkeeperWhat's code block.


RE: Whats wrong with my script? - Darion97 - 09-10-2011


This is wrong:
SetEntityPlayerInteractCallback("", "OpenCurtain", true);
SetEntityPlayerInteractCallback("", "Sleep", true);
SetEntityPlayerInteractCallback("", "StartConversation", true);







RE: Whats wrong with my script? - Henriksen - 09-11-2011

Could someone post the fixed script and tell me what I did wrong, still getting the error :C



RE: Whats wrong with my script? - Darion97 - 09-11-2011

This is wrong:
void TheyAreOpen(string &in asEntity)

This is true:
void TheyAreOpen(string &in asTimer)



RE: Whats wrong with my script? - Henriksen - 09-11-2011

(09-11-2011, 01:53 PM)Darion97 Wrote: This is wrong:
void TheyAreOpen(string &in asEntity)

This is true:
void TheyAreOpen(string &in asTimer)
Arghh im still getting the same error :C
Thanks for correcting the script though.



RE: Whats wrong with my script? - Darion97 - 09-11-2011

What say now?

void InnkeeperWhat(string &in asTimer)
}This is wrong
SetMessage("TheInnkeeper", "What", 0);
}


RE: Whats wrong with my script? - Your Computer - 09-11-2011

Note: Differing-from-documentation variable names will not crash the game. Likewise, empty strings will only crash the game if a reference is required but none was given.