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 Frustrating combination problem.
Slanderous Offline
Posting Freak

Posts: 1,606
Threads: 78
Joined: Dec 2012
Reputation: 63
#1
Frustrating combination problem.

Hey guys,

I was making a combination for my mod (connecting hollow needle + copper tube), made inventory.hps, placed it into my custom story's maps folder, and when I try to combine those items via inventory, it simply doesnt work and shows me "the combination does not work".

The item names 100% match the level editor ones, so you know, yeah.

My inventory.hps file

PHP Code: (Select All)
///////////////////////////////////
////////////COMBINATIONS///////////
///////////////////////////////////

void Coppers(string &in asItemAstring &in asItemB)
{
RemoveItem(asItemA); RemoveItem(asItemB);
PlayGuiSound("15_make_hammer"1.0f);
GiveItemFromFile("copper_tube_and_needle""copper_tube_and_needle.ent");
GiveItem("copper_tube_and_needle""copper_tube_and_needle""copper_tube_and_needle""copper_tube_and_needle.tga"1);
}


////////////////////////////
// Run at the start of the game.
void OnGameStart()
{

/////COMBOS/////
AddCombineCallback("""item1""stone_chipper_1""Coppers"true);

06-03-2014, 09:20 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#2
RE: Frustrating combination problem.

It should be a simple thing to do. I can only guess the inventory.hps file isn't loaded. The script looks fine to me. You should try adding a DebugMessage in OnGameStart in the file, and using the development environment you can check to see if the file loads correctly. If the message doesn't appear, the problem is not internally of the file.

If you don't use the dev environment, you can use something else to check with. Just make it distinct.

(This post was last modified: 06-03-2014, 11:51 PM by Mudbill.)
06-03-2014, 11:51 PM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#3
RE: Frustrating combination problem.

PHP Code: (Select All)
GiveItem("copper_tube_and_needle""copper_tube_and_needle""copper_tube_and_needle""copper_tube_and_needle.tga"1);

---
--
-
Make the SECOND : "copper_tube_and_needle" in to -> Puzzle.
Like this :
PHP Code: (Select All)
GiveItem("copper_tube_and_needle""Puzzle""copper_tube_and_needle""copper_tube_and_needle.tga"1);

---
--
-
Not sure about this :
PHP Code: (Select All)
GiveItemFromFile("copper_tube_and_needle""copper_tube_and_needle.ent"); 
I have NEVER used it... Maybe you need to, but i only have the line GiveItem, there are spaces where to fill in what and where the engine should search.
(This post was last modified: 06-04-2014, 01:52 AM by DnALANGE.)
06-04-2014, 01:48 AM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#4
RE: Frustrating combination problem.

Ah yes, regarding the actual script for giving the item, you should stick with the GiveItem line intead of GiveItemFromFile. The latter was meant for debugging. Also no need to use both, as that'll just give you two items. As DnALANGE said, change that string in the line to match these parameters:

PHP Code: (Select All)
void GiveItem(stringasNamestringasTypestringasSubTypeNamestringasImageNamefloat afAmount); 

asName - internal name
asType - item to give
asSubTypeName - item name for .lang file
asImageName - For exemple: void GiveItem(string& asName, string& asType, “chemical_container_full”, “chemical_container_full.tga” , float afAmount); The image is from graphics\Item\chemical_container_full.tga : is the image which will appear in Inventory - img155.imageshack.us/img155/6871/20806785.jpg
afAmount - amount to give

(This post was last modified: 06-04-2014, 01:55 AM by Mudbill.)
06-04-2014, 01:55 AM
Find
Slanderous Offline
Posting Freak

Posts: 1,606
Threads: 78
Joined: Dec 2012
Reputation: 63
#5
RE: Frustrating combination problem.

I did what you told me here, guys, and it didn't work. I removed the GiveItemFromFileFunc, and changed the GiveItem function (the second word) to Puzzle, as Mudbill said. I also added a debug message to the inventory.hps, not sure if thats what i was meant to do, anyway my current script:

PHP Code: (Select All)
///////////////////////////////////
////////////COMBINATIONS///////////
///////////////////////////////////

void Coppers(string &in asItemAstring &in asItemB)
{
RemoveItem(asItemA); RemoveItem(asItemB);
PlayGuiSound("15_make_hammer"1.0f);
GiveItem("copper_tube_and_needle""Puzzle""copper_tube_and_needle""copper_tube_and_needle.tga"1);
}


////////////////////////////
// Run at the start of the game.
void OnGameStart()
{

AddDebugMessage("This is a test debug message. Thanks to Mudbill and DnALANGE for help! Cheers!"false);
AddCombineCallback("""item1""stone_chipper_1""Coppers"true);

06-04-2014, 03:48 PM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#6
RE: Frustrating combination problem.

I guess ive got you on Skype already right..
Ill send some stuff there and we will fix it.
redmaster12345 = skype

Here is my Inventor.hpl
PHP Code: (Select All)
///////////////////////////////////
//Matches//
void Matchboxscript(string &in asItemAstring &in asItemB)
{
    
PlayGuiSound("19_attach_needle"1.0f);
    
    
AddPlayerSanity(10);
    
    
RemoveItem(asItemA); RemoveItem(asItemB);
    
    
GiveItem("FullyMatchBox""Puzzle""FullyMatchBox""FullMatchbox.tga"0);    
}
/////////////////////////////////



////////////////////////////
// Run at the start of the game.
void OnGameStart()
{

    
//---- Matches ----//
    
AddCombineCallback("Full""MatchBox_2""MatchBox_4""Matchboxscript"false);



---
Try add copper_tube_and_needle.tga", 1); // Change the 1 in 0 try that... ( look at my inventory )
(This post was last modified: 06-04-2014, 06:48 PM by DnALANGE.)
06-04-2014, 06:27 PM
Find
Slanderous Offline
Posting Freak

Posts: 1,606
Threads: 78
Joined: Dec 2012
Reputation: 63
#7
RE: Frustrating combination problem.

(06-04-2014, 06:27 PM)DnALANGE Wrote: I guess ive got you on Skype already right..
Ill send some stuff there and we will fix it.
redmaster12345 = skype

Here is my Inventor.hpl
PHP Code: (Select All)
///////////////////////////////////
//Matches//
void Matchboxscript(string &in asItemAstring &in asItemB)
{
    
PlayGuiSound("19_attach_needle"1.0f);
    
    
AddPlayerSanity(10);
    
    
RemoveItem(asItemA); RemoveItem(asItemB);
    
    
GiveItem("FullyMatchBox""Puzzle""FullyMatchBox""FullMatchbox.tga"0);    
}
/////////////////////////////////



////////////////////////////
// Run at the start of the game.
void OnGameStart()
{

    
//---- Matches ----//
    
AddCombineCallback("Full""MatchBox_2""MatchBox_4""Matchboxscript"false);



---
Try add copper_tube_and_needle.tga", 1); // Change the 1 in 0 try that... ( look at my inventory )

1) i sent you a request to add me on skype,

2) by using your script i remaked my whole inventory .hps file, now it looks like this:

PHP Code: (Select All)
///////////////////////////////////
//Matches//
void Matchboxscript(string &in asItemAstring &in asItemB)
{
    
PlayGuiSound("15_make_hammer"1.0f);
    
    
AddPlayerSanity(10);
    
    
RemoveItem(asItemA); RemoveItem(asItemB);
    
    
GiveItem("copper_tube_and_needle""Puzzle""copper_tube_and_needle""copper_tube_and_needle.tga"0);    
}
/////////////////////////////////



////////////////////////////
// Run at the start of the game.
void OnGameStart()
{

    
//---- Matches ----//
    
AddCombineCallback("Full""item1""stone_chipper_1""Matchboxscript"false);



And it still does not work.
06-04-2014, 07:38 PM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#8
RE: Frustrating combination problem.

PHP Code: (Select All)
GiveItem("copper_tube_and_needle""Puzzle""copper_tube_and_needle""copper_tube_and_needle.tga"0); 

Why is the afAmount = 0? Are you not going to give an item for combining them?
That COULD be the problem, but is don't think it is - if it returns the "Combination doesn't work" message..

Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 06-05-2014, 11:41 AM by Romulator.)
06-05-2014, 11:40 AM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#9
RE: Frustrating combination problem.

Check the log if it mentions any errors not being able to load the inventory.hps file. I still think the problem is that the file isn't loaded, because it should allow you to do the combination if the script loads the first line. Of course only if your names match, but you said they do.

06-05-2014, 01:54 PM
Find
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#10
RE: Frustrating combination problem.

I had the same problem with the inventory.hps. So I did this. It basically checks if you don't have the copper tube and the hollow needle (which lefts with the code to check if you have the syringe instead or not). If you don't have a syringe either, it stops the script permanently. Until you give it a go again (with whatever puzzle youre trying to do).

if(!HasItem("copper_tube_1") && !HasItem("hollow_needle_1")){
        
        if(!HasItem("Syringe")){
            SetMessage("Ch03Lvl17", "NotEverythingNeeded", 0);
            return;
        }
        }
        RemoveItem("Syringe");
    
    //If player never combined the needle and copper tube
    RemoveItem("copper_tube_1");
    RemoveItem("hollow_needle_1");

I hope this is useful in any way.

Derp.
06-05-2014, 03:21 PM
Find




Users browsing this thread: 3 Guest(s)