RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Making a new resource failiure

I try to make a new resource, but its abit agonizing, there is loads of red lines, when i start the server, i cant make head or tail out of em, im not a programer, i mainly read and try to figure out whats going on, then i copy and paste.

I did the following:
In "ResourceInfo" in \\Scripts\Misc\.

Almost in the start of the file


RegularLeather = 101,
SpinedLeather,
HornedLeather,
BarbedLeather,
Daemonic,

I added Daemonic in the end

private static CraftResourceInfo[] m_LeatherInfo = new CraftResourceInfo[]
{
new CraftResourceInfo( 0x000, 1049353, "Normal", CraftAttributeInfo.Blank, CraftResource.RegularLeather, typeof( Leather ), typeof( Hides ) ),
new CraftResourceInfo( 0x283, 1049354, "Spined", CraftAttributeInfo.Spined, CraftResource.SpinedLeather, typeof( SpinedLeather ), typeof( SpinedHides ) ),
new CraftResourceInfo( 0x227, 1049355, "Horned", CraftAttributeInfo.Horned, CraftResource.HornedLeather, typeof( HornedLeather ), typeof( HornedHides ) ),
new CraftResourceInfo( 0x1C1, 1049356, "Barbed", CraftAttributeInfo.Barbed, CraftResource.BarbedLeather, typeof( BarbedLeather ), typeof( BarbedHides ) )
};

So then adding a new line for the new respurce that i call Daemonic

new CraftResourceInfo( 0x21, 1049357, "Daemonic", CraftAttributeInfo.Daemonic, CraftResource.DaemonicLeather, typeof( DaemonicLeather ), typeof( DaemonicHides ) )

i do the same a few lines later aswell

Further down i added:


CraftAttributeInfo daemonic = Daemonic = new CraftAttributeInfo();

daemonic.ArmorPhysicalResist = 2;
daemonic.ArmorFireResist = 1;
daemonic.ArmorColdResist = 2;
daemonic.ArmorPoisonResist = 3;
daemonic.ArmorEnergyResist = 4;
daemonic.RunicMinAttributes = 5;
daemonic.RunicMaxAttributes = 6;
if ( Core.ML )
{
daemonic.RunicMinIntensity = 60;
daemonic.RunicMaxIntensity = 100;
}
else
{
daemonic.RunicMinIntensity = 50;
daemonic.RunicMaxIntensity = 100;
}
And then further below, added:

The daeamon part in aswell.

public static CraftResource GetFromOreInfo( OreInfo info )
{
if ( info.Name.IndexOf( "Spined" ) >= 0 )
return CraftResource.SpinedLeather;
else if ( info.Name.IndexOf( "Horned" ) >= 0 )
return CraftResource.HornedLeather;
else if ( info.Name.IndexOf( "Barbed" ) >= 0 )
return CraftResource.BarbedLeather;
else if ( info.Name.IndexOf( "Daemonic" ) >= 0 )
return CraftResource.DaemonicLeather;
else if ( info.Name.IndexOf( "Leather" ) >= 0 )
return CraftResource.RegularLeather;


Then i went into the demonfile and add

"public override HideType HideType{ get{ return HideType.Daemonic; } },"

The same place as for a dragon, drake and so on


Then finaly i went in to the "bacecreature" file in \\Scripts\Mobile\

here i add: Daemonic


public enum HideType
{
Regular,
Spined,
Horned,
Barbed,
Daemonic
}





Obviusly there is something missing, but where?

I will do other things later aswell, but gotta know the way first.
 

Hammerhand

Knight
On roughly line 119 or 120 in your ResourceInfo.cs, you'll see the leathers listed in the same line. You'll need to add your Daemonic there as well. Make it look like this >> Spined, Horned, Barbed, Daemonic;
Other than that, we'll need to know what your errors are to be able to help you better.
 

pooka01

Sorceror
this part:
[the code]
private static CraftResourceInfo[] m_LeatherInfo = new CraftResourceInfo[]
{
new CraftResourceInfo( 0x000, 1049353, "Normal", CraftAttributeInfo.Blank, CraftResource.RegularLeather, typeof( Leather ), typeof( Hides ) ),
new CraftResourceInfo( 0x283, 1049354, "Spined", CraftAttributeInfo.Spined, CraftResource.SpinedLeather, typeof( SpinedLeather ), typeof( SpinedHides ) ),
new CraftResourceInfo( 0x227, 1049355, "Horned", CraftAttributeInfo.Horned, CraftResource.HornedLeather, typeof( HornedLeather ), typeof( HornedHides ) ),
new CraftResourceInfo( 0x1C1, 1049356, "Barbed", CraftAttributeInfo.Barbed, CraftResource.BarbedLeather, typeof( BarbedLeather ), typeof( BarbedHides ) )
};

So then adding a new line for the new respurce that i call Daemonic

[/the code]

should be:
[the code]
private static CraftResourceInfo[] m_LeatherInfo = new CraftResourceInfo[]
{
new CraftResourceInfo( 0x000, 1049353, "Normal", CraftAttributeInfo.Blank, CraftResource.RegularLeather, typeof( Leather ), typeof( Hides ) ),
new CraftResourceInfo( 0x283, 1049354, "Spined", CraftAttributeInfo.Spined, CraftResource.SpinedLeather, typeof( SpinedLeather ), typeof( SpinedHides ) ),
new CraftResourceInfo( 0x227, 1049355, "Horned", CraftAttributeInfo.Horned, CraftResource.HornedLeather, typeof( HornedLeather ), typeof( HornedHides ) ),
new CraftResourceInfo( 0x1C1, 1049356, "Barbed", CraftAttributeInfo.Barbed, CraftResource.BarbedLeather, typeof( BarbedLeather ), typeof( BarbedHides ) ),
new CraftResourceInfo( 0x21, 1049357, "Daemonic", CraftAttributeInfo.Daemonic, CraftResource.DaemonicLeather, typeof( DaemonicLeather ), typeof( DaemonicHides ) )
};
[/the code]


also the: 1049357
is a cliloc number, you can always find the base ressource file and edit how the ressources are registered, so you actually see "daemonic leather" in th sewing kit menu, aswell as hovering mouse over a daemonic leather armor, etc...
I added a silver resource, so if you need help i can assist.

And yea, post your errors please :p
 
Top