Frictional Games Forum (read-only)

Full Version: Key On Door Error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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
I suggest you to check out the scripting tutorials in this page:
http://wiki.frictionalgames.com/hpl2/tutorials/start
http://www.frictionalgames.com/forum/thread-10017.html

I recommend watching first basics of the basics Big Grin
I Know How to Script Its Just There is A Error I Looked at a Video Step By Step And POW! ERROR
But you need to know basic idea of scripting already. You do not have that because you just used MyFuct with copy paste Smile!
(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;
Wooh, new thing what even I didn't know :3! But I prefer using lowercase true or false Tongue
(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]
(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.

////////////////////////////
// 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
Pages: 1 2