I used this code in a file i called "inventory.hps" and saved in my custom stories folder. The problem is that it doesn't work unless it's in the main game's inventory.hps, which i copied-and-pasted it into. What will happen when other people try and play my custom story? Is there another way of doing this, or will I have to overwrite people's inventory.hps?
void CombinePus(string &in asItemA, string &in asItemB)
{
if(GetGlobalVarInt("PusParts") != 3){
SetInventoryMessage("Inventory", "CombineError", -1);
return;
}
PlayGuiSound("12_make_drill", 1.0f);
AddPlayerSanity(10);
for(int i=1;i<=3;i++) RemoveItem("pus_part0"+i);
GiveItem("Pus", "crowbar", "Pus", "pusglass.tga", 1);
}
////////////////////////////
// Run at the start of the game.
void OnGameStart()
{
AddCombineCallback("pus_1_2", "pus_part01", "pus_part02", "CombinePus", false);
AddCombineCallback("pus_1_3", "pus_part01", "pus_part03", "CombinePus", false);
AddCombineCallback("pus_2_3", "pus_part02", "pus_part03", "CombinePus", false);
}
Like, this code doesn't work by itself in the file i made. It only works in the main game's inventory.hps