The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Removing Wrong Key From Inventory
sixsevensix Offline
Junior Member

Posts: 2
Threads: 1
Joined: Dec 2010
Reputation: 0
#1
Removing Wrong Key From Inventory

I have run into trouble, I have made a puzzle that requires the player to go through and try different keys on a door to open it, one of the six keys are correct (this part works) and unlocks the door, the other 5 are wrong and need to be discarded, the problem I am having is creating a function general enough to work for any key that is NOT the key to the door. Is there a way to go about this without using an add item callback for each key?

Code:
////////////////////////////
// wrongkey function

void WrongOne(string &in asItem, string &in asEntity)
{
if(asItem!="LanternKey"){
PlaySoundAtEntity("", "lock_door.snt", "LanternDoor", 0.0f, false);
RemoveItem(asItem);
}
}


////////////////////////////
// Run when entering map
void OnEnter()
{

AddUseItemCallback("", "Wrong1", "LanternDoor", "WrongOne", false);

}
///////////
12-23-2010, 12:07 PM
Find


Messages In This Thread
Removing Wrong Key From Inventory - by sixsevensix - 12-23-2010, 12:07 PM
RE: Removing Wrong Key From Inventory - by Dark88 - 12-23-2010, 05:05 PM
RE: Removing Wrong Key From Inventory - by Dark88 - 12-23-2010, 09:29 PM



Users browsing this thread: 1 Guest(s)