Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Unexpected End of File Crash Report...HELP!
DrOctoganapus8 Offline
Junior Member

Posts: 12
Threads: 4
Joined: Feb 2012
Reputation: 0
#4
RE: Unexpected End of File Crash Report...HELP!

Hey, thanks for the help last time, but I have another error, and I can't seem to figure out how to fix it.
I added a new function that calls a timer, which calls another timer.
The error is:

FATAL ERROR: Could not load script file 'custom_stories/My Custom Stroy(The Landlord)/maps/map02.hps'!
main (149, 26) : ERR : Expected ')' or ','
main (156, 26) : ERR : Expected ')' or ','

What I added to the script was:

void func_doorboom(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);
StartPlayerLookAt("smash_door", 2, 6, "");
AddTimer("look03", 1.5f, "look03");
}

void look03(string&in as Timer)
{
PlaySoundAtEntity("", "12_girl_scream.snt", "Player", 0, false);
PlaySoundAtEntity("", "scare_steps_big1.ogg", "Player", 0, false);
AddTimer("look04", 1.5f, "look04");
}

void look04(string&in as Timer)
{
SetPropHealth("smash_door", 0.0f);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
SetPlayerActive(true);
StopPlayerLookAt();
}

Which makes the full script:

////////////////////////////////////////
//Script Start
void OnStart()

{
//////////////////////////////////////////////////////////////////////////////
//Add the Lantern and 10 Tinderboxes when in Debug mode, LET THERE BE LIGHT!!!
if(ScriptDebugOn())
{
GiveItemFromFile("lantern", "lantern.ent");

for(int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
}

{
AddUseItemCallback("", "bedroom_key", "locked_bedroom", "func_unlock", true);
AddEntityCollideCallback("Player", "killlights_script", "func_killlights", true, 1);
SetEntityPlayerInteractCallback("therentor_note", "func_enable", true);
AddEntityCollideCallback("Player", "gruntspawn_script", "spawn_grunt", true, 1);
AddEntityCollideCallback("Player", "redlight_script1", "func_redlight", true, 1);
AddEntityCollideCallback("Player", "redlight_script2", "func_redlight2", true, 1);
AddEntityCollideCallback("Player", "explode_script", "func_doorboom", true, 1);
}
}

//////////////////////////////
//script for unlocking bedroom
void func_unlock(string &in item, string &in door)
{
SetSwingDoorLocked("locked_bedroom", false, true);
PlaySoundAtEntity("", "unlock_door", door, 0, false);
RemoveItem("bedroom_key");
}

//////////////////////////////////////////////////////
//Script for enabling light script after grabbing note
void func_enable(string &in item)
{
SetEntityActive("killlights_script", true);
SetEntityActive("gruntspawn_script", true);
}

///////////////////////////////
//Script for killing the lights
void func_killlights(string &in asParent, string &in asChild, int alState)
{
SetLampLit("lightoff01", false, false);
SetLampLit("lightoff02", false, false);
SetLampLit("lightoff03", false, false);
SetLampLit("lightoff04", false, false);
SetLampLit("lightoff05", false, false);
SetLampLit("lightoff06", false, false);
SetLampLit("lightoff07", false, false);
SetLampLit("lightoff08", false, false);
SetLampLit("lightoff09", false, false);
SetLampLit("lightoff10", false, false);

SetEntityActive("red_light1", true);
SetEntityActive("red_light2", true);
SetEntityActive("armor_spawn1", true);
SetEntityActive("armor_spawn2", true);

SetSwingDoorClosed("slam_scare", true, true);

PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);

PlaySoundAtEntity("", "react_scare", "Player", 0, false);

PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);

PlayMusic("21_event_pit.ogg", false, 1.00, 0, 0, false);
GiveSanityDamage(10.0f, true);
}

////////////////////////////////
//Script for spawning REAL grunt
void spawn_grunt(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("grunt_spawn", true);
AddEnemyPatrolNode("grunt_spawn", "PathNodeArea_3", 5, "");
AddEnemyPatrolNode("grunt_spawn", "PathNodeArea_4", 3, "");
AddEnemyPatrolNode("grunt_spawn", "PathNodeArea_5", 3, "");
AddEnemyPatrolNode("grunt_spawn", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("grunt_spawn", "PathNodeArea_7", 3, "");
AddEnemyPatrolNode("grunt_spawn", "PathNodeArea_8", 3, "");
AddEnemyPatrolNode("grunt_spawn", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("grunt_spawn", "PathNodeArea_10", 3, "");
AddEnemyPatrolNode("grunt_spawn", "PathNodeArea_11", 5, "");
}

///////////////////////////////////
//Script for redlights/creepy doors
void func_redlight(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);
StartPlayerLookAt("lock_door", 2, 6, "");
AddTimer("look01", 1.5f, "look01");
}
void look01(string&in asTimer)
{
SetEntityActive("redlight_spawn1", true);
SetEntityActive("redlight_spawn2", true);

SetEntityActive("burntout1", false);

SetEntityActive("burntout2", false);
GiveSanityDamage(2.5f, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
SetEntityActive("redlight_script2", true);
SetSwingDoorClosed("lock_door", true, true);
SetSwingDoorLocked("lock_door", true, true);
{
SetPlayerActive(true);
StopPlayerLookAt();
}
}

void func_redlight2(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);
StartPlayerLookAt("smash_door", 2, 6, "");
AddTimer("look02", 1.5f, "look02");
}

void look02(string&in asTimer)
{
SetEntityActive("redlight_spawn3", true);
SetEntityActive("redlight_spawn4", true);

SetEntityActive("burntout3", false);

SetEntityActive("burntout4", false);
GiveSanityDamage(2.5f, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
{
SetEntityActive("explode_script", true);
SetPlayerActive(true);
StopPlayerLookAt();
}
}

void func_doorboom(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);
StartPlayerLookAt("smash_door", 2, 6, "");
AddTimer("look03", 1.5f, "look03");
}

void look03(string&in as Timer)
{
PlaySoundAtEntity("", "12_girl_scream.snt", "Player", 0, false);
PlaySoundAtEntity("", "scare_steps_big1.ogg", "Player", 0, false);
AddTimer("look04", 1.5f, "look04");
}

void look04(string&in as Timer)
{
SetPropHealth("smash_door", 0.0f);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
SetPlayerActive(true);
StopPlayerLookAt();
}

Please help!! Thanks!~
03-01-2012, 12:17 AM
Find


Messages In This Thread
RE: Unexpected End of File Crash Report...HELP! - by DrOctoganapus8 - 03-01-2012, 12:17 AM



Users browsing this thread: 5 Guest(s)