Good afternoon. I've created a custom set of ore; however, whenever created it shows as 'iron ore' regardless of what values I set it to in ResourceInfo.CS, Ore.CS, Mining.CS, BlackSmithy.CS, Ingots.CS, AlterItem.CS or CraftItem.cs.

Trying to figure out what I'm missing, have done a side by side compare of valorite and corrundum(name of my ore) and cannot find anywhere I may have missed.

Is there another script I'm supposed to edit to add custom resources? I checked the tutorial for adding custom leather (thanks for that Hank!) and didn't see anything there I missed either.

Any help is appreciated.

Regards,

Dave
 
Are you running a pre-AOS server?
If so check if there is a LabelNumber accessor in the BaseOre (Ore.cs), BaseIngot (Ingot.cs), etc.
It may look like, this:
Code:
public override int LabelNumber
{
    get
    {
        if ( m_Resource >= CraftResource.DullCopper && m_Resource <= CraftResource.Valorite )
            return 1042845 + (int)(m_Resource - CraftResource.DullCopper);
        return 1042853; // iron ore;
    }
}

Which is probably why you have that "iron ore" always popping.
An idea would be to alter either DefaultName or to override OnSingleClick to send out the one you wish.
 
}[/code]

Which is probably why you have that "iron ore" always popping.
An idea would be to alter either DefaultName or to override OnSingleClick to send out the one you wish.

Yes, I'm running PRE-AOS (UO:R).

Where would I override OnSingleClick? Ore.cs or Resourceinfo.cs??

Thanks for your response :).
 
1: Comment out the LabelNumber accessor:
Code:
/*public override int LabelNumber
{
     get
     {
         if ( m_Resource >= CraftResource.DullCopper && m_Resource <= CraftResource.Valorite )
             return 1042845 + (int)(m_Resource - CraftResource.DullCopper);
         return 1042853; // iron ore;
     }
}*/

Then add this method:
Code:
public override void OnSingleClick( Mobile from ) //allows different ore names when clicking.
{
    if ( Deleted )
        return;

    switch( Resource )
    {
        case CraftResource.Iron: LabelTo( from, (Amount > 1) ? String.Format("iron ores : {0}", Amount) : "iron ore" ); break;
        case CraftResource.DullCopper: LabelTo( from, (Amount > 1) ? String.Format("dull copper ores : {0}", Amount) : "dull copper ore" ); break;
        etc...
        default: base.OnSingleClick( from ); break;
    }
}


NOTE:
But consider that it's OnSingleClick, so if (i don't see why but still) you decide to change the iron ore itemid and give it a new name (snow-ores), it would not work.
I would then consider adding a: if ( Name == null (or == "" not sure if it's null by default) ) -> proceed to switch case.
 
1: Comment out the LabelNumber accessor:
Code:
/*public override int LabelNumber
{
     get
     {
         if ( m_Resource >= CraftResource.DullCopper && m_Resource <= CraftResource.Valorite )
             return 1042845 + (int)(m_Resource - CraftResource.DullCopper);
         return 1042853; // iron ore;
     }
}*/

Then add this method:
Code:
public override void OnSingleClick( Mobile from ) //allows different ore names when clicking.
{
    if ( Deleted )
        return;

    switch( Resource )
    {
        case CraftResource.Iron: LabelTo( from, (Amount > 1) ? String.Format("iron ores : {0}", Amount) : "iron ore" ); break;
        case CraftResource.DullCopper: LabelTo( from, (Amount > 1) ? String.Format("dull copper ores : {0}", Amount) : "dull copper ore" ); break;
        etc...
        default: base.OnSingleClick( from ); break;
    }
}


NOTE:
But consider that it's OnSingleClick, so if (i don't see why but still) you decide to change the iron ore itemid and give it a new name (snow-ores), it would not work.
I would then consider adding a: if ( Name == null (or == "" not sure if it's null by default) ) -> proceed to switch case.



Thanks a ton for your help! :)
 
Back