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
Need help coding for key to work on door
ryan51695 Offline
Junior Member

Posts: 3
Threads: 1
Joined: Mar 2012
Reputation: 0
#1
Need help coding for key to work on door

okay so the lang file is good, but the test.hps file must be wrong. This is what i have so far


//===========================================
// Starter's Script File!
//===========================================

//===========================================
// This runs when the map first starts
void OnStart()
{
AddUseItemCallback("", "door_key", "hallway_door", "UsedKeyOnDoor", true);
}

void MyFunc(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("hallway_door", false, true);
PlaySoundAtEntity("", "unlock_door", "hallway_door", 0, false);
RemoveItem("door_key");
}
//===========================================
// This runs when the player enters the map
void OnEnter()
{
}

//===========================================
// This runs when the player leaves the map
void OnLeave()
{
}





if anyone could help me get my key to work on the door id appreciate it Smile thanks!
03-20-2012, 09:26 PM
Find
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#2
RE: Need help coding for key to work on door

When you use the key on the door, you're calling UsedKeyOnDoor, when you named the function to unlock the door MyFunc.

03-20-2012, 09:29 PM
Find
ryan51695 Offline
Junior Member

Posts: 3
Threads: 1
Joined: Mar 2012
Reputation: 0
#3
RE: Need help coding for key to work on door

what do you mean?
03-20-2012, 10:47 PM
Find
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#4
RE: Need help coding for key to work on door

void MyFunc(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("hallway_door", false, true);
PlaySoundAtEntity("", "unlock_door", "hallway_door", 0, false);
RemoveItem("door_key");
}
Replace the bolded text with UsedKeyOnDoor

03-20-2012, 10:54 PM
Find
ryan51695 Offline
Junior Member

Posts: 3
Threads: 1
Joined: Mar 2012
Reputation: 0
#5
RE: Need help coding for key to work on door

THANK YOU!!!!!
03-20-2012, 11:03 PM
Find




Users browsing this thread: 3 Guest(s)