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
Key On Door Error
jmayo Offline
Junior Member

Posts: 16
Threads: 6
Joined: Sep 2011
Reputation: 0
#1
Key On Door Error

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:
////////////////////////////// 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
(This post was last modified: 10-05-2011, 09:10 PM by jmayo.)
10-05-2011, 06:43 PM
Find
Khyrpa Offline
Senior Member

Posts: 638
Threads: 10
Joined: Apr 2011
Reputation: 24
#2
RE: [Help!]Key On Door Error

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

(This post was last modified: 10-05-2011, 06:48 PM by Khyrpa.)
10-05-2011, 06:48 PM
Find
Elven Offline
Posting Freak

Posts: 862
Threads: 37
Joined: Aug 2011
Reputation: 26
#3
RE: [Help!]Key On Door Error

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

I recommend watching first basics of the basics Big Grin

The Interrogation
Chapter 1

My tutorials
10-05-2011, 06:50 PM
Find
jmayo Offline
Junior Member

Posts: 16
Threads: 6
Joined: Sep 2011
Reputation: 0
#4
RE: [Help!]Key On Door Error

I Know How to Script Its Just There is A Error I Looked at a Video Step By Step And POW! ERROR
10-05-2011, 06:52 PM
Find
Elven Offline
Posting Freak

Posts: 862
Threads: 37
Joined: Aug 2011
Reputation: 26
#5
RE: [Help!]Key On Door 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!

The Interrogation
Chapter 1

My tutorials
10-05-2011, 07:01 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#6
RE: [Help!]Key On Door Error

(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:
const bool True = true;
const bool False = false;

Tutorials: From Noob to Pro
(This post was last modified: 10-05-2011, 07:05 PM by Your Computer.)
10-05-2011, 07:03 PM
Website Find
Elven Offline
Posting Freak

Posts: 862
Threads: 37
Joined: Aug 2011
Reputation: 26
#7
RE: [Help!]Key On Door Error

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

The Interrogation
Chapter 1

My tutorials
10-05-2011, 07:09 PM
Find
jmayo Offline
Junior Member

Posts: 16
Threads: 6
Joined: Sep 2011
Reputation: 0
#8
RE: [Help!]Key On Door Error

(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:
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
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#9
RE: [Help!]Key On Door Error

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

Tutorials: From Noob to Pro
10-05-2011, 07:24 PM
Website Find
jmayo Offline
Junior Member

Posts: 16
Threads: 6
Joined: Sep 2011
Reputation: 0
#10
RE: [Help!]Key On Door Error


////////////////////////////
// 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
10-05-2011, 07:24 PM
Find




Users browsing this thread: 1 Guest(s)