Frictional Games Forum (read-only)

Full Version: Problem loading Custom Story!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey everybody this is my first post.
I played through the game and loved it, so i tried to make my own custom map.
I had it working fine until it gave me an error when loading it up after making some edits in the hps file. The error said FATAL ERROR: Could not load script file 'custom_stories/StoryTest/custom_stories/StoryTest/maps/AmnesiaMap.hps'! main (22, 13) : ERR : Unexpected end of file Please respond to this if you know the exact problem with my coding. Thanks!

HPS FILE IS AS FOLLOWS


////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "key_1", "door_1", "KeyOnDoor", true);
AddEntityCollideCallback("Player", "AreaHelp", "CollideAreaHelp", false, 1);
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door_1", 0, false);
RemoveItem("key_1");
////////////////////////////
// Run when entering map
void OnEnter ()
{

}

////////////////////////////
// Run when leaving map
void OnLeave
you are missing a closing brace in the "KeyOnDoor" function, as well as stuff in OnLeave:

Code:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "key_1", "door_1", "KeyOnDoor", true);
AddEntityCollideCallback("Player", "AreaHelp", "CollideAreaHelp", false, 1);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door_1", 0, false);
RemoveItem("key_1");
} /* You were missing a brace here */

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

////////////////////////////
// Run when leaving map
void OnLeave()
{
/* You were missing braces and the brackets in the function */
}
(07-15-2012, 09:16 PM)Apjjm Wrote: [ -> ]you are missing a closing brace in the "KeyOnDoor" function, as well as stuff in OnLeave:

Code:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "key_1", "door_1", "KeyOnDoor", true);
AddEntityCollideCallback("Player", "AreaHelp", "CollideAreaHelp", false, 1);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door_1", 0, false);
RemoveItem("key_1");
} /* You were missing a brace here */

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

////////////////////////////
// Run when leaving map
void OnLeave()
{
/* You were missing braces and the brackets in the function */
}
Thank you very much, bro! I feel pretty stupid after finding this out.