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
Script Help trouble with combining items
PixelHurricane Offline
Junior Member

Posts: 24
Threads: 8
Joined: Jul 2012
Reputation: 0
#1
trouble with combining items

what I want to happen is have the hammer (found in the level) be use on the bed to chip of a piece of metal (stone chipper) an then be able to combine those to produce a crowbar and hammer (kind of bend the metal and what not) getting the chipper works fine. it's the AddCombineCallback that seems to be not working at all

PHP Code: (Select All)
////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("""stone_hammer_1""bed_simple_1""getiron"true);
}
void getiron(string &in asItemstring &in asEntity)
{
GiveItem("stone_chipper""stone_chipper""stone_chipper""stone_chipper.tga"1);
RemoveUseItemCallback("stone_hammer_1");
AddCombineCallback("makecrowbar""stone_hammer_1""stone_chipper""makecrowbar"false);
SetMessage("Messages""Jail1"2);
CreateParticleSystemAtEntity("""ps_hit_metal.ps""bed_simple_1"false);
}
void makecrowbar(string &in asItemAstring &in asItemB)
{
GiveItem("crowbar""crowbar""crowbar""crowbar.tga"1);
RemoveItem("stone_chipper");
}

////////////////////////////
// Run when leaving map
void OnLeave()
{
 
}[/
php 
]
03-14-2013, 10:35 PM
Find
NaxEla Offline
Senior Member

Posts: 415
Threads: 5
Joined: Dec 2012
Reputation: 28
#2
RE: trouble with combining items

You need to make an inventory.hps and put the combine callbacks in there. Also, you'll need to put OnGameStart() instead of OnStart(). Here's a video tutorial made by Your Computer: http://www.youtube.com/watch?v=VtgSk36Sa8E

In Ruins [WIP]
03-14-2013, 10:46 PM
Find
PixelHurricane Offline
Junior Member

Posts: 24
Threads: 8
Joined: Jul 2012
Reputation: 0
#3
RE: trouble with combining items

I tried it first in the inventory.hps first actually.
the addcombinecallback and the makecrowbar parts are exactly the same
03-14-2013, 10:50 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#4
RE: trouble with combining items

Well, it shouldn't work in the map.hps.
Inventory.hps is the only place it should be. You probably made a mistake in there.

Trying is the first step to success.
03-15-2013, 08:02 AM
Find
PixelHurricane Offline
Junior Member

Posts: 24
Threads: 8
Joined: Jul 2012
Reputation: 0
#5
RE: trouble with combining items

ok, i removed the function for combining from jail.hps and put in into the inventory.hps it now looks like this.
PHP Code: (Select All)
void OnGameStart()
{
AddCombineCallback("""stone_hammer_1""stone_chipper""makecrowbar"false);
}
void makecrowbar(string &in asItemAstring &in asItemB)
{
GiveItem("crowbar""crowbar""crowbar""crowbar.tga"1);
RemoveItem("stone_chipper");

it still doesn't work though
(This post was last modified: 03-15-2013, 10:22 PM by PixelHurricane.)
03-15-2013, 06:23 PM
Find




Users browsing this thread: 2 Guest(s)