Frictional Games Forum (read-only)

Full Version: Break boards with hammer and chipper
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've made a hammer and a chipper which is located on different maps. Once you have them both you combine them and are suppose to break some boards(wooden_boards_block) covering a door. What am I suppose to write to make this happen? Also I have made an inventory.hps which the hammer and chipper code is in

void hammer_chipper(string &in asItemA, string &in asItemB)
{
PlayGuiSound("15_make_hammer", 1.0f);
RemoveItem(asItemA); RemoveItem(asItemB);
GiveItem("stone_hammer_chipper", "Puzzle", "stone_hammer_chipper", "stone_hammer_chipper.tga", 0);
}



void OnGameStart()
{



AddCombineCallback("hammer_chipper", "stone_hammer_1", "stone_chipper_1", "hammer_chipper", false);

Thanks.
So, in your script:

void OnStart()
{
AddUseItemCallback("", "stone_hammer_chipper", "wooden_boards_block", "FUNC", true);
}

void FUNC (string &in asItem, string &in asEntity)
{
SetPropHealth("wooden_boards_block", 0);
///Other things (Remove item, etc)
}

You forgot a bracket in void OnGameStart() Wink
(12-14-2012, 05:16 PM)The chaser Wrote: [ -> ]So, in your script:

void OnStart()
{
AddUseItemCallback("", "stone_hammer_chipper", "wooden_boards_block", "FUNC", true);
}

void FUNC (string &in asItem, string &in asEntity)
{
SetPropHealth("wooden_boards_block", 0);
///Other things (Remove item, etc)
}

You forgot a bracket in void OnGameStart() Wink

Sorry for replying like a month later Tongue I've been a bit busy... The code doesn't work. This is what I did

"Inventory.hps"

void hammer_chipper(string &in asItemA, string &in asItemB)
{
PlayGuiSound("15_make_hammer", 1.0f);
RemoveItem(asItemA); RemoveItem(asItemB);
GiveItem("stone_hammer_chipper", "Puzzle", "stone_hammer_chipper", "stone_hammer_chipper.tga", 0);
}


void OnGameStart()
{
AddCombineCallback("hammer_chipper", "stone_hammer_1", "stone_chipper_1", "hammer_chipper", false);
}



"floor_2.hps"

void Onstart()
{
AddUseItemCallback("", "stone_hammer_chipper", "wooden_boards_block_1", "FUNC", true);
}

void FUNC (string &in asItem, string &in asEntity)
{
SetPropHealth("wooden_boards_block_1", 0);
RemoveItem("stone_hammer_chipper");
}



void OnEnter()
{
}

void OnLeave()
{
}


I can combine the hammer and chipper but when I use it on the wooden boards they don't break. It says like "You can't use this item" or something you know.
Weird... check names, the "Cannot Use this item this way" is a name problem.
Remember to have capitals in OnStart
(01-02-2013, 07:05 PM)beecake Wrote: [ -> ]Remember to have capitals in OnStart

Oh lol I forgot the capital letter xD thank you!
How could I miss that...

[Image: facepalm.jpg]