Frictional Games Forum (read-only)

Full Version: [SOLVED]Combination does not work (ACID)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So i searched to know how to make a combination, and i came to a script which i editted so it should work for me.
It doesnt...
Yes i have an "inventory.hps" file, and yes it is in my "maps" folder

Here is my combination script:
Spoiler below!


//COMBINE ACID//
////////////////////

void Acid_combine(string &in asItemA, string &in asItemB)
{
PlayGuiSound("puzzle_acid", 1.0f);
RemoveItem(chemical_roed); RemoveItem(chemical_groen);
GiveItem("chemical_container_epoxy", "chemical_container_epoxy", "chemical_container_epoxy", "chemical_container_epoxy.tga", 0);
}

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

/////ACID & ACID COMBO/////
AddCombineCallback("", "chemical_roed", "chemical_groen", "Acid_combine", false);

}


And here is how you get the items.
What happens in that you have 2 mpty containers, and you find 2 different bottles. You use 1 container on the first bottle, and one container on the other. That works perfectly:

Spoiler below!


void OnStart()
{

AddUseItemCallback("", "chemical_1", "amnesia_bottle_1", "Chemical_1_bottle_1", true);
AddUseItemCallback("", "chemical_1", "amnesia_bottle_2", "Chemical_1_bottle_2", true);
AddUseItemCallback("", "chemical_2", "amnesia_bottle_1", "Chemical_2_bottle_1", true);
AddUseItemCallback("", "chemical_2", "amnesia_bottle_2", "Chemical_2_bottle_2", true);
}


void Chemical_1_bottle_1(string &in asItem, string &in asEntity)
{
GiveItem("chemical_roed", "chemical_container_half", "chemical_roed", "chemical_container_half.tga", 1);
RemoveItem("chemical_1");
PlaySoundAtEntity("", "puzzle_acid_fail", "Player", 0.5f, false);
}

void Chemical_1_bottle_2(string &in asItem, string &in asEntity)
{
GiveItem("chemical_groen", "chemical_container_full", "chemical_groen", "chemical_container_full.tga", 1);
RemoveItem("chemical_1");
PlaySoundAtEntity("", "puzzle_acid_fail", "Player", 0.5f, false);
}

void Chemical_2_bottle_1(string &in asItem, string &in asEntity)
{
GiveItem("chemical_roed", "chemical_container_half", "chemical_roed", "chemical_container_half.tga", 1);
RemoveItem("chemical_2");
PlaySoundAtEntity("", "puzzle_acid_fail", "Player", 0.5f, false);
}

void Chemical_2_bottle_2(string &in asItem, string &in asEntity)
{
GiveItem("chemical_groen", "chemical_container_full", "chemical_groen", "chemical_container_full.tga", 1);
RemoveItem("chemical_2");
PlaySoundAtEntity("", "puzzle_acid_fail", "Player", 0.5f, false);
}


But my combination won't work...

Item list:
Empty container 1 = chemical_1
Empty container 2 = chemical_2
Bottle 1 = amnesia_bottle_1
Bottle 2 = amnesia_bottle_2
Red Acid from bottle 1 = chemical_roed
Green Acid from bottle 2 = chemical_groen
Final Acid = chemical_container_epoxy

EDIT: Okay so it turns out that some of the script lines has to stay the same way:

RemoveItem(chemical_roed); RemoveItem(chemical_groen);

Has to be:

RemoveItem(asItemA); RemoveItem(asItemB);

and
GiveItem("chemical_container_epoxy", "chemical_container_epoxy", "chemical_container_epoxy",

Has to be:


GiveItem("chemical_container_epoxy", "Puzzle", "chemical_container_epoxy", "chemical_container_epoxy.tga", 0);

FINAL SCRIPT:
Spoiler below!

//COMBINE ACID//
////////////////////

void Acid_combine(string &in asItemA, string &in asItemB)
{
PlayGuiSound("puzzle_acid", 1.0f);
RemoveItem(asItemA); RemoveItem(asItemB);
GiveItem("chemical_container_epoxy", "Puzzle", "chemical_container_epoxy", "chemical_container_epoxy.tga", 0);
}

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

/////ACID & ACID COMBO/////
AddCombineCallback("", "chemical_roed", "chemical_groen", "Acid_combine", false);

}