Full Version : Resource Hue retention
xmlspawner >>Scripting Support >>Resource Hue retention


<< Prev | Next >>

Haazen- 07-19-2006
I have many different types of wood. Crafted items except locakable containers retain the hue of the wood resource. In version 1, containers did keep the hue. But with the revamped containers in version 2, they do not.
Where do look to change so lockable containers in version 2 will keep the resource hue?
Other containers like armoires get resource color.

Thanks for reading.

ArteGordon- 07-20-2006
you could explicitly set the hue to the reshue in the OnCraft method in LockableContainer.cs

Haazen- 07-24-2006
Just in case it comes up again, I found the fix for this. In CraftItem.cs around line 1100

if ( item != null )
{
if( item is ICraftable )
endquality = ((ICraftable)item).OnCraft( quality, makersMark, from, craftSystem, typeRes, tool, this, resHue );
else if ( item.Hue == 0 )
item.Hue = resHue;

Got rid of else

if ( item != null )
{
if( item is ICraftable )
endquality = ((ICraftable)item).OnCraft( quality, makersMark, from, craftSystem, typeRes, tool, this, resHue );
if ( item.Hue == 0 )
item.Hue = resHue;

Not sure yet if any other fallout from this will occure. I'm sure I will find out.

ArteGordon- 07-24-2006
you can do that, but it will force all craftable items to take on resource hues even if they override the OnCraft method. This is probably not going to be an issue unless you want to have craftables that dont take on the resource hue.

If you just want to fix the lockable container hue issue, just add the hue assignment into the OnCraft method in lockablecontainer.cs like this

QUOTE

  public int OnCraft( int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue )
  {
  Hue = reshue;
  if ( from.CheckSkill( SkillName.Tinkering, -5.0, 15.0 ) )
  {