Frictional Games Forum (read-only)

Full Version: I need help with my Custom Story!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
So here is my Intro Map Script, i'm trying to add a "Wake Up Effect" But when i try to launch my Custom Story it crashes! Any Suggestions?
void OnStart()
{
SetPlayerActive(false);
FadeOut(0);
//FadePlayerRollTo(65, 20, 20);
MovePlayerHeadPos(-1, -0.45, -1.1, 20, 1);
AddTimer("activate_player", 3, "FadeIn");
SetLightVisible("BoxLight_1", false);
SetPlayerSanity(50);
AddUseItemCallback("OpenDoor", "MedicalKey", "level_wood_1", "UnlockLevelDoor", true);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
void UnlockLevelDoor(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked(asEntity, false);
PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);
RemoveItem(asItem);
GiveSanityBoostSmall();
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
void OnLeave()
{
SetupLoadScreen("Loading","LoadScreen1",0,"LoadScreenImage1.jpg");
}
////////////////////////////////////////////////////////////////////////////////////////
void FadeIn(string &in timer_name)
{
FadeIn(2);
AddTimer("Start", 2, "WakeUp");
}
void WakeUp(string &in timer_name)
{
if (timer_name == "Start")
{
SetLightVisible("Box_Light_1", true);
AddTime("MoveHead", 1, "WakeUp");
}
else if (timer_name == "MoveHead")
{
MovePlayerHeadPos(-0.5, -0.2, -1.1, 2, 2);
FadePlayerRollTo(0, 1.7, 500);
AddTimer("ActivatePlayer", 2, "WakeUp");
else if(timer_name == "ActivatePlayer");
{
MovePlayerHeadPos(0, 0, 0, 2, 2);
SetPlayerActive(true);
}
}
}
can you copy down the crash message? It makes it easier to find the bug
(03-22-2014, 04:24 AM)valetheimpaler Wrote: [ -> ]can you copy down the crash message? It makes it easier to find the bug

Here is the Crash Message:

FATAL ERROR: Could not load script file
'custom_stories/Amnesia_Fading Away/maps/01.hps'!
main(43, 1):ERR: Expected expression value
go down to line 43, get rid of the semicolon at the end
else if(timer_name == "ActivatePlayer");
should be
else if(timer_name == "ActivatePlayer")
let me know if that fixes it

btw, the crash usually says which line on the script it is (hence the 43) so try looking near the line of that number for help.
If your text editor deosnt show line #, try looking up notepadd ++ or something
(03-22-2014, 04:32 AM)valetheimpaler Wrote: [ -> ]go down to line 43, get rid of the semicolon at the end
else if(timer_name == "ActivatePlayer");
should be
else if(timer_name == "ActivatePlayer")
let me know if that fixes it

btw, the crash usually says which line on the script it is (hence the 43) so try looking near the line of that number for help.
If your text editor deosnt show line #, try looking up notepadd ++ or something

Nope that didn't work unfortunately :/
is the crash text any different?
(03-22-2014, 04:38 AM)valetheimpaler Wrote: [ -> ]is the crash text any different?

Nope :/
ok, while i was waiting found another error. Needs to be a bracket the line before the one i edited for you.
Missing the opposite for the previous one.
Also, you dont need that last bracket i dont think
(03-22-2014, 04:41 AM)valetheimpaler Wrote: [ -> ]ok, while i was waiting found another error. Needs to be a bracket the line before the one i edited for you.
Missing the opposite for the previous one.
Also, you dont need that last bracket i dont think

It still crashes :/
hmmmmmmmmmmmmm
post your current code
Pages: 1 2 3