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
What is wrong with my script?
Maximaeus Offline
Junior Member

Posts: 6
Threads: 2
Joined: Oct 2011
Reputation: 0
#1
What is wrong with my script?

Trying to run my Custom Story and it comes up with the error. Thanks in advance:

FATAL ERROR: Could no load script file 'custom_stories/The Following/maps/The following.hps'!

main(4, 26) : ERR : Expected identifer
main(5, 19) : ERR : Expected identifer
main(6, 19) : ERR : Expected identifer
main(21, 14) : ERR : Expected identifer
main(26, 23) : ERR : Expected identifer
main(27, 23) : ERR : Expected identifer
main(28, 23) : ERR : Expected identifer


////////////////////////////
// Run first time starting map
void OnStart()

;AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
AddUseItemCallback("", "StairsKey_1", "Stairs_1", "KeyOnDoor", true);
AddUseItemCallback("", "StairsKey_1", "Stairs_2", "KeyOnDoor2", true);

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Stairs_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "Stairs_1", 0.0f, true);
}

void KeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Stairs_2", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "Stairs_2", 0.0f, true);
RemoveItem("StairsKey_1")
;}

MonsterCheck(string &in entity, string &in type)

void MonsterFunction(string &in asParent, string &in asChild, int alState)

SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");

////////////////////////////
// Run when entering map
void OnEnter()
{

}

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

}

(This post was last modified: 10-28-2011, 03:39 PM by Maximaeus.)
10-25-2011, 12:35 PM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#2
RE: What is wrong with my script?

Sorry, all the font tags are really obnoxious Big Grin

(This post was last modified: 10-25-2011, 01:11 PM by flamez3.)
10-25-2011, 01:09 PM
Find
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#3
RE: What is wrong with my script?

You are missing open and closing braces at the start of many of your functions:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
AddUseItemCallback("", "StairsKey_1", "Stairs_1", "KeyOnDoor", true);
AddUseItemCallback("", "StairsKey_1", "Stairs_2", "KeyOnDoor2", true);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Stairs_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "Stairs_1", 0.0f, true);
}

void KeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Stairs_2", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "Stairs_2", 0.0f, true);
RemoveItem("StairsKey_1");
}

//MonsterCheck(string &in entity, string &in type) - What was this doing???

void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

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

}
Above is the fixed code. I have also commented out the line "MonsterCheck(string &in entity, string &in type)", as i am unsure as to the purpose of this. If it is a function you are missing the return type (E.g. void, int, bool, etc) and also a set of open and closing braces.
10-25-2011, 01:16 PM
Find
Maximaeus Offline
Junior Member

Posts: 6
Threads: 2
Joined: Oct 2011
Reputation: 0
#4
RE: What is wrong with my script?

(10-25-2011, 01:16 PM)Apjjm Wrote: You are missing open and closing braces at the start of many of your functions:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
AddUseItemCallback("", "StairsKey_1", "Stairs_1", "KeyOnDoor", true);
AddUseItemCallback("", "StairsKey_1", "Stairs_2", "KeyOnDoor2", true);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Stairs_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "Stairs_1", 0.0f, true);
}

void KeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Stairs_2", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "Stairs_2", 0.0f, true);
RemoveItem("StairsKey_1");
}

//MonsterCheck(string &in entity, string &in type) - What was this doing???

void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

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

}
Above is the fixed code. I have also commented out the line "MonsterCheck(string &in entity, string &in type)", as i am unsure as to the purpose of this. If it is a function you are missing the return type (E.g. void, int, bool, etc) and also a set of open and closing braces.
Worked. Thanks!

10-25-2011, 01:50 PM
Find




Users browsing this thread: 1 Guest(s)