Go Back   RunUO - Ultima Online Emulation > RunUO > Utility Support > Ultima SDK

Ultima SDK Support for the Ultima SDK.

Reply
 
Thread Tools Display Modes
Old 02-06-2004, 11:13 AM   #1 (permalink)
Forum Novice
 
Join Date: Jun 2003
Age: 22
Posts: 134
Send a message via ICQ to [Shaman]
Default animation

hi again..

im trying to make something .. with a picturebox that shows an animated char with a random item equiped and stuff..

using this piece of code to get the frame of it:
Animations.GetAnimation(TileData.ItemTable(i).Anim ation(), action, direction, h, False)(N)

where i is the item/body, h is the hue, and N is the frame number

k so this part works.. but now the wierd part
im trying to align the item to the character... and that's making a bit of a problem since every item got a different point where to start drawing, if i try a chain coif it uses one special point. but another piece of head wear uses another point... and after like 3 days of searching and trying and doing and especially hoping, i still haven't found anything that gives me the info to do that


anybody got the solution?

*Sham
[Shaman] is offline   Reply With Quote
Old 02-07-2004, 12:16 PM   #2 (permalink)
 
Join Date: Sep 2002
Age: 20
Posts: 960
Send a message via ICQ to Revan Send a message via AIM to Revan Send a message via MSN to Revan
Default

well, after checking in InsideUO i found that there are NOT different points.. at least not the character animations and equipment.
Revan is offline   Reply With Quote
Old 02-07-2004, 08:26 PM   #3 (permalink)
Forum Novice
 
Join Date: Jun 2003
Age: 22
Posts: 134
Send a message via ICQ to [Shaman]
Default

well try making a moving character with an equiped chain coif

once you done that
try changing the chain coif to a bandana....
you'll see it won't be aligned, at least with me it's not :?
[Shaman] is offline   Reply With Quote
Old 02-08-2004, 10:21 AM   #4 (permalink)
 
Join Date: Sep 2002
Age: 20
Posts: 960
Send a message via ICQ to Revan Send a message via AIM to Revan Send a message via MSN to Revan
Default

Could you give me the whole source to that part where you add a character..
I try to figure out wtf a ref int is but noone seems to really know :\
(At least not in this context)
Revan is offline   Reply With Quote
Old 02-08-2004, 03:57 PM   #5 (permalink)
Forum Novice
 
Join Date: Jun 2003
Age: 22
Posts: 134
Send a message via ICQ to [Shaman]
Default

anim = Animations.GetAnimation(TileData.ItemTable(i).Anim ation(), action, direction, h, False)(N)

then result.drawimage(anim.bitmap, some x value, some y value)
result is declared as graphics
[Shaman] is offline   Reply With Quote
Old 02-10-2004, 05:22 AM   #6 (permalink)
Guest
 
Posts: n/a
Default

maby if you use pictureBoxes it'll somehow get easier (just a guess)
Personally i prefer pictureBoxes coz you can resize etc
  Reply With Quote
Old 02-10-2004, 06:25 PM   #7 (permalink)
Forum Novice
 
Join Date: Jun 2003
Age: 22
Posts: 134
Send a message via ICQ to [Shaman]
Default

i am using pictureboxes... the problem only is... (don't mind the characters they are supposed to make tiny pictures to explain things)

i got 1 character size this:

+++++++++++++
+++++++++++++
+++++++++++++
+++++++++++++
+++++++++++++
+++++++++++++
+++++++++++++
+++++++++++++
+++++++++++++
+++++++++++++
+++++++++++++
+++++++++++++

thats the size of the actual character...
now the size of a chain coif:

++++
++++
++++
++++

so i can put that on the character.. BUT
the bandana.. (same layer as chain coif) is this:
+++
+++
+++
in other words.. items of same layer differ from size (where they don't in gumps)

so how to make sure the chain coif will be placed correctly AND that the bandana will too... cuz if i now change bandana to chain coif. i got to redo the coords where to place it in the image.. and i don't think you're supposed to do that for 500 different equipable items
[Shaman] is offline   Reply With Quote
Old 02-10-2004, 06:41 PM   #8 (permalink)
Forum Administrator
 
krrios's Avatar
 
Join Date: Aug 2002
Posts: 2,850
Default

The animation frame class should contain centering offset values.
krrios is offline   Reply With Quote
Old 02-10-2004, 08:18 PM   #9 (permalink)
 
Join Date: Nov 2002
Posts: 636
Default

if you use same x and y values while drawing images with Graphics class, then there shouldnt be any problem..
Ceday is offline   Reply With Quote
Old 02-11-2004, 01:37 AM   #10 (permalink)
Forum Novice
 
Join Date: Jun 2003
Age: 22
Posts: 134
Send a message via ICQ to [Shaman]
Default

Quote:
Originally Posted by krrios
The animation frame class should contain centering offset values.
some centering offsets are incorrect, i've gotten 1 item that has these values (used measure command to get picture size...)

min x: 0
max x: 13
min y: 0
max y: 15
k so you got a semi-square item now.. but check this
center.x = 7 (seems correct, 13/2 = 6.5 ~ 7)
center.y = 41

err don't get me wrong, but if an item is 15 pixels wide, how can the center be 41? (makes no sense to me, i've tried it and it diddn't work either)

@ceday: different items got different sizes, and they all need to be in the same place, if you put on a 5x10 pixel item.. you need to make sure it fits the place it's supposed to be.. but if that item gets replaced by another item (same layer, so same use, so it has the same place on the character) the size can be 2 x 4 pixels... so the x and y offsets don't match (it will cause the item to be placed at the wrong position), and if i try center values they don't match either

so is it just me or is it something wrong with my script or whatever?
[Shaman] is offline   Reply With Quote
Old 02-11-2004, 03:44 AM   #11 (permalink)
Forum Administrator
 
krrios's Avatar
 
Join Date: Aug 2002
Posts: 2,850
Default

It's been a long while from when I've last mucked with animations. But, I believe it goes something like this...

If you want to draw a frame standing at (x, y), you use:

x -= frame.Center.X;
y -= frame.Center.Y + frame.Bitmap.Height;
krrios is offline   Reply With Quote
Old 02-12-2004, 06:57 AM   #12 (permalink)
Forum Novice
 
Join Date: Jun 2003
Age: 22
Posts: 134
Send a message via ICQ to [Shaman]
Default

thanks krioss.. that works perfectly, images are at the positions where they are supposed to be....


*edit* i keep getting error when i give action > 3, is there any reason why (i ripped pols client.inc file since it shows basic animation numbers, that list goes from 1 to 30+, though here it won't get past 2)
[Shaman] is offline   Reply With Quote
Old 02-15-2004, 11:06 AM   #13 (permalink)
Forum Novice
 
Join Date: Jun 2003
Age: 22
Posts: 134
Send a message via ICQ to [Shaman]
Default

krios you might know why if i make a body do animation 1 and a cloak animation 1.. they don't actually do the same animation (they are out of synch, and i think the cloak does something else then the body)... if i get gif saving done i'll show it
[Shaman] is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5