Frictional Games Forum (read-only)
String of custom 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: String of custom combinations (/thread-13885.html)



String of custom combinations - Damascus - 03-10-2012

Yet another question from me. I'm attempting a long string of combinations with custom items, and though I've looked at a lot of other threads, i can't seem to get mine to work. Perhaps because i don't know how internal names work.

I have a chemical_jar I'm calling "Saltpetre" in my extra_english.lang file, a chemical_jar_epoxy renamed "Salt," a flask01_calamine named "Oil of Vitriol," and a flask01_cuprite named "Ammonia."

Combining Saltpetre and Salt makes Salt Mixture, combining Salt Mixture and the Vitriol makes Aqua Regia, combining AR and Ammonia makes Auric Hydroxide.

Here's the script in my inventory.hps file which is currently placed in "custom_maps/tunnel/maps"

Spoiler below!
///////////////////////////////////
////////////COMBINATIONS///////////
///////////////////////////////////

void salt_mixture(string &in asItemA, string &in asItemB)
{
PlayGuiSound("15_make_hammer", 1.0f);
GiveItem("salt_mixture", "chemical_container", "salt_mixture", "chemical_container.tga", 0);
}


void aqua_regia(string &in asItemA, string &in asItemB)
{
PlayGuiSound("15_make_hammer", 1.0f);
GiveItem("aqua_regia", "flask01_calamine", "aqua_regia", "flask01_calamine.tga", 0);
}


void auric_hydroxide(string &in asItemA, string &in asItemB)
{
PlayGuiSound("15_make_hammer", 1.0f);
GiveItem("auric_hydroxide", "flask01_calamine", "auric_hydroxide", "flask01_calamine.tga", 0);
}

////////////////////////////
// Run at the start of the game.
void OnGameStart()
{

/////COMBOS/////
AddCombineCallback("salt_mixture", "chemical_container", "chemical_container_epoxy", "salt_mixture", true);
AddCombineCallback("aqua_regia", "salt_mixture", "flask01_calamine", "aqua_regia", true);
AddCombineCallback("auric_hydroxide", "aqua_regia", "flask01_cuprite", "auric_hydroxide", true);
}


After all this, when I try to combine "Salt" and "Saltpetre" though, it says that the combination doesn't work.

Thanks for being so patient with a newbie with so many questions.



RE: String of custom combinations - JMFStorm - 03-10-2012

The default names of the first "chemical_container.ent" and "chemical_container_epoxy.ent" are: "chemical_container_1" and "chemical_container_epoxy_1". Make sure that they are named with the same name in the level editor as what they are in your script.

void OnGameStart()
{

/////COMBOS/////
AddCombineCallback("salt_mixture", "chemical_container_1", "chemical_container_epoxy_1", "salt_mixture", true);
}

void salt_mixture(string &in asItemA, string &in asItemB)
{
PlayGuiSound("15_make_hammer", 1.0f);
GiveItem("salt_mixture", "chemical_container", "salt_mixture", "chemical_container.tga", 1);
}

You also scripted it so you would get a zero amount of this "salt_mixture".







RE: String of custom combinations - Damascus - 03-11-2012

Alright, I got that to work, but they still wont' combine with the flasks. I'm guessing there's a default name for those that I need too? I added "_01" to the end of the flask names thinking it might work, but it didn't work.

Edit: Despite the fact that I got the first combination to work, I'm now cutting out the salt mixture step and mixing the saltpetre directly with the the vitriol, and using seperate flasks for every new substance. (chemical container = saltpetre, cuprite = vitriol, calamine = ammonia)

Edit2: I've solved it by matching changing the in-game item names and internal names in the callback. They matched beforehand, but for some reason by changing them both to something else, the combination works now. Here's my script as it is for anyone else trying to figure this out.

Spoiler below!
///////////////////////////////////
////////////COMBINATIONS///////////
///////////////////////////////////

void AquaRegia(string &in asItemA, string &in asItemB)
{
RemoveItem(asItemA); RemoveItem(asItemB);
PlayGuiSound("15_make_hammer", 1.0f);
GiveItem("flask01_aqua_regia", "flask01_aqua_regia", "aqua_regia", "flask01_aqua_regia.tga", 1);
}

void AuricHydro(string &in asItemA, string &in asItemB)
{
RemoveItem(asItemA); RemoveItem(asItemB);
PlayGuiSound("15_make_hammer", 1.0f);
GiveItem("flask01_orpiment", "flask01_orpiment", "auric_hydroxide", "flask01_orpiment.tga", 1);
}

////////////////////////////
// Run at the start of the game.
void OnGameStart()
{

/////COMBOS/////
AddCombineCallback("", "chemical_container_1", "vitriol", "AquaRegia", true);
AddCombineCallback("", "flask01_aqua_regia", "ammonia", "AuricHydro", true);
}

I'm marking this as solved. Thanks for the help, everyone!