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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Game does not recognize inventory.hps file
LagerShan Offline
Junior Member

Posts: 11
Threads: 2
Joined: Dec 2018
Reputation: 0
#1
Game does not recognize inventory.hps file

When trying to combine both items, the game does not seem to combine both items at all, nor give out a debug message.
I can post in the Code here and let me know what the problem is, thanks. I tried multiple ways to fix it but none worked so far.
And yeah, the items in game have the same name as what is put into the code. It does not combine the items whatsoever. Nothing functions. The file is also placed in the same folder of the map and hps file.
void OnGameStart()
{
    AddCombineCallback("", "HammerPiece_1", "HammerPiece2_1", "GetFullHammer", true);
}

void GetFullHammer(string &in asItemA, string &in asItemB)
{
    GiveItem("Hammer", "stone_hammer.ent", "FullHammer", "stone_hammer.tga", 1);
    PlayGuiSound("make_hammer", 1);
    RemoveItem(asItemA);
    RemoveItem(asItemB);
}
(This post was last modified: 11-10-2019, 11:50 AM by LagerShan.)
11-08-2019, 08:55 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#2
RE: Game does not recognize inventory.hps file

So if you put Print("Hello"); inside OnGameStart, does it print that into the hpl.log file in your documents?

11-10-2019, 03:48 AM
Find
LagerShan Offline
Junior Member

Posts: 11
Threads: 2
Joined: Dec 2018
Reputation: 0
#3
RE: Game does not recognize inventory.hps file

(11-10-2019, 03:48 AM)Mudbill Wrote: So if you put Print("Hello"); inside OnGameStart, does it print that into the hpl.log file in your documents?

Thanks for replying, sadly no it doesn't.

Also, one more thing.
I updated my Code inside the inventory.hps considering there will be 3 items and 4 items inside the level and the game gets to pick to randomize one of them that will turn active. 
Not sure if I've done it right.

void GetFullHammer(string &in asItemA, string &in asItemB)
{
    GiveItem("Hammer", "stone_hammer.ent", "FullHammer", "stone_hammer.tga", 1);
    PlayGuiSound("make_hammer", 1);
    RemoveItem(asItemA);
    RemoveItem(asItemB);
}

void OnGameStart()
{
    for (int x=1; x<=3; x++)
   {
       for (int y=1; y<=4; y++)
           {
               AddCombineCallback("Hammer", "HammerPiece_"+x, "HammerPiece2_"+y, "GetFullHammer", true);
           }
    }
        Print("Hello");
}

Inside the Hps File of the level it's like this for the randomizer. Not that it matters but maybe it can help solving the problem easier.

int x = RandInt(1,3);
    SetEntityActive("HammerPiece_"+x, true);
    int xx = RandInt(1,4);
    SetEntityActive("HammerPiece2_"+xx, true);

The randomizer works perfectly in the game, the problem is, the inventory combining system isn't getting recognized. i also tried combining normal items without them being randomized and still doesn't function so not sure what I'm doing wrong here.
Thanks in advance.
(This post was last modified: 11-10-2019, 12:00 PM by LagerShan.)
11-10-2019, 11:53 AM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#4
RE: Game does not recognize inventory.hps file

Probably best to fix one issue before introducing another.

If the Print doesn't work, it seems to me like the file is never loaded. Make sure you don't have a hidden .txt extension or use an incorrect file format.

11-10-2019, 04:00 PM
Find
LagerShan Offline
Junior Member

Posts: 11
Threads: 2
Joined: Dec 2018
Reputation: 0
#5
RE: Game does not recognize inventory.hps file

(11-10-2019, 04:00 PM)Mudbill Wrote: Probably best to fix one issue before introducing another.

If the Print doesn't work, it seems to me like the file is never loaded. Make sure you don't have a hidden .txt extension or use an incorrect file format.

Checked Hidden Items and file extensions, it's "inventory.hps" and it's inside the same folder the level and script file is in.
11-10-2019, 04:17 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#6
RE: Game does not recognize inventory.hps file

And when you test your CS, are you using "new game" or "continue" ?

I just tested it myself and worked fine.

PHP Code: (Select All)
void OnGameStart() 
{
    Print(
"Test log from inventory.hps\n");


Make sure capitals are all lower-case in the file name. File should be in the folder specified by the MapsFolder in custom_story_settings.cfg

This should print this line somewhere in the hpl.log file for the current instance (which is "Main" unless you're loading the CS through a mod).

If it still doesn't work, send the hpl.log.

(This post was last modified: 11-10-2019, 08:23 PM by Mudbill.)
11-10-2019, 08:22 PM
Find
LagerShan Offline
Junior Member

Posts: 11
Threads: 2
Joined: Dec 2018
Reputation: 0
#7
RE: Game does not recognize inventory.hps file

(11-10-2019, 08:22 PM)Mudbill Wrote: And when you test your CS, are you using "new game" or "continue" ?

I just tested it myself and worked fine.

PHP Code: (Select All)
void OnGameStart() 
{
 
   Print("Test log from inventory.hps\n");


Make sure capitals are all lower-case in the file name. File should be in the folder specified by the MapsFolder in custom_story_settings.cfg

This should print this line somewhere in the hpl.log file for the current instance (which is "Main" unless you're loading the CS through a mod).

If it still doesn't work, send the hpl.log.
You're right, I just fixed it. The problem was that in the custom_story_settings.cfg, the map destination had Ch02, isntead of ch02 since that's how it actually is named in the folder. Althought if it was named incorrectly this whole time, then how did it find the map correctly even if the ch02 was written incorrectly?
Thanks alot of taking your time to help, can't believe I missed something like that. Althought didn't notice it would have been the problem considering it actually found and loaded the map correctly even if it was mispelled.
(This post was last modified: 11-10-2019, 10:04 PM by LagerShan.)
11-10-2019, 10:01 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#8
RE: Game does not recognize inventory.hps file

The game is pretty good at finding files as long as it knows where to look. If you give it the approximate location for maps, I think it is still able to find files nearby, like in a folder deeper than expected. I can't say for sure how the process works, but perhaps this robust locating can obfuscate some issues that would otherwise be obvious.

11-12-2019, 02:51 AM
Find




Users browsing this thread: 4 Guest(s)