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!

Getting item animations using SDK

astrocreep2k

Wanderer
Getting item animations using SDK

Hey all, hopefully someone can help me. I am planning on writing a script for runUO that can export character info, and then render an image from the 2d clients art for that char to be used for forum sigs and other web related stuff.

I am having some trouble figuring out the whole ItemID to art id relationship. I want to use the Ultima SDK to retrieve the animations from the mul's, but I am a little confused. It seemed that the GetAnimation is what I am looking for, but one of its args is bodyID. This seems to work fine for getting the body graphic, but I am not sure how to go about getting the item graphics. A robe for example, does not seem to work when I pass in its ID. Am I missing something?

Any help is greatly appreciated.
 

Seanchen.net

Wanderer
astrocreep2k said:
Hey all, hopefully someone can help me. I am planning on writing a script for runUO that can export character info, and then render an image from the 2d clients art for that char to be used for forum sigs and other web related stuff.

I am having some trouble figuring out the whole ItemID to art id relationship. I want to use the Ultima SDK to retrieve the animations from the mul's, but I am a little confused. It seemed that the GetAnimation is what I am looking for, but one of its args is bodyID. This seems to work fine for getting the body graphic, but I am not sure how to go about getting the item graphics. A robe for example, does not seem to work when I pass in its ID. Am I missing something?

Any help is greatly appreciated.

You will have to modify the code to make it work, or you can wait till I release my modifications that I am working on.

You have to read the correct file anim.mul is the only file GetAnimation reads.
 

RHYMES

Wanderer
astrocreep2k said:
Hey all, hopefully someone can help me. I am planning on writing a script for runUO that can export character info, and then render an image from the 2d clients art for that char to be used for forum sigs and other web related stuff.

I am having some trouble figuring out the whole ItemID to art id relationship. I want to use the Ultima SDK to retrieve the animations from the mul's, but I am a little confused. It seemed that the GetAnimation is what I am looking for, but one of its args is bodyID. This seems to work fine for getting the body graphic, but I am not sure how to go about getting the item graphics. A robe for example, does not seem to work when I pass in its ID. Am I missing something?

Any help is greatly appreciated.


Do you mean like Uogamers myUOG? Where you can search for a character and see what they are wearing? I dont see why you need animations for that? Like the pic of the player standing there in the profile?
 

RHYMES

Wanderer
Ok, I can only think of 2 ways you mean.

Way 1: The actual gump of the character would be

pictureBox1.Image = Ultima.Gumps.GetGump(12);

Way 2: The Char standing there.

Frame[] frames = Ultima.Animations.GetAnimation(400, 4, 0, 0, true);
pictureBox1.Image = frames[0].Bitmap;

After that you should just beable to overlay a bitmap to put clothes on it and hue them.

Not sure about this whole modify the code thing.
 

astrocreep2k

Wanderer
RHYMES said:
Ok, I can only think of 2 ways you mean.

Way 1: The actual gump of the character would be

pictureBox1.Image = Ultima.Gumps.GetGump(12);

Way 2: The Char standing there.

Frame[] frames = Ultima.Animations.GetAnimation(400, 4, 0, 0, true);
pictureBox1.Image = frames[0].Bitmap;

After that you should just beable to overlay a bitmap to put clothes on it and hue them.

Not sure about this whole modify the code thing.


(Way #2) Thats almost exactly what I want to do. I am able to get the bitmap for the char (just as you have shown), but the second part is where I am stuck. I was planning on rendering each layer of clothing (and weapons) once I have the first frame of the body. Im guessing the method I am using is strictly for retrieving the body frames.

As far as why I am using animations, I was thinking at some point that I may want to render out an animated gif for each char. I probably will not do this right away, but would like to keep the option open. And thanks for the gump info, I may want to also render that out somewhere as well.
 

astrocreep2k

Wanderer
Seanchen.net said:
You will have to modify the code to make it work, or you can wait till I release my modifications that I am working on.

You have to read the correct file anim.mul is the only file GetAnimation reads.

I'd be happy to mod the code, but am having troubles finding good docs on the mul spec. I understand the basics of how the index file maps to the muls, but seem to be confused on how an actual item id within runUO maps to an animation index. Ive seen it reffered to as the Model ID within "inside uo", but im not sure how they make that connection. I am sure that I am missing something, I just havent been able to figure out what.

What are you using for reference in your code?
 

Seanchen.net

Wanderer
astrocreep2k said:
I'd be happy to mod the code, but am having troubles finding good docs on the mul spec. I understand the basics of how the index file maps to the muls, but seem to be confused on how an actual item id within runUO maps to an animation index. Ive seen it reffered to as the Model ID within "inside uo", but im not sure how they make that connection. I am sure that I am missing something, I just havent been able to figure out what.

What are you using for reference in your code?

Why are you trying to modify the code that reads the file, that works.

All the code to read all the files, exists. You need to modify the code to make it work in the context your trying to use it in.
 

astrocreep2k

Wanderer
Seanchen.net said:
Why are you trying to modify the code that reads the file, that works.

All the code to read all the files, exists. You need to modify the code to make it work in the context your trying to use it in.

Im not trying to modify anything yet. Im just trying to figure out what I need to do. I understand that the existing code reads the files properly. Once I figure out how/where the relationship between an animation index, and an item ID is maintained, I could add code (unless you've already done this), to allow someone to get the frames for an item, in addition to the exisiting methods that allow you to get frames for a body. Does this make sense?
 

floppydisc

Sorceror
For every ItemID there's a Tiledata entry. That holds the AnimID for that item. Warning: that can be overridden by the body.def file!
 

Seanchen.net

Wanderer
astrocreep2k said:
Im not trying to modify anything yet. Im just trying to figure out what I need to do. I understand that the existing code reads the files properly. Once I figure out how/where the relationship between an animation index, and an item ID is maintained, I could add code (unless you've already done this), to allow someone to get the frames for an item, in addition to the exisiting methods that allow you to get frames for a body. Does this make sense?

You could use the animation.mul and just use the "Stand" animation for all the weapons. This process would require a good amount of knowlege of how to design something like that.
 

astrocreep2k

Wanderer
Now that I know how things relate, im all set. I was able to sucessfully render out the first character image with weapons and clothing. Thanks for the help everyone.
 
Top