The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Amnesia Scripting help?
taylor122002 Offline
Junior Member

Posts: 13
Threads: 10
Joined: Aug 2012
Reputation: 0
#1
Amnesia Scripting help?

Hello everybody! I have a question about Scripting. I actually started doing this less than a week ago, so I know nothing. Anyways, I am making little maps for me learn the basics of Scripting. My first map was called "ScriptTest" which was learning how to do Journal Entries, which I managed to learn. Now, I made a map called "ScriptTest2", and I'm using this map to figure out how to unlock doors. And I'm stuck. I was wondering if anybody could look at these functions and see if they're correct or if I did something wrong? I got the key name and description down correctly. But the unlocking the door part..?

The key's CustomSubItemTypeName is "Key1" and the actual name is just "Key_1", and the door's name is "LockedDoor1"

extra_english.lang file:

<LANGUAGE>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">Just a description.</Entry>
</CATEGORY>

<CATEGORY Name="Journal">
<Entry Name="Note_Test01_Name">Mysterious Note</Entry>
<Entry Name="Note_Test01_Text">How did you get here, you're probably wondering. You will never escape.</Entry>
</CATEGORY>

<CATEGORY Name="Inventory">
<Entry Name="ItemDesc_Key1">A simple key</Entry>
<Entry Name="ItemName_Key1">A key to unlock a nearby door</Entry>
</CATEGORY>

</LANGUAGE>

------------------------------------------
ScriptTest2.hps file:

////////////////////////////
// Run when the map starts
void OnStart()
{
AddUseItemCallback("", "Key1", "LockedDoor1", "UsedKeyOnDoor", true);
}

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


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

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}
---------------------------

Whenever I test play it, it says that I can't use the item on anything when I go up to the door.
08-17-2012, 01:50 AM
Find


Messages In This Thread
Amnesia Scripting help? - by taylor122002 - 08-17-2012, 01:50 AM
RE: Amnesia Scripting help? - by Adny - 08-17-2012, 04:08 AM
RE: Amnesia Scripting help? - by onv - 08-18-2012, 06:20 PM
RE: Amnesia Scripting help? - by taylor122002 - 08-20-2012, 10:06 PM
RE: Amnesia Scripting help? - by onv - 08-19-2012, 11:17 AM
RE: Amnesia Scripting help? - by onv - 08-20-2012, 03:17 PM



Users browsing this thread: 1 Guest(s)