Anyone here familiar with AlchemyManager.ws?

+
Anyone here familiar with AlchemyManager.ws?

What I'm trying to achieve is returning a value based on what type of recipe you are using for alchemy. This value is then converted into a chance, and determines whether you have been successful in creating a potion.

The whole chance thing works, but the function determining the output value seems to not recognize what recipe I'm using.
This is the (simplified version of the) function:

public function CalculateCookChance( recipe : SAlchemyRecipe ) : int
{
if( recipe.cookedItemType == EACIT_Oil )
return 50;
else
return 100;
}

In this case, creating any oil always succeeds and when I change the 100 to 0, it never succeeds (so the 50 is never returned as a value).

I've been working on this all afternoon, but I fear I have reached a wall I cannot climb without help :)
 
try putting "cookChance = CalculateCookChance( recipe );" line 249 after "GetRecipe(recipeName, recipe);" line 260 in CookItem

As the recipe you give to your function gets a value after the call to GetRecipe.
 
Last edited:
try putting "cookChance = CalculateCookChance( recipe );" line 249 after "GetRecipe(recipeName, recipe);" line 260 in CookItem

As the recipe you give to your function gets a value after the call to GetRecipe.
That is genius! It's fixed :D Thanks man!
 
Top Bottom