Frictional Games Forum (read-only)

Full Version: Whats wrong with my script?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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()
{

}
What is the error? When the game crashes what it says?
(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 ";"
You didn't properly open InnkeeperWhat's code block.

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




Could someone post the fixed script and tell me what I did wrong, still getting the error :C
This is wrong:
void TheyAreOpen(string &in asEntity)

This is true:
void TheyAreOpen(string &in asTimer)
(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.
What say now?

void InnkeeperWhat(string &in asTimer)
}This is wrong
SetMessage("TheInnkeeper", "What", 0);
}
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.