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
Elven Offline
Posting Freak

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

First, use "", not *"

You need to replace Myfunc with keyondoor

Main 2 big mistakes what i can see straight away.

The Interrogation
Chapter 1

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

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

Forgot That One Last *

[Image: errorwo.png]


////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Prisonkey_1", "prison_1", "usedkeyondoor", true);
}
void keyondoor(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()
{

}
(This post was last modified: 10-05-2011, 07:35 PM by jmayo.)
10-05-2011, 07:30 PM
Find
Your Computer Offline
SCAN ME!

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

Fix the HPL2 function names as they are shown here: http://wiki.frictionalgames.com/hpl2/amn..._functions

Also, "keyondoor" != "usedkeyondoor", therefore the item isn't going to trigger the callback.

Tutorials: From Noob to Pro
10-05-2011, 07:38 PM
Website Find
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#14
RE: [Help!]Key On Door Error

////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Prisonkey_1", "prison_1", "keyondoor", true);
}
void keyondoor(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()
{

}

That should work for you. The errors were caused by
1) Inaccurate function names.

Example:
Setswingdoorlocked won't be read by the engine, as your capitalization was incorrect
SetSwingDoorLocked is the proper way of writing it.

2) Incorrect Callback

You had usedkeyondoor as your target callback, as definted by the AddUseItemCallback, but your function was named keyondoor. Therefore, the engine won't be able to find the function you called for, and what you want to happen simply won't.

10-05-2011, 07:41 PM
Find
jmayo Offline
Junior Member

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

Thx Big Grin
(This post was last modified: 10-05-2011, 07:47 PM by jmayo.)
10-05-2011, 07:47 PM
Find
schmupper Offline
Junior Member

Posts: 23
Threads: 1
Joined: Aug 2011
Reputation: 2
#16
RE: Key On Door Error

Already fixed

''Oh. My. God. He's DEAD. Quickly, if he hasnt started to smell, give him the kiss of life!''

Clarence - The monkey hater
(This post was last modified: 10-05-2011, 09:17 PM by schmupper.)
10-05-2011, 09:16 PM
Find




Users browsing this thread: 1 Guest(s)