Help making animated swaying trees.

If Wishes were UOX Coders, we'd be done by now ;P Post your wishes/suggestions for UOX3 changes/improvements here.
Post Reply
lustrianna
UOX3 Newbie
Posts: 21
Joined: Fri Mar 02, 2012 10:20 pm
Has thanked: 0
Been thanked: 0

Help making animated swaying trees.

Post by lustrianna »

I found out how to make my trees sway in the 2d client by creating new animation frames using the tree art. only thing is i need to have the first frame of my new animation replace the original tree art that i want to sway. in order to do it i need to find the script code for the trees and replace their number id with my new trees. where do i find the script for the trees or can someone make it for me please?
Last edited by lustrianna on Wed Mar 07, 2012 11:48 pm, edited 1 time in total.
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Hm. Not sure what you mean by script code? All the trees in the game (unless you place some yourself by hand) are a part of the static map that comes with the UO Client. You could use a program like UOFiddler to replace art in the game, but I think you may run into some problems with trying to replace the tree IDs with animated versions, unless you can place the initial frame at one ID and the subsequent frames for the animations in other IDs, since you otherwise would have to overwrite IDs of other trees or their leaves.

Example:
The item with HexID 0x0CDD (DecimalID 3293) is the trunk of an oak tree. The ID following immediately after is the ID for the regular leaves of this tree, and the next after that is the autumn leaves. Which means you would have to overwrite the leaves with the subsequent animation frames for the tree trunk, no? Unless you were to put the new tree-animations into empty ID-ranges and then use something like art.def in the client folder to "overrule" the original tree-art and use the new animated ones instead. Or maybe you've gotten around this problem already and I'm just talking nonsense :)
-= Ho Eyo He Hum =-
lustrianna
UOX3 Newbie
Posts: 21
Joined: Fri Mar 02, 2012 10:20 pm
Has thanked: 0
Been thanked: 0

Post by lustrianna »

What i need to do is explained on the RunUO forums under "how to make animated items" for uofiddler. the tutorial states i need to find the script stating the trees name and id code, as in oak tree 0x0CDD, and replace that code with the first frame of my animated tree. problem is i have no idea where the script is for trees! or how to make one for the one I'm trying to replace.
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Ahh, that's a RunUO script for adding a "dynamic" version of your animated tree in-game. To do that in UOX3, just create a new empty dfn file (mycustomitems.dfn or animateditems.dfn - can be named whatever) in notepad or whatnot under UOX3\DFNDATA\ITEMS\, then add in the following

Code: Select all

[tree01] //can be tree01, or banana, or 0x62e1 - whatever you want. Just an identifier
{
get=base_item
NAME=a tree
ID=0x####
}
Save it, restart UOX3 or reload the DFN files through the UOX3 console menu (press '*' followed by '7' to reload the DFNs), and then do 'ADD ITEM tree01 to see it ingame. This, assuming you have already done the "replace art in tiledata/mul files"-part, or nothing will show up.

Note that this part is not needed at all if all you intend to do is replace the "hardcoded" trees in the tiledata/statics-maps. Those use no scripts, neither in RunUO nor in UOX3.
-= Ho Eyo He Hum =-
lustrianna
UOX3 Newbie
Posts: 21
Joined: Fri Mar 02, 2012 10:20 pm
Has thanked: 0
Been thanked: 0

Post by lustrianna »

Basically all I'm needing to do is get the client to read the 0x0DCC tree as 0x3822 which is the first frame to my swaying tree, the anim.mul does its job from there as far as the rest of the animations. is there a file or .mul i can edit to make this happen? to be as clear as possible, i need to find the file that states the Item IDs for all the trees, so i can swap the art for uo`s original trees with the first frames of my animated ones, without changing their order in the art.mul or writing over the art in front of them.
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

body.def (and/or bodyconv.def) in the UO client folder can be used to override the look of one monster with the look of another, so maybe art.def (and/or Arttable.cfg, though this might be only for the 3d/enhanced clients - not sure) in the same folder could be used to override items. I'm not sure about the syntax of the files though, as I've never tinkered with them much.
-= Ho Eyo He Hum =-
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Seems like the format for art.def might be:
inputID {outputID} outputHue
-= Ho Eyo He Hum =-
lustrianna
UOX3 Newbie
Posts: 21
Joined: Fri Mar 02, 2012 10:20 pm
Has thanked: 0
Been thanked: 0

Post by lustrianna »

The numbers don't make any sense to me, theres no way of associating them with their graphic as far as i can tell. oh well. guess ill just have to put the swaying trees on hold for now...
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

The 5-digit numbers are just the decimal versions of regular item-IDs + 16384.

Example:

Code: Select all

# New BBoard
25361 {24158} 0
25361 - 16384 = 8977 (0x2311), added ingame using either 'ADD 8977 or 'ADD 0x2311 (new bulletin board ID)
24158 - 16384 = 7774 (0x1E5E), added ingame using either 'ADD 7774 or 'ADD 0x1E5E (old bulletin board ID)

So to find the IDs you'd have to put in the file, you'd take the ID of your new tree, convert it from hex to decimal (windows calculator in programmer mode makes this very easy) if you can't see that somewhere already, then add 16384. Do the same with the ID of the tree you're replacing, then stuff them both into the file using the following syntax:
newTreeID {oldTreeId} 0

I'm not sure how exactly art.def is used, though - adding the bulletin boards I mentioned in my example, for instance, I can't see any difference. Maybe it's only used by the statics-files? Don't know.
-= Ho Eyo He Hum =-
lustrianna
UOX3 Newbie
Posts: 21
Joined: Fri Mar 02, 2012 10:20 pm
Has thanked: 0
Been thanked: 0

Post by lustrianna »

Tried everything with art.def. Nothing works... Kinda puts a damper on my retexture project. I was almost ready to release the first patch for the terrain overhaul.
dragon slayer
UOX3 Guru
Posts: 776
Joined: Thu Dec 21, 2006 7:37 am
Has thanked: 4 times
Been thanked: 26 times

Post by dragon slayer »

can't wait can't wait :)
lustrianna
UOX3 Newbie
Posts: 21
Joined: Fri Mar 02, 2012 10:20 pm
Has thanked: 0
Been thanked: 0

Post by lustrianna »

The first patch should be done by the end of next week. it will be the natural terrain textures overhaul. trees, grass, rocks, flowers, ect. ect. every tiny detail will be updated. just wish i could have gotten the swayin trees in!
Post Reply