Frictional Games Forum (read-only)
Fatal error, Please help. - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+--- Thread: Fatal error, Please help. (/thread-53588.html)



Fatal error, Please help. - XeOnTricks - 02-23-2017

i just started writing the script for a custom story im making and i got a fatal error when i tried to start the game.
---------------------------------------------------------------------
FATAL ERROR: Could not load script file
'custom_stories/TheUnforgiven/maps/TheUnforgiven.hps'!
main (14, 53) : ERR : Expected '('
----------------------------------------------------------------------
heres my script so far, i can't find out what it's talking about.
----------------------------------------------------------------------

void OnStart()
{
PlayMusic("06_amb.ogg", true, 4, 3, 1, false);

AddUseItemCallback("", "Key_1", "Door_1", "Unlock", true);

}


void Unlock(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);

PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);

RemoveItem(asItem);

}




void OnEnter()
{



}



void OnLeave()
{



}

----------------------------------------------------------------------


RE: Fatal error, Please help. - Mudbill - 02-23-2017

The error indicates that something went wrong upon compiling the script, and that it started at line number 14. You see it says main (14, 53) which means line 14, character 53.

Line 14 is the PlaySoundAtEntity line.

However I don't see any issues with that line myself. Are you sure this is the correct script?
Just in case you can try replacing it all with this (it's the same, just re-formatted):

PHP Code:
void OnStart()
{
    
PlayMusic("06_amb.ogg"true431false);
    
AddUseItemCallback("""Key_1""Door_1""Unlock"true);
}

void Unlock(string &in asItemstring &in asEntity)
{
    
SetSwingDoorLocked(asEntityfalsetrue);
    
PlaySoundAtEntity("""unlock_door.snt"asEntity0false);
    
RemoveItem(asItem);
}

void OnEnter()
{

}

void OnLeave()
{