Streetboat
Posting Freak
Posts: 1,099
Threads: 40
Joined: Mar 2011
Reputation:
56
|
RE: Combining drills?
I thought I had it figured out... It looks great in my inventory.hps file, exactly like in the main Amnesia game. Here:
Quote:void OnGameStart()
{
AddCombineCallback("", "drill_bit", "drill_handle_plastic", "CombineDrillMix", true);
AddCombineCallback("", "drill_bit", "drill_part_plastic", "CombineDrillMix", true);
AddCombineCallback("", "drill_handle", "drill_part_plastic", "CombineDrillMix", true);
AddCombineCallback("", "drill_bit_plastic", "drill_part", "CombineDrillMix", true);
AddCombineCallback("", "drill_bit_plastic", "drill_handle", "CombineDrillMix", true);
AddCombineCallback("", "drill_bit", "drill_handle", "CombineDrill", true);
AddCombineCallback("", "drill_bit", "drill_part", "CombineDrill", true);
AddCombineCallback("", "drill_part", "drill_handle", "CombineDrill", true);
AddCombineCallback("", "drill_bit_plastic", "drill_handle_plastic", "CombineDrillToy", true);
AddCombineCallback("", "drill_bit_plastic", "drill_part_plastic", "CombineDrillToy", true);
AddCombineCallback("", "drill_part_plastic", "drill_handle_plastic", "CombineDrillToy", true);
}
void CombineDrillMix(string &in asItemA, string &in asItemB)
{
SetInventoryMessage("Inventory", "CombineDrillPlastic", -1);
return;
}
void CombineDrill(string &in asItemA, string &in asItemB)
{
if(GetGlobalVarInt("DrillParts") != 3){
SetInventoryMessage("Inventory", "CombineDrillError", -1);
return;
}
if(GetGlobalVarInt("DrillParts") == 3)
{
PlayGuiSound("12_make_drill", 1.0f);
RemoveItem("drill_bit");
RemoveItem("drill_part");
RemoveItem("drill_handle");
GiveItem("hand_drill_1", "hand_drill", "handdrill", "hand_drill.tga", 0);
SetMessage("Inventory", "MadeDrill", 0);
}
}
void CombineDrillToy(string &in asItemA, string &in asItemB)
{
if(GetGlobalVarInt("DrillPartsPlastic") != 3){
SetInventoryMessage("Inventory", "CombineDrillError", -1);
return;
}
if(GetGlobalVarInt("DrillPartsPlastic") == 3)
{
PlayGuiSound("12_make_drill", 1.0f);
RemoveItem("drill_bit_plastic");
RemoveItem("drill_part_plastic");
RemoveItem("drill_handle_plastic");
GiveItem("hand_drill_plastic", "hand_drill", "handdrillplastic", "hand_drill.tga", 0);
SetMessage("Inventory", "MadeDrillPlastic", 0);
}
}
And here is an example of how one of the pickup scripts looks in the level files:
Quote:void drillhandle(string &in asEntity)
{
SetGlobalVarInt("gothandle", 1);
AddGlobalVarInt("DrillParts", 1);
SetMessage("Messages4", "DrillHandle", 0);
if(GetGlobalVarInt("DrillParts") == 2)
{
GiveHint("combinehint", "Hints", "CombineHint", 0);
}
}
It just tells me 'combination does not work' when I try to combine them. It seems as if it isn't running any of the scripts in inventory.hps for some reason.
|
|