Frictional Games Forum (read-only)

Full Version: Why the hell does the combine not work?? :S
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Why doesn't it remove the flasks?
void OnPickUpIngedient_4(string &in asEntity, string &in type)
{
AddLocalVarInt("Flask1", 1);
if (GetLocalVarInt("Flask1") == 4)
{
AddCombineCallback("", "flask01_cuprite_1", "chemical_container_half_1", "UseFlaskOnContainer", true);
AddCombineCallback("", "flask01_aqua_regia_1", "chemical_container_half_1", "UseFlaskOnContainer", true);
AddCombineCallback("", "flask01_calamine_1", "chemical_container_half_1", "UseFlaskOnContainer", true);
AddCombineCallback("", "flask01_orpiment_1", "chemical_container_half_1", "UseFlaskOnContainer", true);
}
}
void UseFlaskOnContainer(string &in asItemA, string &in asItemB)
{
RemoveItem("flask01_cuprite_1");
RemoveItem("flask01_aqua_regia_1");
RemoveItem("flask01_calamine_1");
RemoveItem("flask01_orpiment_1");
}
Probably because GetLocalVarInt("Flask1") != 4. Can't figure it out with so little information.
nah don't think its that one. I allready tested that one with SetPlayerActive(false); and when I picked up the fourt jar my player went unactive :/
Just to make sure, did you try to combine any of the items after picking up each "Ingedient"?
I didn't try before I picked up all four of them Tongue
You need to have all combine callbacks in a file named "inventory.hps", and it needs to be placed in (custom_stories/"StoryName"/maps).

If you want to be able to combine the jars after picking up all four, then put this in your "inventory.hps".

Code:
void OnStart()
{
SetLocalVarInt("Flask1", 0);
SetEntityCallbackFunc("flask01_cuprite_1", "OnPickUpIngedient");
SetEntityCallbackFunc("flask01_aqua_regia_1", "OnPickUpIngedient");
SetEntityCallbackFunc("flask01_calamine_1", "OnPickUpIngedient");
SetEntityCallbackFunc("flask01_orpiment_1", "OnPickUpIngedient");
}

void OnPickUpIngedient(string &in asEntity, string &in type)
{
AddLocalVarInt("Flask1", 1);
func_01();
}

void func_01()
{
  if(GetLocalVarInt("Flask1") == 4)
  {
      AddCombineCallback("", "flask01_cuprite_1", "chemical_container_half_1", "UseFlaskOnContainer", true);
      AddCombineCallback("", "flask01_aqua_regia_1", "chemical_container_half_1", "UseFlaskOnContainer", true);
      AddCombineCallback("", "flask01_calamine_1", "chemical_container_half_1", "UseFlaskOnContainer", true);
      AddCombineCallback("", "flask01_orpiment_1", "chemical_container_half_1", "UseFlaskOnContainer", true);
  }
}

void UseFlaskOnContainer(string &in asItemA, string &in asItemB)
{
RemoveItem(asItemA);
}
Okay thanks Smile.