Frictional Games Forum (read-only)
Inventory.hps - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Inventory.hps (/thread-13012.html)



Inventory.hps - Tripication - 02-01-2012

Ok, so I was trying this earlier, but didnt really get a reply. I have my inventory.hps in [CUSTOM STORY]>maps
And i cannot figure it out. I must be blind, i've looked through the main game's invent and just about everything else i could find, but i just cant figure it out. Theres no error report or crash, and everything else works...but this.


void OnGameStart()
{
AddCombineCallback("mixture", "TetrodotoxinItem", "HalfDone", "CombineTexHalf", false);
}

void CombineTexHalf(string &in asItemA, string &in asItemB)
{
RemoveItem("TetrodotoxinItem");
RemoveItem("HalfDone");
GiveItem("Mixture", "chemical_container_full.ent", "CompletedRevarsalSyrum", "chemical_container_full.tga", 1);
}
_______________________________________________

Come on, i'm at the very end of the custom story and i just cant figure this crap out. Its giving me the shits beyond belife, working on it for 3 days and i cant work it out. Even if you think it is right, just say so, it still helps.


RE: Inventory.hps - palistov - 02-01-2012

You're trying to give the player an item of subtype "CompleteRevarsalSyrum", which doesn't exist. Change it to "Puzzle" -- there are a few preset types of item, for example: Puzzle, Tinderbox, PotionHealth, PotionOil, etc.

I looked at the wiki, and it says "entry for .lang" -- it is wrong. Item subtype is its internal classification, basically what distinguishes it from other items.

Also, sorry to hear you had so much trouble with this. It's the little things that get the best of us.


RE: Inventory.hps - Tripication - 02-01-2012

Ok, when you say change it to "Puzzle", do you mean just do this?


void OnGameStart()
{
AddCombineCallback("", "TetrodotoxinItem", "HalfDone", "CombineTexHalf", true);
}

void CombineTexHalf(string &in asItemA, string &in asItemB)
{
RemoveItem("TetrodotoxinItem");
RemoveItem("HalfDone");
GiveItem("Mixture", "chemical_container_full.ent", "Puzzle ", "chemical_container_full.tga", 1);
}


Or was the -- indicating i have to put something else in here?


And another question, because the inventory is OnGameStart, does that mean i have to reload he game for the script to take effect, or can i just quick map reload...
Its actually complete now, i cant belive all i had to do, was move the inventory.hps into the Intro folder. I feeeeell reeeaaaallyyyy stttuupppiiidddd. But thank you VERY VERY much for your help.
+1


RE: Inventory.hps - palistov - 02-01-2012

Yep, just like that. The item subtype is very important, because that tells the game how the item will be used. As for OnGameStart() I'm pretty certain you need to re-launch the story from the main menu. A full client restart would be the best option.