Frictional Games Forum (read-only)
Fatal Error when starting my Costum Story - 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)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Fatal Error when starting my Costum Story (/thread-10131.html)



Fatal Error when starting my Costum Story - nikkel - 09-03-2011

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?


RE: Fatal Error when starting my Costum Story - plutomaniac - 09-03-2011

Moved to CS&M


RE: Fatal Error when starting my Costum Story - JetlinerX - 09-03-2011

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 ()


RE: Fatal Error when starting my Costum Story - nikkel - 09-03-2011

Thanks for this Smile


RE: Fatal Error when starting my Costum Story - Gameristic34 - 06-01-2012

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?



RE: Fatal Error when starting my Costum Story - FragdaddyXXL - 06-01-2012

(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.