The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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


Messages In This Thread
combining inventory items - by convolution223 - 07-27-2011, 04:32 AM
RE: combining inventory items - by MrBigzy - 07-27-2011, 04:40 AM
RE: combining inventory items - by convolution223 - 07-27-2011, 06:10 AM
RE: combining inventory items - by MrPotatoHead - 07-27-2011, 09:10 AM
RE: combining inventory items - by convolution223 - 07-27-2011, 03:48 PM



Users browsing this thread: 1 Guest(s)