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 in script aka map won't load
Viperdream Offline
Member

Posts: 124
Threads: 16
Joined: Jan 2011
Reputation: 0
#1
Sad  Error in script aka map won't load

Yet another frustrating error.

So I keep getting the (FATAL ERROR 1;56321) I don't really think I have this column in my script.

I don't understand what could be wrong in this script. I checked it dozens of times for missing ; or ) or } whatever I could miss.

All my functions etc should be correct.

Here the script:
Spoiler below!

void OnStart()
{
//Callbacks
AddEntityCollideCallback("uberhammer", "HammerDestroyArea", "Collide_Pentagram", true, 1);
AddEntityCollideCallback("Player", "PentagramArea", "Collide_DestroyBoards", false, 1);
AddEntityCollideCallback("Player", "PuzzleCompleteArea1", "Collide_PuzzleComplete1", true, 1);
AddEntityCollideCallback("demons_lunch", "SacrificeArea", "Collide_Food", true, 1);
AddEntityCollideCallback("Player", "DoorShutArea", "Collide_ShutDoor", true, 1);
AddEntityCollideCallback("Player", "BenEscapeArea", "Collide_PrisonBreak", true, 1);
AddEntityCollideCallback("ben_2", "BenGoneArea", "Collide_BenGone", true, 1);

SetEntityPlayerInteractCallback("prison_2", "BenWake", true);

SetEntityPlayerInteractCallback("lanternodoom", "CorpseScareTrigger", true);

//Light
SetLightVisible("demonlight", false);


//Enemy Patrol Nodes
//Tai 1
AddEnemyPatrolNode("tai_1", "PathNodeArea_1", 4.0f, "IdleExtra3");
AddEnemyPatrolNode("tai_1", "PathNodeArea_2", 0.0f, "");
AddEnemyPatrolNode("tai_1", "PathNodeArea_3", 0.0f, "");
AddEnemyPatrolNode("tai_1", "PathNodeArea_4", 0.0f, "");
AddEnemyPatrolNode("tai_1", "PathNodeArea_5", 0.0f, "");
AddEnemyPatrolNode("tai_1", "PathNodeArea_6", 0.0f, "");

//Ben 1
AddEnemyPatrolNode("ben_1", "PathNodeArea_22", 0.0f, "");
AddEnemyPatrolNode("ben_1", "PathNodeArea_23", 0.0f, "");
AddEnemyPatrolNode("ben_1", "PathNodeArea_24", 0.0f, "");
AddEnemyPatrolNode("ben_1", "PathNodeArea_25", 0.0f, "");
AddEnemyPatrolNode("ben_1", "PathNodeArea_26", 0.0f, "");
AddEnemyPatrolNode("ben_1", "PathNodeArea_27", 0.0f, "");
AddEnemyPatrolNode("ben_1", "PathNodeArea_28", 0.0f, "");
AddEnemyPatrolNode("ben_1", "PathNodeArea_29", 0.0f, "");
AddEnemyPatrolNode("ben_1", "PathNodeArea_30", 0.0f, "");
AddEnemyPatrolNode("ben_1", "PathNodeArea_31", 0.0f, "");
//Ben 2
AddEnemyPatrolNode("ben_2", "PathNodeArea_7", 0.0f, "");
AddEnemyPatrolNode("ben_2", "PathNodeArea_8", 0.0f, "");
AddEnemyPatrolNode("ben_2", "PathNodeArea_9", 0.0f, "");
AddEnemyPatrolNode("ben_2", "PathNodeArea_10", 0.0f, "");
AddEnemyPatrolNode("ben_2", "PathNodeArea_11", 0.0f, "");
AddEnemyPatrolNode("ben_2", "PathNodeArea_12", 0.0f, "");
AddEnemyPatrolNode("ben_2", "PathNodeArea_13", 0.0f, "");
AddEnemyPatrolNode("ben_2", "PathNodeArea_14", 0.0f, "");
AddEnemyPatrolNode("ben_2", "PathNodeArea_15", 0.0f, "");
AddEnemyPatrolNode("ben_2", "PathNodeArea_16", 0.0f, "");
AddEnemyPatrolNode("ben_2", "PathNodeArea_17", 0.0f, "");
AddEnemyPatrolNode("ben_2", "PathNodeArea_18", 0.0f, "");
AddEnemyPatrolNode("ben_2", "PathNodeArea_19", 0.0f, "");
AddEnemyPatrolNode("ben_2", "PathNodeArea_20", 0.0f, "");
AddEnemyPatrolNode("ben_2", "PathNodeArea_21", 0.0f, "");

//Player Wakes Up
wakeUp();

//Tai Goes Away Event

AddTimer("DoorClose1", 13.0f, "DoorCloseTimer1");

}

void DoorCloseTimer1(string &in asTimer);
{
SetSwingDoorClosed("prison_1", true, true);
SetSwingDoorLocked("prison_1", true, true);
}

//Wake Up Event
void wakeUp ()
{
FadeOut(0); // Instantly fades the screen out. (Good for starting the game)
FadeIn(20); // Amount of seconds the fade in takes
FadeImageTrailTo(2, 2);
FadeSepiaColorTo(100, 4);
SetPlayerActive(false);
FadePlayerRollTo(50, 220, 220); // "Tilts" the players head
FadeRadialBlurTo(0.15, 2);
SetPlayerCrouching(true); // Simulates being on the ground
AddTimer("trig1", 11.0f, "beginStory"); // Change '11.0f' to however long you want the 'unconciousness' to last
}

void beginStory(string &in asTimer)
{
ChangePlayerStateToNormal();
SetPlayerActive(true);
FadePlayerRollTo(0, 33, 33); // Change all settings to defaults
FadeRadialBlurTo(0.0, 1);
FadeSepiaColorTo(0, 4);
SetPlayerCrouching(false);
FadeImageTrailTo(0,1);
}

//Destroy Planks
void Collide_DestroyBoards(string &in asParent, string &in asChild, int alState)
{
AddTimer("FadeOut1", 0.5f, "FadeOutTimer1");
AddTimer("HammerTime", 1f, "HammerSoundTimer");
AddTimer("FadeIn1", 2.5f, "FadeInTimer1");
}

void FadeOutTimer1(string &in asTimer)
{
FadeOut(0.5f);
}
void HammerSoundTimer(string &in asTimer)
{
SetEntityActive("woodblock2", false);
SetEntityActive("woodblock1", false);
PlaySoundAtEntity("", "break_wood.snt", "DustCloudArea", 0, false);
}
void FadeInTimer1(string &in asTimer)
{
FadeIn(0.5f);
CreateParticleSystemAtEntity("dust1", "ps_dust_impact.ps", "DustCloudArea", false);
}

//Pentagram Area
void Collide_Pentagram(string &in asParent, string &in asChild, int alState)
{
GiveSanityDamage(10.0f, true);
PlaySoundAtEntity("", "insanity_whisper.snt", "GhostArea", 0, false);
CreateParticleSystemAtEntity("dust1", "ps_dust_ghost.ps", "DustCloudArea", false);
}

//Puzzle Complete 1
void Collide_PuzzleComplete1(string &in asParent, string &in asChild, int alState)
{
GiveSanityBoost();
PlayMusic("01_puzzle_passage.ogg", false, 1.0f, 4.0f, 3, true);
}
//Ben1 Wake Event

void BenWake(string &in entity)
{
SetEntityActive("ben_1", true);
PlaySoundAtEntity("", "react_scare.snt", "GhostArea", 0, false);
}

void CloseDoorTimer1(string &in asTimer)
{
SetSwingDoorClosed("prison_7", true, true);
SetSwingDoorLocked("prison_7", true, true);
}

void CloseDoorTimer2(string &in asTimer)
{
SetSwingDoorClosed("prison_8", true, true);
SetSwingDoorLocked("prison_8", true, true);
}
//Puzzle with Pentagram

void Collide_Food(string &in asParent, string &in asChild, int alState)
{
AddTimer("CandlesLit", 2.5f, "DemonCandleTimer");
AddTimer("BreadFloat", 3.5f, "BreadFloatTimer");
AddTimer("DemonFire", 4.5f, "FireStartTimer");
AddTimer("DoorOpen", 6.0f, "DoorOpenTimer");
}

void DemonCandleTimer(string &in asTimer)
{
SetLampLit("demoncandle1", true, true);
SetLampLit("demoncandle2", true, true);
SetLampLit("demoncandle3", true, true);
PlaySoundAtEntity("", "insanity_whisper.snt", "GhostArea", 0, false);
}

void BreadFloatTimer(string &in asTimer)
{
AddPropImpulse("demons_lunch", 0, 1.75f, 0, "");
SetLightVisible("demonlight", true);
}

void DoorOpenTimer(string &in asTimer)
{
StopPlayerLookAt();
DestroyParticleSystem("fire");
SetSwingDoorLocked("prison_2", false, true);
SetSwingDoorClosed("prison_2", false, true);
PlaySoundAtEntity("", "insanity_whisper.snt", "GhostArea", 0, false);
GiveSanityBoost();
PlayMusic("23_puzzle.ogg", true, 1.0f, 4.0f, 3, true);
SetLightVisible("demonlight", false);
SetEntityActive("PentagramArea", false);

}

void FireStartTimer(string &in asTimer)
{
CreateParticleSystemAtEntity("fire", "ps_fire_smoke_stove_small.ps", "DemonFireArea", false);
StartPlayerLookAt("DemonFireArea", 2, 2, "");

}

//Corpse Scare
void Collide_DoorShut(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("LookAtArea1", 5, 5, "");
SetSwingDoorLocked("prison_4", true, true);
SetSwingDoorClosed("prison_4", true, true);
PlayMusic("27_event_bang.ogg", true, 1.0f, 4.0f, 3, true);
}

void CorpseScareTrigger(string &in entity)
{
SetEntityActive("hanging_prisoner_1", true);
PlaySoundAtEntity("", "react_pant.snt", "player", 0, false);
GiveSanityDamage(20.0f, true);
SetSwingDoorLocked("prison_4", false, true);
SetSwingDoorClosed("prison_4", false, true);
}
//Ben Escape Event
void Collide_PrisonBreak(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("PlayerLookArea", 5, 5, "");
SetEntityActive("ben_2", true);
SetSwingDoorLocked("prison_6", true, true);
SetSwingDoorClosed("prison_6", true, true);
}
void Collide_BenGone(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("ben_2", false);
CreateParticleSystemAtEntity("dust1", "ps_enemy_dissappear_per_bone.ps", "BenGoneArea", false);
SetSwingDoorLocked("prison_6", false, true);
SetSwingDoorClosed("prison_6", false, true);
}
//On Enter
void OnEnter()
{
}
void OnLeave()
{
}

I'd really appreciate any help

PS: Does Notepad++ have any code checker or whatever I should call it?
(This post was last modified: 03-09-2011, 10:09 PM by Viperdream.)
03-09-2011, 10:07 PM
Find
Russ Money Offline
Senior Member

Posts: 360
Threads: 25
Joined: Dec 2010
Reputation: 4
#2
RE: Error in script aka map won't load

All I can see so-far is

void DoorCloseTimer1(string &in asTimer);

Remove the ;

I'll comb it over again and edit if I see anything else.
03-09-2011, 10:15 PM
Find
Viperdream Offline
Member

Posts: 124
Threads: 16
Joined: Jan 2011
Reputation: 0
#3
RE: Error in script aka map won't load

Got that one out

Still getting the error :/

(FATAL ERROR: 1;8494)

It's like searching for a needle in a haystack >.<
(This post was last modified: 03-09-2011, 10:20 PM by Viperdream.)
03-09-2011, 10:20 PM
Find
Russ Money Offline
Senior Member

Posts: 360
Threads: 25
Joined: Dec 2010
Reputation: 4
#4
RE: Error in script aka map won't load

Welcome to coding.

What type of error is it? Like, what is the full error message? Unexpected end?
(This post was last modified: 03-09-2011, 10:27 PM by Russ Money.)
03-09-2011, 10:26 PM
Find
Viperdream Offline
Member

Posts: 124
Threads: 16
Joined: Jan 2011
Reputation: 0
#5
RE: Error in script aka map won't load

Yeah, unexpected end

Could not load script file 'maps/main/Prison.hps'! main (1,8494) :ERR: Unexpected end of file
(This post was last modified: 03-09-2011, 10:30 PM by Viperdream.)
03-09-2011, 10:28 PM
Find
Russ Money Offline
Senior Member

Posts: 360
Threads: 25
Joined: Dec 2010
Reputation: 4
#6
RE: Error in script aka map won't load

I looked and looked but I can't seem to find any misplaced quotation marks or semi-colons. What I could suggest is, copy all the old contents from your script. Start a new .hps for your map and start adding code and testing your map. Add all the stuff that pertains to it.

So, add all the stuff from your OnStart, OnLeave, OnEnter, then add the strings that pertain to it. When you add the code that makes the unexpected end, your problem is there.

Let me know if you don't understand.
03-09-2011, 10:51 PM
Find
Viperdream Offline
Member

Posts: 124
Threads: 16
Joined: Jan 2011
Reputation: 0
#7
RE: Error in script aka map won't load

I'll try that, should've done that from the start : /

EDIT: Did that and it works like a charm now. Thanks for the help!

(This post was last modified: 03-10-2011, 10:03 PM by Viperdream.)
03-09-2011, 10:56 PM
Find




Users browsing this thread: 1 Guest(s)