Frictional Games Forum (read-only)
Key On Door Error - 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: Key On Door Error (/thread-10612.html)

Pages: 1 2


Key On Door Error - jmayo - 10-05-2011

I Tried scripting A Key To Open On a Door But It Crashes And Gives me This Error:

[Image: errorkx.png][/URL]

Here Is What I Used:
Code:
////////////////////////////// Run first time starting mapvoid OnStart(){    AddUseItemCallback(**, *Prisonkey_1*, *Prison_1*, *keyondoor*, True);}    void Myfunc(string &in asItem, string &in asEntity) {    Setswingdoorlocked("prison_1", False, True);    Playsoundatentity("", "Unlock_door", "prison_1", 0, false);    Removeitem("prisonkey_1"); }////////////////////////////// Run when entering mapvoid OnEnter(){ } ////////////////////////////// Run when leaving mapvoid OnLeave(){ }

Please Help


RE: [Help!]Key On Door Error - Khyrpa - 10-05-2011

I suggest you to check out the scripting tutorials in this page:
http://wiki.frictionalgames.com/hpl2/tutorials/start



RE: [Help!]Key On Door Error - Elven - 10-05-2011

http://www.frictionalgames.com/forum/thread-10017.html

I recommend watching first basics of the basics Big Grin



RE: [Help!]Key On Door Error - jmayo - 10-05-2011

I Know How to Script Its Just There is A Error I Looked at a Video Step By Step And POW! ERROR


RE: [Help!]Key On Door Error - Elven - 10-05-2011

But you need to know basic idea of scripting already. You do not have that because you just used MyFuct with copy paste Smile!



RE: [Help!]Key On Door Error - Your Computer - 10-05-2011

(10-05-2011, 06:52 PM)jmayo Wrote: I Know How to Script Its Just There is A Error I Looked at a Video Step By Step And POW! ERROR

Your script implies that you need to study scripting. You're not supposed to use asterisks in place of quotation marks. Likewise, you can't skimp out on case sensitivity. Function names are supposed to be spelled exactly as you see them in the wiki. Also, if you want to use 'True' and 'False' in place of 'true' and 'false', add this at the top of your script:
Code:
const bool True = true;
const bool False = false;



RE: [Help!]Key On Door Error - Elven - 10-05-2011

Wooh, new thing what even I didn't know :3! But I prefer using lowercase true or false Tongue



RE: [Help!]Key On Door Error - jmayo - 10-05-2011

(10-05-2011, 07:03 PM)Your Computer Wrote:
(10-05-2011, 06:52 PM)jmayo Wrote: I Know How to Script Its Just There is A Error I Looked at a Video Step By Step And POW! ERROR

Your script implies that you need to study scripting. You're not supposed to use asterisks in place of quotation marks. Likewise, you can't skimp out on case sensitivity. Function names are supposed to be spelled exactly as you see them in the wiki. Also, if you want to use 'True' and 'False' in place of 'true' and 'false', add this at the top of your script:
Code:
const bool True = true;
const bool False = false;
Thx I Edited My scipt Now its Only 1 Error:
[Image: errorik.png]



RE: [Help!]Key On Door Error - Your Computer - 10-05-2011

(10-05-2011, 07:20 PM)jmayo Wrote: Thx I Edited My scipt Now its Only 1 Error:

You're going to need to post your updated code in order for me to figure what the issue is. It looks like you forgot to close something, but i can't tell for sure.


RE: [Help!]Key On Door Error - jmayo - 10-05-2011


////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Prisonkey_1", *prison_1", "keyondoor", true);
}
void Myfunc(string &in asItem, string &in asEntity)
{
Setswingdoorlocked("prison_1", false, true);
Playsoundatentity("", "unlock_door", "prison_1", 0, false);
Removeitem("Prisonkey_1");
}
////////////////////////////
// Run when entering map
void OnEnter()
{

}

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

}

And Yes Prisonkey Starts With a Capital