I can post the scripts, but you may already have the relevant one (that's producing the confusing numbers). I'm starting from the base of
A Better Craft Magic and trying to make one change: calculating the cost to craft an item based on the merchant value of the item, rather than the D&D formula of caster level x spell level x fixed amount.
(I would ask the author of that system, but he and I have had significant conflict, and I don't want to seem like I'm implying he made a mistake, or that he owes an explanation, or has to support my modification of his code, etc.)
To duplicate what I'm seeing, import his system into a module, then put this line right under line 1077 in his version of
x2_inc_craft :
SendMessageToPC(OBJECT_SELF, "The actual GP val of item is " + IntToString(GetGoldPieceValue(oCrafted)) );
That will give you the seemingly incorrect values (when you craft something in game, like a potion).
Then this is the item script I used to double-check the item values, which returns the correct values
on the same exact items created by the scripts that return that different value above:
#include "x2_inc_switches"
void main(){
int nEvent = GetUserDefinedItemEventNumber();
object oUser = GetItemActivator();
object oClicked = GetItemActivatedTarget();
if (nEvent == X2_ITEM_EVENT_ACTIVATE){
SendMessageToPC(oUser, "GP Value of item clicked is " + IntToString(GetGoldPieceValue(oClicked)) );
}
}
If you prefer, I can actually post the complete code of his functions, but I thought it might be easier this way.
Modifié par BCH, 15 août 2013 - 07:45 .