Frictional Games Forum (read-only)

Full Version: combining inventory items
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?

Code:
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
You make your own inventory.hps and put it into you main directory for your custom story. The name of the script is read by the engine and is used specifically for inventory stuff.
(07-27-2011, 04:40 AM)MrBigzy Wrote: [ -> ]You make your own inventory.hps and put it into you main directory for your custom story. The name of the script is read by the engine and is used specifically for inventory stuff.

I tried this but it didn't work by itself. It only worked once I put it in the main game's .hps.

Unless I'm totally losing it here.

Can anyone else confirm/deny that anything else would be needed to be done?
If I remember correctly, you need to put the inventory.HPS in your custom story maps folder.

custom_stories\Your_Story\maps\inventory.HPS
(07-27-2011, 09:10 AM)MrPotatoHead Wrote: [ -> ]If I remember correctly, you need to put the inventory.HPS in your custom story maps folder.

custom_stories\Your_Story\maps\inventory.HPS

Thanks, I copy/pasted it into that folder just to be safe.