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!

Exception thrown when invoking Animations.GetAnimation

Khaz

Knight
Exception thrown when invoking Animations.GetAnimation

I'm new to using the Ultima SDK and have been working on getting the first frame of a mobile animation loaded into a PictureBox control on a Windows Form.
When invoking Animations.GetAnimation, a TypeInitializerException is thrown. The trace describes the final method as BodyConverter.Contains, and the exception's inner message is "Input string was not in a correct form."
The code I am using is below. Can anyone identify if this is a configuration, coding or SDK issue?

Code:
Ultima.Frame[] frames = Ultima.Animations.GetAnimation( 400, 1, 1, 0, true );
pictureBox.Image = frames[0].Bitmap;
 

Khaz

Knight
Hi,
I have not changed any of UO files. They are originals from patch 6.0.1.10. Below is the exception.

Code:
System.TypeInitializationException: The type initializer for 'Ultima.BodyConverter' threw an exception. ---> System.FormatException: Input string was not in a correct format.
   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
   at System.Convert.ToInt32(String value)
   at Ultima.BodyConverter..cctor()
   --- End of inner exception stack trace ---
   at Ultima.BodyConverter.Contains(Int32 body)
   at Ultima.Animations.LoadTable()
   at Ultima.Animations.Translate(Int32& body)
   at Ultima.Animations.GetAnimation(Int32 body, Int32 action, Int32 direction, Int32 hue, Boolean preserveHue)
   at Tykari.MainForm.helpMenuAbout_Click(Object sender, EventArgs args)
 

arul

Sorceror
Seems like one of the values from bodyconv.def doesn't want to be parsed. I'm updating to the latest client to see what's wrong with the file.
 

Jeff

Lord
no, thats happening cause the static initializer for Animation is having a problem, what version of the SDK are you using? As far as i know the version in the SVN on codeplex works best.
 

Khaz

Knight
I'm using the DLL available from the codeplex, last updated 9/15 by you, Jeff. Does the source have this issue fixed?
 

Jeff

Lord
Khaz;779983 said:
I'm using the DLL available from the codeplex, last updated 9/15 by you, Jeff. Does the source have this issue fixed?

ya i think so, sorry i forgot to update the release.
 

Khaz

Knight
It was actually a combination of issues, but the main problem was that the second line of Bodyconv.def file had a quote in the beginning, instead of starting with the comment marker (#). Not sure if this is my fault or Ultima's, but I think the SDK should not care either way. It should only look at lines that start with a digit.

Thanks for the help, arul & Jeff.
 
Top