Cherubeal
Junior Member
Posts: 5
Threads: 2
Joined: Oct 2012
Reputation:
0
|
inventory.hps just doesnt work.
Im trying to make two items combine together. The code im using is here:
void OnGameStart()
{
AddCombineCallback("", "Piracetam", "SalvinaDinorum", "MadPotFun", true);
}
void MadPotFun(string &in asItemA, string &in asItemB)
{
RemoveItem("Piracetam");
RemoveItem("SalvinaDinorum");
GiveItem("MadnessPotion", "Puzzle", "MadnessPotion", "chemical_container_full.tga", 1);
}
Its currently in inventory.hps in my maps file. The names of all the items are definitely correct. The code doesnt work when moved into the main hps file (moving the on game start function to the OnStart section). I tried entering wrong syntax on purpose into my inventory file to see if its even running because i figured an error would return. The game doesnt report back an error. Ive tried renaming, moving, recreating, shifting, refreshing and editing the inventory.hps file to try and connect it and nothing. Is. Working. This is driving me insane. And yes it is called "inventory.hps" with lowercase i.
<Entry Name="ItemDesc_SalvinaDinorum">"A jar of powdered Salvina Dinorum"</Entry>
<Entry Name="ItemName_SalvinaDinorum">"Salvina Dinorum"</Entry>
<Entry Name="ItemDesc_Piracetam">"A jar of concentrated Piracetam"</Entry>
<Entry Name="ItemName_Piracetam">"Concentrated Piracetam"</Entry>
My lang file entry that DOES work to show all the names are correct. All i get when trying to combine is "That combination doesnt work". The function never calls. The file is never linked. What on earth to i do.
Thanks in advance. Im going to destroy my computer at this rate.
|
|
10-31-2012, 10:42 PM |
|
Lizard
Member
Posts: 174
Threads: 23
Joined: Jul 2012
Reputation:
5
|
RE: inventory.hps just doesnt work.
(10-31-2012, 10:42 PM)Cherubeal Wrote: Im trying to make two items combine together. The code im using is here:
void OnGameStart()
{
AddCombineCallback("", "Piracetam", "SalvinaDinorum", "MadPotFun", true);
}
void MadPotFun(string &in asItemA, string &in asItemB)
{
RemoveItem("Piracetam");
RemoveItem("SalvinaDinorum");
GiveItem("MadnessPotion", "Puzzle", "MadnessPotion", "chemical_container_full.tga", 1);
}
Its currently in inventory.hps in my maps file. The names of all the items are definitely correct. The code doesnt work when moved into the main hps file (moving the on game start function to the OnStart section). I tried entering wrong syntax on purpose into my inventory file to see if its even running because i figured an error would return. The game doesnt report back an error. Ive tried renaming, moving, recreating, shifting, refreshing and editing the inventory.hps file to try and connect it and nothing. Is. Working. This is driving me insane. And yes it is called "inventory.hps" with lowercase i.
"A jar of powdered Salvina Dinorum"
"Salvina Dinorum"
"A jar of concentrated Piracetam"
"Concentrated Piracetam"
My lang file entry that DOES work to show all the names are correct. All i get when trying to combine is "That combination doesnt work". The function never calls. The file is never linked. What on earth to i do.
Thanks in advance. Im going to destroy my computer at this rate.
Try this:
GiveItem("chemical_container_full", "Puzzle", "MadnessPotion", "chemical_container_full.tga", 1);
also its called void OnStart() and not void OnGameStart()
CURRENT PROJECT:
A Fathers Secret == Just started
(This post was last modified: 10-31-2012, 11:02 PM by Lizard.)
|
|
10-31-2012, 10:52 PM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: inventory.hps just doesnt work.
In the inventory file it is: OnGameStart()
And the giveitem seems correct.
Did you place the .hps file the right place? Usually small mistakes make big errors
Trying is the first step to success.
|
|
10-31-2012, 11:11 PM |
|
Cherubeal
Junior Member
Posts: 5
Threads: 2
Joined: Oct 2012
Reputation:
0
|
RE: inventory.hps just doesnt work.
(10-31-2012, 11:11 PM)beecake Wrote: In the inventory file it is: OnGameStart()
And the giveitem seems correct.
Did you place the .hps file the right place? Usually small mistakes make big errors Ive put it in my map directory and tried it. I put it in the folder above that. I put it in the custom story folder. Ive put it in every possible place inside my custom story folder and it doesnt work. I always restart the game before every test. Ive done them all a few hundred times.
|
|
10-31-2012, 11:18 PM |
|
Your Computer
SCAN ME!
Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation:
235
|
RE: inventory.hps just doesnt work.
The correct spot is in the same folder as your maps (this is usually the maps folder, and the place you had it in to begin with).
Could you tell us the exact entities you are using for the combination?
|
|
11-01-2012, 12:23 AM |
|
Cherubeal
Junior Member
Posts: 5
Threads: 2
Joined: Oct 2012
Reputation:
0
|
RE: inventory.hps just doesnt work.
(11-01-2012, 12:23 AM)Your Computer Wrote: The correct spot is in the same folder as your maps (this is usually the maps folder, and the place you had it in to begin with).
Could you tell us the exact entities you are using for the combination? Thats where its sitting now yeah. Im combining a renamed flask01_aqua_regalia and a chemical_container. As an unrelated question if i fill the inventory script with errors will it crash the game or just render the script useless?
|
|
11-01-2012, 12:34 AM |
|
Your Computer
SCAN ME!
Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation:
235
|
RE: inventory.hps just doesnt work.
(11-01-2012, 12:34 AM)Cherubeal Wrote: Thats where its sitting now yeah. Im combining a renamed flask01_aqua_regalia and a chemical_container. As an unrelated question if i fill the inventory script with errors will it crash the game or just render the script useless?
I'm not sure if it'll cause the game to exit with an error for a regular custom story. It may revert to the original inventory.hps or simply not care about it.
I will try testing those items on my end and see if i can duplicate your issue. I was unable to duplicate your issue using your code (i.e. it worked fine for me). How do you give the player the chemical container?
(This post was last modified: 11-01-2012, 10:19 AM by Your Computer.)
|
|
11-01-2012, 02:49 AM |
|
Cherubeal
Junior Member
Posts: 5
Threads: 2
Joined: Oct 2012
Reputation:
0
|
RE: inventory.hps just doesnt work.
(11-01-2012, 02:49 AM)Your Computer Wrote: (11-01-2012, 12:34 AM)Cherubeal Wrote: Thats where its sitting now yeah. Im combining a renamed flask01_aqua_regalia and a chemical_container. As an unrelated question if i fill the inventory script with errors will it crash the game or just render the script useless?
I'm not sure if it'll cause the game to exit with an error for a regular custom story. It may revert to the original inventory.hps or simply not care about it.
I will try testing those items on my end and see if i can duplicate your issue. I was unable to duplicate your issue using your code (i.e. it worked fine for me). How do you give the player the chemical container Both items just sit there on different tables for the player to pick up normally.
|
|
11-01-2012, 11:04 AM |
|
|