Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
combining inventory items
convolution223 Offline
Member

Posts: 78
Threads: 15
Joined: Jul 2011
Reputation: 0
#1
combining inventory items

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
(This post was last modified: 07-27-2011, 04:33 AM by convolution223.)
07-27-2011, 04:32 AM
Find
MrBigzy Offline
Senior Member

Posts: 616
Threads: 18
Joined: Mar 2011
Reputation: 8
#2
RE: combining inventory items

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
Find
convolution223 Offline
Member

Posts: 78
Threads: 15
Joined: Jul 2011
Reputation: 0
#3
RE: combining inventory items

(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?
07-27-2011, 06:10 AM
Find
MrPotatoHead Offline
Junior Member

Posts: 6
Threads: 0
Joined: May 2011
Reputation: 0
#4
RE: combining inventory items

If I remember correctly, you need to put the inventory.HPS in your custom story maps folder.

custom_stories\Your_Story\maps\inventory.HPS
(This post was last modified: 07-27-2011, 09:19 AM by MrPotatoHead.)
07-27-2011, 09:10 AM
Find
convolution223 Offline
Member

Posts: 78
Threads: 15
Joined: Jul 2011
Reputation: 0
#5
RE: combining inventory items

(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.
07-27-2011, 03:48 PM
Find




Users browsing this thread: 2 Guest(s)