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
Inventory.hps - combining items
Russ Money Offline
Senior Member

Posts: 360
Threads: 25
Joined: Dec 2010
Reputation: 4
#1
Inventory.hps - combining items

Trying to make a three-way combination, as in the player can take "BloodBottle" item and combine it with either "ChemicalA" or "ChemicalB" first, this would give you MixtureA or MixtureB, depending which one your throw in first.

Then once the first combination is finished, you'd throw in the last chemical, giving you MixtureC. I've searched the wiki and the forums, tried building my inventory.hps the same way and didn't get any results.

Here's the inventory.hps, I've tried even making a single combination and it still wouldn't combine them.
Just for reference, the names are correct in the .lang file as well as in the level editor. You are picking up the correct items, they just won't combine.

void OnGameStart()
{

//MIXTURES
AddCombineCallback("", "BloodBottle", "ChemicalA", "Give_Blooda", false);
AddCombineCallback("", "BloodBottle", "ChemicalB", "Give_Bloodb", false);
AddCombineCallback("", "BloodA", "ChemicalB", "Give_Volatile", false);
AddCombineCallback("", "BloodB", "ChemicalA", "Give_Volatile", false);

}


void Give_Blooda(string &in asItemA, string &in asItemB)
{
AddPlayerSanity(10);
RemoveItem(asItemA);
RemoveItem(asItemB);
GiveItem("", "Puzzle", "BloodA", "glass_container_blood.tga", 0);
SetInventoryMessage("Inventory", "CombineObject1AndObject2", -1);
}

void Give_Bloodb(string &in asItemA, string &in asItemB)
{
AddPlayerSanity(10);
RemoveItem(asItemA);
RemoveItem(asItemB);
GiveItem("", "Puzzle", "BloodB", "glass_container_blood.tga", 0);
SetInventoryMessage("Inventory", "CombineObject1AndObject2", -1);
}

void Give_Volatile(string &in asItemA, string &in asItemB)
{
AddPlayerSanity(10);
RemoveItem(asItemA);
RemoveItem(asItemB);
GiveItem("", "Puzzle", "Volatile", "glass_container_blood.tga", 0);
SetInventoryMessage("Inventory", "CombineObject1AndObject2", -1);
}
03-19-2011, 06:14 AM
Find




Users browsing this thread: 1 Guest(s)