mix module error

General Chat, Comments
Post Reply
KaL
Posts: 344
Joined: Mon Jan 13, 2014 5:44 am

mix module error

Post 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
{
User avatar
a_bertrand
Posts: 1536
Joined: Mon Feb 25, 2013 1:46 pm

Re: mix module error

Post 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.
Creator of Dot World Maker
Mad programmer and annoying composer
KaL
Posts: 344
Joined: Mon Jan 13, 2014 5:44 am

Re: mix module error

Post 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:
User avatar
a_bertrand
Posts: 1536
Joined: Mon Feb 25, 2013 1:46 pm

Re: mix module error

Post 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" ?
Creator of Dot World Maker
Mad programmer and annoying composer
KaL
Posts: 344
Joined: Mon Jan 13, 2014 5:44 am

Re: mix module error

Post 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.
Post Reply

Return to “General”