Frictional Games Forum (read-only)
Combining Items Problem - 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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Combining Items Problem (/thread-8346.html)



Combining Items Problem - D3AD UPR1S1NG - 05-30-2011

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?


RE: Combining Items Problem - triadtimes - 05-30-2011

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.


RE: Combining Items Problem - D3AD UPR1S1NG - 05-30-2011

(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?


RE: Combining Items Problem - triadtimes - 05-30-2011

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).


RE: Combining Items Problem - D3AD UPR1S1NG - 05-30-2011

(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