Page 1 of 1

mix module error

Posted: Wed Mar 26, 2014 4:30 pm
by KaL
ok i found a problem on the mix module:

i created a mix formula in the table where: 2 health potion = 1 apple

it works!

but i found an error:

if i have "1 health potion" in the inventory.

and try to mix it with only the quanity of "1 health potion" in my inventory. i get an error.

for example:

(1)Health potion
(1)Health potion



Error: Un-handled Exception: The inventory doesn't contain any of those objects.
Error in "/home/thirdlif/public_html/nwe/libs/items.php"
Line 243
Error in /home/thirdlif/public_html/nwe/libs/common.php
Line 554
Error in /home/thirdlif/public_html/nwe/index.php
Line 328



i think you forgot to write an error message for this area, alain.


EDITED: ok i think i fix it. here is the new code,which need to be added:

if ($result->EOF)
{
ErrorMessage("Those do not mix well.");
}
// add this new area here
//---------------------------------------------------------------------------

elseif (Item::OwnedNumber($m1) == 1 and (Item::OwnedNumber($m2) == 1))
{
if (Item::GetInventoryObject($m1) == Item::GetInventoryObject($m1))
{
ErrorMessage("Your quantity of item must be more than 1.");
}
elseif (Item::GetInventoryObject($m2) == Item::GetInventoryObject($m2))
{
ErrorMessage("Your quantity of item must be more than 1.");
}
}

//----------------------------------------------------------------------------
else
{

Re: mix module error

Posted: Wed Mar 26, 2014 6:35 pm
by a_bertrand
Indeed the mix was not planned to be 2x the same item. But I don't think it make much sense anyhow as mixing... therefore I would leave it off the engine.

Re: mix module error

Posted: Wed Mar 26, 2014 8:07 pm
by KaL
What are you talking about? Mixing is great for my sandbox game. This module allow my player to craft whatever they want and turn it to any object in the game, just like minecraft. For example:
(ink= egg+soot+honey) + feather = PEN. You see what I'm talking about, super powerful and fun for player. Don't remove it. Plus I fixed it already. :cry:

Re: mix module error

Posted: Thu Mar 27, 2014 4:50 am
by a_bertrand
I'm not saying mixing is useless, I'm just saying mixing 2x the same ingredient doesn't make much sense "apple + apple" ?

Re: mix module error

Posted: Thu Mar 27, 2014 5:35 am
by KaL
oh! yeah it doesn't make sense. i was just trying to find a way to brake the engine, so i can fix it before the release of my game.