Frictional Games Forum (read-only)

Full Version: Fatal Error when starting my Costum Story
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello guys
im getting a FATAL Error while starting my Amnesia costum story.

FATAL ERROR:Could not load script file "costum_stories/Erster Costum Story Test/maps/ErsterTest.hpl
main (9,1):ERR : Expected "," or ";"
main (11,12) ERR : Expected identifier
main (21,1) ERR : Unexpected token ")"

The script is:

Code:
void OnEnter()
{
    AddUseItemCalback("", "Penis", "türeins", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in esEntity)
(
    SetSwingDoorLocked("türeins", false, true);
    RemoveItem("Penis");
)

and "extra_english.lang"

Code:
<LANGUGAGE>
    <CATOGORY Name="Test"
        <Entry Name="Description">Das ist ein Test</Entry>
    </CATAGORY>
    
    <CATERGORY Name="Journal"
        <Entry Name="Note_unbekanntenachricht_Name">Unbekannte Nachricht</Entry>
        <Entry Name="Note_unbekanntenachricht_Text">Unbekannte Nachricht[br]Testhere[/br]</Entry>
    </CATAGORY
    <CATAGORY Name="Inventory">
        <Entry Name="ItemName_Key">Penis</Entry>
        <Entry Name="ItemDesc_Key">PENIS!!!!!</Entry>
    </CATAGORY

    
</LANGUAGE>

Could someone help me please?
Moved to CS&M
Use this:

Code:
void OnEnter()
{
    AddUseItemCalback("", "Penis", "türeins", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in esEntity)
{
    SetSwingDoorLocked("türeins", false, true);
    RemoveItem("Penis");
}

*Use brackets {} not parenthesis ()
Thanks for this Smile
same problem but I just get a different error when i try the code and fill it in with my stuff?
I get this when i try to load my story: FATAL ERROR:Could not load script file "costum_stories/Test/Costum Story Test/maps/Test.hplmain (9,1):ERR : Expected "," or ";"

but my code is:
void OnEnter()
{
AddUseItemCalback("", "Key To Hallway", "LockedDoor_1", "unlock_door", true);
}


void unlock_door(string &in Key To Hallway, string &in LockedDoor_1)
{
SetSwingDoorLocked(LockedDoor_1, false, true);
PlaySoundAtEntity("", "unlock_door", LockedDoor_1, 0, false);
RemoveItem(Key To Hallway);
}
void OnLeave()
{
}


& the extra_English.lang:

<LANGUAGE>
<RESOURCES />
<CATEGORY Name="Inventory">
<Entry Name="Key to hallway">Key To Hallway</Entry>
<Entry Name="Key to hallway">Hallway Key</Entry>
</CATEGORY>
</LANGUAGE>

And i don't know what is wrong?
(9,1):ERR : Expected "," or ";"

To read errors like this in the future:
9 is the line the exception occurred,
1 is the place in the line that the exception occurred.

You haven't surrounded your LockedDoor_1 with quotes, as it is a string.
I noticed this in 2 places.

Also, do not change the parameters in the callback functions when you declare them:
void unlock_door(string &in asItem, string &in asEntity)

Also, Key To Hallway needs to be in quotes.