Frictional Games Forum (read-only)
Break boards with hammer and chipper - 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 - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Break boards with hammer and chipper (/thread-19548.html)



Break boards with hammer and chipper - Storfigge - 12-14-2012

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.


RE: Break boards with hammer and chipper - The chaser - 12-14-2012

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


RE: Break boards with hammer and chipper - Storfigge - 01-02-2013

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


RE: Break boards with hammer and chipper - The chaser - 01-02-2013

Weird... check names, the "Cannot Use this item this way" is a name problem.


RE: Break boards with hammer and chipper - FlawlessHappiness - 01-02-2013

Remember to have capitals in OnStart


RE: Break boards with hammer and chipper - Storfigge - 01-02-2013

(01-02-2013, 07:05 PM)beecake Wrote: Remember to have capitals in OnStart

Oh lol I forgot the capital letter xD thank you!


RE: Break boards with hammer and chipper - The chaser - 01-02-2013

How could I miss that...

[Image: facepalm.jpg]