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
Combining Items Help
Selyp Offline
Member

Posts: 210
Threads: 19
Joined: Feb 2011
Reputation: 7
#1
Shocked  Combining Items Help

Hey everyone. I know this has been asked before, but I cannot find a thread that will answer my questions. I am having trouble with a script for combining items. I have looked on the wiki at scripts, but my script is still not working, so I'm not sure whats wrong. Here is my inventory.hps file.

void OnStart()
{
AddCombineCallback("", "Vinegar", "PhosphoricAcid", "CombineFunc", true);
}
void CombineFunc (string &in asItemA, string& asItemB)
{
GiveSanityBoost();
RemoveItem("Vinegar");
RemoveItem("PhosphoricAcid");
GiveItem("bucket_of_tar", "Puzzle", "bucket_of_tar", "bucket_of_tar.tga", 0);
}

i have made sure that all of my items are the correct name, and the game doesn't crash when I enter, so I am assuming the script file itself is okay, I'm just not sure why the items won't combine. Any help would be greatly appreciated.

-Selyp

Atlantia - An Amnesia: The Dark Descent Full Conversion Mod
08-04-2011, 05:43 AM
Find
MrPotatoHead Offline
Junior Member

Posts: 6
Threads: 0
Joined: May 2011
Reputation: 0
#2
RE: Combining Items Help

(08-04-2011, 05:43 AM)Selyp Wrote: void OnGameStart()

I think that should fix it.

Also make sure you put the inventory.HPS file in the custom_story/maps folder.
08-04-2011, 04:33 PM
Find
MrCookieh Offline
Member

Posts: 157
Threads: 8
Joined: Jul 2011
Reputation: 0
#3
RE: Combining Items Help

void OnStart() should work.

MrPotatoHead Wrote:Also make sure you put the inventory.HPS file in the custom_story/maps folder.

check this.

The Well: Descent - Take a look at it!
08-04-2011, 05:16 PM
Find
Selyp Offline
Member

Posts: 210
Threads: 19
Joined: Feb 2011
Reputation: 7
#4
RE: Combining Items Help

The inventory.hps file is in my maps folder inside the custom story folder. I'm stumped!


Atlantia - An Amnesia: The Dark Descent Full Conversion Mod
08-04-2011, 10:44 PM
Find
Juby Away
Senior Member

Posts: 290
Threads: 2
Joined: May 2011
Reputation: 5
#5
RE: Combining Items Help

(08-04-2011, 05:43 AM)Selyp Wrote:
void CombineFunc (string &in asItemA, string &in asItemB)

You forgot the "&in" for asItemB

Insanity. Static.
08-04-2011, 10:51 PM
Find
MrPotatoHead Offline
Junior Member

Posts: 6
Threads: 0
Joined: May 2011
Reputation: 0
#6
RE: Combining Items Help

(08-04-2011, 10:44 PM)Selyp Wrote: The inventory.hps file is in my maps folder inside the custom story folder. I'm stumped!

Did you change OnStart to OnGameStart? I just tried it out and my combination didn't work when I used OnStart.
08-04-2011, 10:56 PM
Find
Selyp Offline
Member

Posts: 210
Threads: 19
Joined: Feb 2011
Reputation: 7
#7
RE: Combining Items Help

(08-04-2011, 10:51 PM)Juby Wrote:
(08-04-2011, 05:43 AM)Selyp Wrote:
void CombineFunc (string &in asItemA, string &in asItemB)

You forgot the "&in" for asItemB

Ah that must be it. I'll try it out when I get home from work! Thank you!

(08-04-2011, 10:56 PM)MrPotatoHead Wrote:
(08-04-2011, 10:44 PM)Selyp Wrote: The inventory.hps file is in my maps folder inside the custom story folder. I'm stumped!

Did you change OnStart to OnGameStart? I just tried it out and my combination didn't work when I used OnStart.

I'll try this also when I get home. I'll let you know if it works!


Atlantia - An Amnesia: The Dark Descent Full Conversion Mod
(This post was last modified: 08-05-2011, 04:17 AM by Selyp.)
08-05-2011, 04:15 AM
Find
Selyp Offline
Member

Posts: 210
Threads: 19
Joined: Feb 2011
Reputation: 7
#8
RE: Combining Items Help

Made both changes. Still no luck Sad

Also tried doing it in the .hps for the map instead of using inventory.hps and that didn't work either...

Anyone have any ideas?

Script now looks like this

void OnGameStart()
{
AddCombineCallback("", "Vinegar", "PhosphoricAcid", "CombineFunc", true);
}
void CombineFunc (string &in asItemA, string &in asItemB)
{
GiveSanityBoost();
RemoveItem("Vinegar");
RemoveItem("PhosphoricAcid");
GiveItem("bucket_of_tar", "Puzzle", "bucket_of_tar", "bucket_of_tar.tga", 0);
}

Atlantia - An Amnesia: The Dark Descent Full Conversion Mod
08-05-2011, 07:55 AM
Find
MrPotatoHead Offline
Junior Member

Posts: 6
Threads: 0
Joined: May 2011
Reputation: 0
#9
RE: Combining Items Help

Your script seems fine, I just tried it with my own item and had no problems with it.

Check the item names in the level editor. When you place an item, the editor automatically adds _1 to it (Vinegar_1). Make sure the names match.
08-05-2011, 10:08 AM
Find
Selyp Offline
Member

Posts: 210
Threads: 19
Joined: Feb 2011
Reputation: 7
#10
RE: Combining Items Help

(08-05-2011, 10:08 AM)MrPotatoHead Wrote: Your script seems fine, I just tried it with my own item and had no problems with it.

Check the item names in the level editor. When you place an item, the editor automatically adds _1 to it (Vinegar_1). Make sure the names match.

The names are the same, I just checked them again. That's why I'm so confused!

Would there be any problem from the fact that you pick up the Vinegar, and the Phosphoric acid in different maps? I have the script in the inventory.hps file so I assume it should work no matter which map area you're in, but the items are found in different areas. Not sure if that should affect anything though...

Atlantia - An Amnesia: The Dark Descent Full Conversion Mod
08-06-2011, 05:57 AM
Find




Users browsing this thread: 2 Guest(s)