Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I'm probably missing something but this door won't unlock
Author Message
liamthespy Offline
Junior Member

Posts: 26
Joined: Jun 2012
Reputation: 0
Post: #1
I'm probably missing something but this door won't unlock
AddUseItemCallback("", "kitchenkey", "kitchendoor", "Kitopen", true);
}

void kitopen(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("kitchendoor", false, true);
PlaySoundAtEntity("", "unlock_door", "kitchendoor", 0, false);
}

I've checked over the syntax and the names like 100 times, what am I missing? it's just a simple key-opens-door situation and I've done it a million times, why is this not working?
06-18-2012 02:36 PM
Find all posts by this user Quote this message in a reply
modoscar Offline
Junior Member

Posts: 9
Joined: Jun 2012
Reputation: 0
Post: #2
RE: I'm probably missing something but this door won't unlock
(06-18-2012 02:36 PM)liamthespy Wrote:  AddUseItemCallback("", "kitchenkey", "kitchendoor", "Kitopen", true);
}

void kitopen(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("kitchendoor", false, true);
PlaySoundAtEntity("", "unlock_door", "kitchendoor", 0, false);
}

I've checked over the syntax and the names like 100 times, what am I missing? it's just a simple key-opens-door situation and I've done it a million times, why is this not working?
You dont have any void onstart,

void OnStart()

{
AddUseItemCallback("", "kitchenkey", "kitchendoor", "Kitopen", true);

}

void kitopen(string &in asItem, string &in asEntity)

{

SetSwingDoorLocked("kitchendoor", false, true);
PlaySoundAtEntity("", "unlock_door", "kitchendoor", 0, false);
}

You can also add: RemoveItem("kitchenkey"); so that the key disappears from the players inventory.
(This post was last modified: 06-18-2012 02:46 PM by modoscar.)
06-18-2012 02:45 PM
Find all posts by this user Quote this message in a reply
Adny Offline
Posting Freak

Posts: 1,757
Joined: Mar 2012
Reputation: 169
Post: #3
RE: I'm probably missing something but this door won't unlock
Please link the full script Tongue

Timorem and Friends are Hungryâ„¢
06-18-2012 02:46 PM
Find all posts by this user Quote this message in a reply
liamthespy Offline
Junior Member

Posts: 26
Joined: Jun 2012
Reputation: 0
Post: #4
RE: I'm probably missing something but this door won't unlock
(06-18-2012 02:46 PM)andyrockin123 Wrote:  Please link the full script Tongue
oops, sorry guys.


////////////////////////////
// Run when entering map
void OnEnter()
{
SetEntityPlayerInteractCallback("bookmoveg", "trapopen", true);
SetEntityPlayerInteractCallback("scarekey", "machinefunc", true);
SetEntityPlayerInteractCallback("stovekey", "kitchenfunc", true);
AddUseItemCallback("", "kitchenkey", "kitchendoor", "Kitopen", true);
}

void kitopen(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("kitchendoor", false, true);
PlaySoundAtEntity("", "unlock_door", "kitchendoor", 0, false);
}

void machinefunc(string &in item)
{
GiveSanityDamage(40.0f, true);
SetPropHealth("barrel01_5", 0);
SetPropHealth("barrel01_4", 0);
SetPropHealth("barrel01_1", 0);
SetPropHealth("barrel01_2", 0);
SetPropHealth("barrel01_6", 0);
SetPropHealth("barrel01_7", 0);
SetPropHealth("barrel01_8", 0);
SetPropHealth("barrel01_9", 0);
SetPropHealth("barrel01_10", 0);
SetPropHealth("barrel01_11", 0);
SetPropHealth("barrel01_12", 0);
SetPropHealth("barrel01_13", 0);
SetPropHealth("barrel01_14", 0);
SetEntityActive("machinemon", true);
}

void trapopen(string &in item)
{
GiveSanityDamage(20.0f, true);
SetPropHealth("barrier", 0);
SetEntityActive("barrier", false);
SetEntityActive("trapmon", true);
AddEnemyPatrolNode("trapmon", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("trapmon", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("trapmon", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("trapmon", "PathNodeArea_4", 0, "");
}

void kitchenfunc(string &in item)
{
SetEntityActive("kitchenmon", true);
AddEnemyPatrolNode("kitchenmon", "path1", 0, "");
AddEnemyPatrolNode("kitchenmon", "path2", 0, "");
AddEnemyPatrolNode("kitchenmon", "path3", 0, "");
AddEnemyPatrolNode("kitchenmon", "path4", 0, "");
}
////////////////////////////
// Run when leaving map
void OnLeave()
{

}
06-18-2012 02:52 PM
Find all posts by this user Quote this message in a reply
BeeKayK Offline
Posting Freak

Posts: 1,952
Joined: Mar 2012
Reputation: 75
Post: #5
RE: I'm probably missing something but this door won't unlock
You know you are calling Kitopen but you only have kitopen in your script.

Capitalized! Change Kitopen to kitopen

We fear what we cannot undo
We fear what we don't know
06-18-2012 03:50 PM
Find all posts by this user Quote this message in a reply
liamthespy Offline
Junior Member

Posts: 26
Joined: Jun 2012
Reputation: 0
Post: #6
RE: I'm probably missing something but this door won't unlock
well that explains it. Thanks a bunch. I don't feel as bad about this since I made the thread title what it is.
06-18-2012 04:46 PM
Find all posts by this user Quote this message in a reply
Prelauncher Offline
Senior Member

Posts: 393
Joined: May 2011
Reputation: 11
Post: #7
RE: I'm probably missing something but this door won't unlock
(06-18-2012 04:46 PM)liamthespy Wrote:  well that explains it. Thanks a bunch. I don't feel as bad about this since I made the thread title what it is.
Why would you feel bad about asking for help Huh

Calories (noun): Tiny creatures that live in your closet and sew your clothes a little bit tighter every night.
06-18-2012 05:27 PM
Find all posts by this user Quote this message in a reply
BeeKayK Offline
Posting Freak

Posts: 1,952
Joined: Mar 2012
Reputation: 75
Post: #8
RE: I'm probably missing something but this door won't unlock
He'd feel bad for making a mistake which was pretty obvious, but he doesn't have to because thats how you learn what to look out for

We fear what we cannot undo
We fear what we don't know
06-18-2012 05:37 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)