Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Combining drills?
Streetboat Offline
Posting Freak

Posts: 1,099
Threads: 40
Joined: Mar 2011
Reputation: 56
#10
RE: Combining drills?

I thought I had it figured out... Sad 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.

[Image: signature-2.png]
12-22-2011, 03:41 AM
Find


Messages In This Thread
Combining drills? - by Streetboat - 12-18-2011, 11:17 PM
RE: Combining drills? - by Your Computer - 12-18-2011, 11:21 PM
RE: Combining drills? - by palistov - 12-19-2011, 01:06 AM
RE: Combining drills? - by Streetboat - 12-19-2011, 04:51 AM
RE: Combining drills? - by palistov - 12-19-2011, 04:55 AM
RE: Combining drills? - by Streetboat - 12-19-2011, 07:46 AM
RE: Combining drills? - by Streetboat - 12-21-2011, 09:12 AM
RE: Combining drills? - by Your Computer - 12-21-2011, 10:23 AM
RE: Combining drills? - by Streetboat - 12-21-2011, 11:10 PM
RE: Combining drills? - by Streetboat - 12-22-2011, 03:41 AM
RE: Combining drills? - by Your Computer - 12-22-2011, 04:28 AM
RE: Combining drills? - by Streetboat - 12-22-2011, 04:40 AM



Users browsing this thread: 1 Guest(s)