Frictional Games Forum (read-only)
[SCRIPT] Combinations? - 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: [SCRIPT] Combinations? (/thread-12966.html)



Combinations? - Tripication - 01-30-2012

Hey guys, just started working with combinations.

Is this correct?(To combine TetrodotoxinItem with HalfDone and get a chemical_container_epoxy.ent[wich i will rename when the script is correct])

void OnStart()
{

AddCombineCallback("MixtureCombination", "HalfDone", "TetrodotoxinItem", "CompleteMix", true);
}

void CompleteMix(string &in asItemA, string &in asItemB)
{
RemoveItem("TetrodotoxinItem");
RemoveItem("HalfDone");
GiveItem("CompleteMix", "chemical_container_epoxy.ent", "ReversalSyrum", "chemical_container_epoxy.tga", 1);
}

P.S. Its not working...


RE: Combinations? - Tripication - 01-30-2012

33 views 0 replies -.-


RE: Combinations? - Tripication - 01-30-2012

Ok, so i've figured out that the combination requires an inventory.hps. But i have no idea how to relate my maps.hps with the inventory.hps or how to use the inventory.hps...


RE: Combinations? - Your Computer - 01-30-2012

(01-30-2012, 11:38 AM)Tripication Wrote: Ok, so i've figured out that the combination requires an inventory.hps. But i have no idea how to relate my maps.hps with the inventory.hps or how to use the inventory.hps...

inventory.hps goes in the folder where your maps and scripts are. Understanding the inventory.hps file is as easy as looking at the main campaign's inventory.hps file.


RE: Combinations? - Tripication - 01-30-2012

I did test it a bit, but couldnt seem to figure it out... Does it need to relate to the game in anyway? If so what way... I will test in detail tonight


RE: Combinations? - palistov - 01-31-2012

It isn't required to have an inventory.hps file, but it's better if you use one because then it allows the player to combine the two items anywhere in the story. If you script it in your maps it won't work in any map without the appropriate function.

Take a look at TDD's inventory.hps and try and emulate it. It's similar to the map's script file. You need an OnGameStart() in which you add the combination callback, and then you write up the function elsewhere in the script. Make sure your story is already open in Amnesia before you edit, because just like map script files, syntax errors in the inventory file will crash the game at compile time.