Frictional Games Forum (read-only)
[SCRIPT] Scripts not working :( - 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: [SCRIPT] Scripts not working :( (/thread-21762.html)



Scripts not working :( - XTM Res - 06-08-2013

Hi everyone , im guy whos trying to make an Amnesia custom story , everything works great , but there is problem with keys names and unlocking doors. Maybe its my fault in the scripts or its problem with lang files. The problem is , when i pick up key it says "Picked up" but dont say "Picked up Table Key". And when i try to unlock door it says "Cannon Use This Item This Way". ( I have been making scripts by videos on youtube) I was watching some Threads about it but anything didnt help me Sad Please help Undecided There are the scripts:

extra_english :

<LANGUAGE>
</CATEGORY>
<CATEGORY Name ="Inventory">
<Entry Name="ItemName_tabledoorkey_1">Desk Key</Entry>
<Entry Name="ItemDesc_tabledoorkey_1">Little key for little door</Entry>
</LANGUAGE>

----------------------------------------------------------------------
office.hps :

void OnStart()
{
AddUseItemCallback("", "tabledoorkey_1", "tabledoor_1", "UsedKeyOnDoor", true);
}


void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("tabledoor_1", false, true);
PlaySoundAtEntity("", "unlock_door", "tabledoor_1", 0, false);
RemoveItem("tabledoorkey_1");
}

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


RE: Scripts not working :( - Bridge - 06-08-2013

Code:
<LANGUAGE>

</CATEGORY>

<CATEGORY Name ="Inventory">

        <Entry Name="ItemName_tabledoorkey_1">Desk Key</Entry>

        <Entry Name="ItemDesc_tabledoorkey_1">Little key for little door</Entry>

</LANGUAGE>

This bit of code is probably the problem. You're trying to close CATEGORY before it's even been opened. Change it to this:

Code:
<LANGUAGE>

<CATEGORY Name ="Inventory">

        <Entry Name="ItemName_tabledoorkey_1">Desk Key</Entry>

        <Entry Name="ItemDesc_tabledoorkey_1">Little key for little door</Entry>
</CATEGORY>

</LANGUAGE>



RE: Scripts not working :( - XTM Res - 06-08-2013

(06-08-2013, 07:44 PM)Bridge Wrote:
Code:
<LANGUAGE>

</CATEGORY>

<CATEGORY Name ="Inventory">

        <Entry Name="ItemName_tabledoorkey_1">Desk Key</Entry>

        <Entry Name="ItemDesc_tabledoorkey_1">Little key for little door</Entry>

</LANGUAGE>

This bit of code is probably the problem. You're trying to close CATEGORY before it's even been opened. Change it to this:

Code:
<LANGUAGE>

<CATEGORY Name ="Inventory">

        <Entry Name="ItemName_tabledoorkey_1">Desk Key</Entry>

        <Entry Name="ItemDesc_tabledoorkey_1">Little key for little door</Entry>
</CATEGORY>

</LANGUAGE>

THANK YOU THANK YOU THAAAAAAAAANK YOU Heart Heart Heart
Its working now Big Grin Thx very much