When you use FindSubstance and set the reserve to 1, it doesnt allow you to use SubtractAmount or ConsumeSubstance on an item thats reserved. Also, if you use FindSubstance on an item thats already been reserved by FindSubstance, it will return an error that it didnt find anything (dont know if maybe that last problem was intentional or not). A snippet of the code I'm using is below...
Code:
var material := FindSubstance(who.backpack, thematerial, amt, 1);
SendSysMessage(who, CStr(material));
if ( !material )
SendSysMessage(who, "You dont have enough resources to fix that item.");
return;
endif
if (!ConsumeSubstance(who.backpack, thematerial, amt))
SendSysMessage(who, "Unable to consume the resources to fix that item.");
return;
endif
First, this gives the sysmessage "Unable to consume the resources to fix that item" (Because SubtractAmount/ConsumeSubstance fails)
next time through, it will say "Error: Not enough of that substance in container." and "You dont have enough resources to fix that item."
Now if I do this
Code:
var material := FindSubstance(who.backpack, thematerial, amt, 0);
ReserveItem(material);
ConsumeSubstance will work and FindSubstance will continue returning it even if reserved but SubtractAmount still doesnt work.