The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Error, unexpected end of file
Hatred Offline
Junior Member

Posts: 10
Threads: 3
Joined: Feb 2012
Reputation: 1
#1
Error, unexpected end of file

Hello again.

I've almost completed my new custom story, but a problem has occured.
When in-game I try to load lets say "Map4.map", it throws a fatal error right at my face saying:
"FATAL ERROR: Couldn't load script file 'custom_stories/MyCustom/maps/Map4.hps' !
Main (405, 2) : ERR : Unexpected end of file.

I have tried to fix this problem for over 3 hours and still not working.
Strange yes, it did work yesterday and I haven't made any changes to hps.file since when I tested that map and it worked then. Line 405 is the last } in the whole script.

Here's my script:

////////////////////////////
// Run first time starting map
void OnStart()
{
CompleteQuest("dungeon", "DungeonQuest");
CompleteQuest("cellar", "CellarQuest");
CompleteQuest("demon", "DemonQuest");
AddQuest("mansion", "MansionQuest");
AddQuest("intro", "IntroQuest");
FadeIn(1);
PlayMusic("18_amb.ogg", true, 1.0f, 1, 0, true);
AddUseItemCallback("", "key_study_1", "mansion_1", "UsedKey", true);
AddUseItemCallback("", "key_torture_chamber_1", "work_desk_door_worn_1", "UsedKey2", true);
AddUseItemCallback("", "key_tower_1", "mansion_4", "UsedKey3", true);
AddEntityCollideCallback("Player", "ScriptArea_1", "CollideScriptArea_1", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "CollideScriptArea_2", false, 1);
AddEntityCollideCallback("Player", "ScriptArea_3", "CollideScriptArea_3", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_4", "CollideScriptArea_4", false, 1);
AddEntityCollideCallback("Player", "ScriptArea_5", "CollideScriptArea_5", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_6", "CollideScriptArea_6", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_7", "CollideScriptArea_7", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_8", "CollideScriptArea_8", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_9", "CollideScriptArea_9", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_10", "CollideScriptArea_10", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_11", "CollideScriptArea_11", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_12", "CollideScriptArea_12", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_13", "CollideScriptArea_13", true, 1);
SetEntityConnectionStateChangeCallback("lever_small01_min_1", "func_shelf");
SetEntityPlayerLookAtCallback("corpse_male_1", "SanityDrain", true);
SetEntityPlayerInteractCallback("level_celler_1", "VaihdaMap4", true);
SetLocalVarInt("CandlesLit", 0); // Sets a variable "CandlesLit" to zero.
SetEntityCallbackFunc("candle_floor_1", "CandleLight");
SetEntityCallbackFunc("candle_floor_2", "CandleLight");
SetEntityCallbackFunc("candle_floor_3", "CandleLight");
SetEntityCallbackFunc("candle_floor_4", "CandleLight");
SetEntityCallbackFunc("candle_floor_5", "CandleLight");
// Replace candlename with the names of your candles, and call as many times as there are candles. Could be done under the interactcallback tab of the candle itself.
}
void CandleLight(string &in asEntity, string &in type)
{
AddLocalVarInt("CandlesLit", 1);
if(GetLocalVarInt("CandlesLit") == 5) // If the variable is equal to five, execute following statement
{
FadeOut(5);
SetPlayerCrouching(true);
FadePlayerRollTo(90, 50, 50);
PlaySoundAtEntity("", "player_bodyfall.snt", "Player", 0, false);
SetPlayerSanity(0);
SetEntityActive("key_torture_chamber_1", true);
SetEntityActive("enemy_suitor_2", true);
AddTimer("ScareTimer", 10, "StopLook");
SetPlayerActive(false);
StartPlayerLookAt("enemy_suitor_2", 25, 25, "");
SetEnemyDisableTriggers("enemy_suitor_2", true);
AddEnemyPatrolNode("enemy_suitor_2", "PathNodeArea_36", 0, "");
AddEnemyPatrolNode("enemy_suitor_2", "PathNodeArea_37", 0, "");
AddEnemyPatrolNode("enemy_suitor_2", "PathNodeArea_38", 0, "");
AddEnemyPatrolNode("enemy_suitor_2", "PathNodeArea_39", 0, "");
AddEnemyPatrolNode("enemy_suitor_2", "PathNodeArea_40", 0, "");
AddEnemyPatrolNode("enemy_suitor_2", "PathNodeArea_41", 0, "");
AddEnemyPatrolNode("enemy_suitor_2", "PathNodeArea_42", 0, "");
AddEnemyPatrolNode("enemy_suitor_2", "PathNodeArea_43", 0, "");
AddEnemyPatrolNode("enemy_suitor_2", "PathNodeArea_44", 0, "");
AddEnemyPatrolNode("enemy_suitor_2", "PathNodeArea_45", 0, "");
AddEnemyPatrolNode("enemy_suitor_2", "PathNodeArea_46", 0, "");
AddEnemyPatrolNode("enemy_suitor_2", "PathNodeArea_47", 0, "");
AddEnemyPatrolNode("enemy_suitor_2", "PathNodeArea_48", 0, "");
}
}


void StopLook(string &in asTimer)
{
FadeIn(3);
AddTimer("FaintTimer", 5, "BlackOut");
StopPlayerLookAt();
}

void BlackOut(string &in asTimer)
{
FadeOut(2);
AddTimer("DisableLook", 5, "StopLook2");
}

void StopLook2(string &in asTimer)
{
StartPlayerLookAt("key_torture_chamber_1", 10, 10, "");
FadeIn(3);
SetPlayerActive(true);
StopPlayerLookAt();
AddTimer("RollTimer", 4, "StandUp");
}

void StandUp(string &in asTimer)
{
SetEnemyDisableTriggers("enemy_suitor_2", false);
FadePlayerRollTo(0, 50, 50);
SetPlayerCrouching(false);
}

void SanityDrain(string &in asEntity, int alState)
{
GiveSanityDamage(30, true);
PlaySoundAtEntity("", "21_screams.snt", "corpse_male_1", 0, false);
SetMessage("ScreenText", "Brother", 2);
AddTimer("", 3, "FaintTimer1");
StopMusic(0, 0);
PlayMusic("Penumbra Black Plague Main Theme.ogg", false, 1.0f, 0, 0, true);
}

void FaintTimer1(string &in asTimer)
{
SetPlayerActive(false);
SetPlayerCrouching(true);
FadePlayerRollTo(90, 50, 50);
FadeOut(2);
PlaySoundAtEntity("", "player_bodyfall.snt", "Player", 0, false);
SetPlayerSanity(0);
AddTimer("FallTimer", 3, "Katso");
}

void Katso(string &in asTimer)
{
FadeIn(2);
SetMessage("ScreenText", "Brother2", 3);
AddTimer("", 8, "EiKatso");
}

void EiKatso(string &in asTimer)
{
FadeOut(2);
AddTimer("", 5, "Katso2");
}

void Katso2(string &in asTimer)
{
FadeIn(2);
SetMessage("ScreenText", "Brother3", 3);
AddTimer("", 5, "EiKatso2");
}

void EiKatso2(string &in asTimer)
{
FadeOut(2);
AddTimer("", 4, "Nouses");
}

void Nouses(string &in asTimer)
{
StopMusic(5, 0);
PlayMusic("18_amb.ogg", true, 1.0f, 1, 0, true);
SetPlayerActive(true);
FadePlayerRollTo(0, 50, 50);
FadeIn(1);
AddTimer("", 2, QuestTimer");
}

void QuestTimer(string &in asTimer)
{
AddQuest("demon", "DemonQuest");
}

void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("shelf_secret_door_rot_1",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}

void CollideScriptArea_3(string &in asParent, string &in asChild, int alState)
{
CheckPoint("", "PlayerStartArea_44", "Reload", "DeathHintSuitor", "Silence");
}

void Reload(string &in asName, int alCount)
{
FadeOut(5);
SetPlayerCrouching(true);
FadePlayerRollTo(90, 50, 50);
PlaySoundAtEntity("", "player_bodyfall.snt", "Player", 0, false);
SetPlayerSanity(0);
SetEntityActive("key_torture_chamber_1", true);
SetEntityActive("enemy_suitor_2", true);
AddTimer("ScareTimer", 10, "StopLook");
SetPlayerActive(false);
StartPlayerLookAt("enemy_suitor_2", 25, 25, "");
SetEnemyDisableTriggers("enemy_suitor_2", true);
AddEnemyPatrolNode("enemy_suitor_2", "PathNodeArea_36", 0, "");
AddEnemyPatrolNode("enemy_suitor_2", "PathNodeArea_37", 0, "");
AddEnemyPatrolNode("enemy_suitor_2", "PathNodeArea_38", 0, "");
AddEnemyPatrolNode("enemy_suitor_2", "PathNodeArea_39", 0, "");
AddEnemyPatrolNode("enemy_suitor_2", "PathNodeArea_40", 0, "");
AddEnemyPatrolNode("enemy_suitor_2", "PathNodeArea_41", 0, "");
AddEnemyPatrolNode("enemy_suitor_2", "PathNodeArea_42", 0, "");
AddEnemyPatrolNode("enemy_suitor_2", "PathNodeArea_43", 0, "");
AddEnemyPatrolNode("enemy_suitor_2", "PathNodeArea_44", 0, "");
AddEnemyPatrolNode("enemy_suitor_2", "PathNodeArea_45", 0, "");
AddEnemyPatrolNode("enemy_suitor_2", "PathNodeArea_46", 0, "");
AddEnemyPatrolNode("enemy_suitor_2", "PathNodeArea_47", 0, "");
AddEnemyPatrolNode("enemy_suitor_2", "PathNodeArea_48", 0, "");
SetEntityActive("mansion_1", true);
SetEntityActive("mansion_2", true);
SetEntityActive("ScriptArea_3", true);
}

void VaihdaMap4(string &in asParent, string &in asChild, int alState)
{
FadeOut(2);
ChangeMap("Memento5.map", "PlayerStartArea_5", "", "");
SetupLoadScreen("Loadscreen", "EnterMansion", 0, "");
}

void UsedKey(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("key_study_1");
}

void UsedKey2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("work_desk_door_worn_1", false, true);
PlaySoundAtEntity("", "unlock_door", "work_desk_door_worn_1", 0, false);
RemoveItem("key_torture_chamber_1");
}

void UsedKey3(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_4", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_4", 0, false);
RemoveItem("key_tower_1");
}

void CollideScriptArea_1(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansion_1", true, true);
SetSwingDoorLocked("mansion_1", true, true);
}

void CollideScriptArea_2(string &in asParent, string &in asChild, int alState)
{
AddTimer("ChangeWindow", 15, "Window2");
SetEntityActive("enemy_suitor_1", true);
AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_10", 0, "");
AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_11", 0, "");
AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_13", 0, "");
AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_14", 0, "");
AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_15", 0, "");
AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_16", 0, "");
AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_17", 0, "");
AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_18", 0, "");
AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_19", 0, "");
AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_20", 0, "");
AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_21", 0, "");
AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_22", 0, "");
AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_23", 0, "");
AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_24", 0, "");
AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_25", 0, "");
AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_26", 0, "");
AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_27", 0, "");
AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_28", 0, "");
AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_29", 0, "");
AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_30", 0, "");
AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_31", 0, "");
AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_32", 0, "");
AddEnemyPatrolNode("enemy_suitor_1", "PathNodeArea_33", 0, "");
}

void Window2(string &in asTimer)
{
PlaySoundAtEntity("", "break_glass_large.snt", "mb_window_1", 0, false);
SetEntityActive("mb_window_1", false);
SetEntityActive("mb_window_noglass_1", true);
AddTimer("WallTimer", 15, "ActivateWall");
}

void ActivateWall(string &in asTimer)
{
SetEntityActive("block_box_1", true);
}

void CollideScriptArea_4(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("ScriptArea_4", false);
CheckPoint("", "PlayerStartArea_45", "Reload2", "DeathHintSuitor", "Silence");
}

void Reload2(string &in asName, int alCount)
{
SetEntityActive("mansion_5", true);
SetEntityActive("block_box_1", false);
SetEntityActive("mb_window_1", true);
SetEntityActive("mb_window_noglass_1", false);
SetEntityActive("ScriptArea_2", true);
SetEntityActive("ScriptArea_4", true);
}

void CollideScriptArea_5(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "21_screams.snt", "Player", 0, false);
}

void CollideScriptArea_6(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "18_blow_wind.snt", "Player", 0, false);
}

void CollideScriptArea_7(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "15_body_impact.snt", "Player", 0, false);
SetEntityActive("shield01_13", true);
SetEntityActive("shield01_9", false);
}

void CollideScriptArea_8(string &in asParent, string &in asChild, int alState)
{
AddPropForce("vase02_ghost_2", 1000, 0, 0, "World");
AddTimer("HeartTimer", 2, "SoundPlay");
}

void SoundPlay(string &in asTimer)
{
PlaySoundAtEntity("", "sanity_heartbeat.snt", "Player", 0, false);
}

void CollideScriptArea_9(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansion_4", true, true);
AddPropForce("mansion_4", 0, 0, 100, "World");
PlaySoundAtEntity("", "door_mansion_close.snt", "Player", 0, false);
AddTimer("HeartTimer2", 1, "PlayHeart");
}

void PlayHeart(string &in asTimer)
{
PlaySoundAtEntity("", "sanity_heartbeat.snt", "Player", 0, false);
}

void CollideScriptArea_10(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("enemy_suitor_3", true);
StartPlayerLookAt("enemy_suitor_3", 15, 15, "");
SetPlayerActive(false);
AddTimer("MorsoScare", 2, "MoveMorso");
AddEnemyPatrolNode("enemy_suitor_3", "PathNodeArea_34", 0, "");
}

void MoveMorso(string &in asTimer)
{
StopPlayerLookAt();
SetEntityActive("enemy_suitor_6", true);
PlaySoundAtEntity("", "enemy_hallucination_disappear.ogg", "Player", 0, false);
AddTimer("MorsoEnd", 1, "ActivateMovement");
SetEntityActive("enemy_suitor_3", false);
AddTimer("MorsoScare2", 1, "MoveMorso2");
}

void ActivateMovement(string &in asTimer)
{
SetPlayerActive(true);
}

void CollideScriptArea_11(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("armour_nice_complete_14", true);
SetEntityActive("armour_nice_complete_13", false);
}

void CollideScriptArea_12(string &in asParent, string &in asChild, int alState)
{
FadeOut(2);
ChangeMap("Memento5.map", "PlayerStartArea_5", "", "");
SetupLoadScreen("Loadscreen", "EnterMansion", 1, "");
}

void CollideScriptArea_13(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("enemy_suitor_1", false);
}

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

}

Help appreciated!
(This post was last modified: 05-28-2012, 06:39 PM by Hatred.)
05-28-2012, 06:24 PM
Find


Messages In This Thread
Error, unexpected end of file - by Hatred - 05-28-2012, 06:24 PM
RE: Error, unexpected end of file - by Putmalk - 05-28-2012, 06:29 PM
RE: Error, unexpected end of file - by Hatred - 05-28-2012, 06:38 PM
RE: Error, unexpected end of file - by Putmalk - 05-28-2012, 06:40 PM



Users browsing this thread: 1 Guest(s)