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
Break boards with hammer and chipper
Storfigge Offline
Member

Posts: 101
Threads: 31
Joined: Sep 2012
Reputation: 0
#1
Break boards with hammer and chipper

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.

12-14-2012, 05:12 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#2
RE: Break boards with hammer and chipper

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

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
12-14-2012, 05:16 PM
Find
Storfigge Offline
Member

Posts: 101
Threads: 31
Joined: Sep 2012
Reputation: 0
#3
RE: Break boards with hammer and chipper

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

(This post was last modified: 01-02-2013, 06:12 PM by Storfigge.)
01-02-2013, 06:11 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#4
RE: Break boards with hammer and chipper

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

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
01-02-2013, 06:34 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#5
RE: Break boards with hammer and chipper

Remember to have capitals in OnStart

Trying is the first step to success.
01-02-2013, 07:05 PM
Find
Storfigge Offline
Member

Posts: 101
Threads: 31
Joined: Sep 2012
Reputation: 0
#6
RE: Break boards with hammer and chipper

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

Oh lol I forgot the capital letter xD thank you!

01-02-2013, 07:35 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#7
RE: Break boards with hammer and chipper

How could I miss that...

[Image: facepalm.jpg]

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
01-02-2013, 08:08 PM
Find




Users browsing this thread: 1 Guest(s)