Frictional Games Forum (read-only)

Full Version: Combining Items Problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've been trying to combine these items to create the drill except I keep getting an error saying Combination Does Not Work anyone know what's wrong with this script?

void OnStart()
{
AddCombineCallback("", "hand_drill_part01_1", "hand_drill_part03_1", "Combine1", false);
}

void Combine1(string &in asItemA, string &in asItemB)
{
PlayGuiSound("12_make_drill.ogg", 100.0);
GivePlayerSanity(50.0);
RemoveItem(asItemA);
RemoveItem(asItemB);
GiveItem("", "hand_drill", "FinishedDrill", "hand_drill.tga", 0);
}

and yes it is in Inventory.hps Smile anyone got any ideas?
The GiveItem script works like this:
Code:
GiveItem(string& asName, string& asType, string& asSubTypeName, string& asImageName, float afAmount);

So first make it look something like this:
Code:
GiveItem("hand_drill", "Puzzle", "drill", "hand_drill.tga", 0);
"hand_drill" being the name in the level editor
"Puzzle" being the type of item (most are puzzle check in the model editor)
"drill" being the name for the .lang file

Also have OnGameStart() not OnStart()

I hope that helps.
(05-30-2011, 05:57 PM)triadtimes Wrote: [ -> ]The GiveItem script works like this:
Code:
GiveItem(string& asName, string& asType, string& asSubTypeName, string& asImageName, float afAmount);

So first make it look something like this:
Code:
GiveItem("hand_drill", "Puzzle", "drill", "hand_drill.tga", 0);
"hand_drill" being the name in the level editor
"Puzzle" being the type of item (most are puzzle check in the model editor)
"drill" being the name for the .lang file

Also have OnGameStart() not OnStart()

I hope that helps.

Sorry it hasn't worked Sad can I just ask do you need to have the actual finished drill in the map?
No, you shouldn't need that, are you sure you're combining exactly those two pieces with the correct name; I would double check that the names in the editor match those ones. Also in the actual game there is a combine callback for every combination possible, that may be your problem (though I doubt that if those are the only two pieces you're using).
(05-30-2011, 07:19 PM)triadtimes Wrote: [ -> ]No, you shouldn't need that, are you sure you're combining exactly those two pieces with the correct name; I would double check that the names in the editor match those ones. Also in the actual game there is a combine callback for every combination possible, that may be your problem (though I doubt that if those are the only two pieces you're using).

Alright I'll check thanks Smile