Hammerwatch Forum
Custom mapping and Mods => Resources => Topic started by: Heretic on August 25, 2013, 08:04:49 PM
-
Hey there, I'm wanting to get into this editor and build amazing stuff. I've done modding for other games in the past and have used a variety of tool sets. This is the first time I'll be drawing sprites and animating them though - so I'm just a bit lost. The XML sheets for each actor look very simple, but I'm just not fully aware of how these animations work.
Can someone provide one of the example XMLs and show what each part is for? Origin, frametime, and the numbers in the framtime tags? I know it has to be so simple I'm just not seeing it with my limited experience :(
If anyone could post a simple guide on this, I will be pumping out content as much as possible :)
*Also, if the sprites have to be drawn in a certain format, or if there are guidelines for having sprites work with this engine I would love any and all info on that as well!
THANKS!
-
I've read, that you can extract the assets.bin file with the fileextractor and it outputs a folder with every xml in the game
example: So if you do that, search for the "items" folder, then look for the "letter_a.xml". Then open it and you will see this:
<sprite scale="16">
<texture>items/letters_hammerwatch.png</texture>
<origin>9 26</origin>
<frame time="100">18 0 18 32</frame>
<frame time="100">18 32 18 32</frame>
<frame time="100">18 64 18 32</frame>
<frame time="100">18 96 18 32</frame>
<frame time="100">18 64 18 32</frame>
<frame time="100">18 32 18 32</frame>
</sprite>
<texture>items/letters_hammerwatch.png</texture>
This line tells you, what picture the animation is from. So open that file up, with Paint.NET or gimp or whatever...
<frame time="100">18 0 18 32</frame>
These numbers are coordinates (in pixels)
The first picture of the animation starts at 18|0 and is 18x32 big and is 100 (milliseconds) long
If you now go to these coordinates (with Paint.NET I did it) you will notice these are the coordinates of the top A
the second line should be the coordinates of the 2nd A and so on
You will now think "but these look exact same" no, they don't! Look the shadow, its a bit moved. So this is how the A moves up and down, if you place them in the editor.
should be the same with actors, only with a bit different coordinates and without time="100"
what origin does I don't know, I never changed that and yet it worked so far
I hope you understand this^^
-
Not all of the origins are the same though? Like... each actor has its own origin (and that origin is the same throughout the XML)
Also, THANKS for explaining that! I really appreciate it, I knew it would be simple.
-
These numbers are coordinates (in pixels)
If you now go to these coordinates (with Paint.NET I did it)
I use Adobe Photoshop CC (14 x64) - Is there a way to count pixels with this program? I should probably google it.
-
It's been a few years since I've touched Photoshop, but I'm pretty sure you can activate the 'Pixel Grid' and 'Rulers' features.. then you should be able to set the rulers to measure in pixels. Forgive me if I'm incorrect. :P ;D ;)
-
I think every drawing programm should have a option to show a pixelgrid, if not, it's not for drawing -.-
-
I don't need to draw a pixel grid, I just wanted some kind of ruler to see what pixel I'm at without having to count each pixel by hand, etc. Photoshop has a ruler. I also don't need a pixel grid to work in pixels with photoshop :D
-
drawing a pixel grid xD
I mean if a programm got no pixelgrid it's the worst of all, get a new one if so^^
-
Lol... umm.. I JUST said: I don't need a pixel grid with Photoshop - There can be one but I don't need it. I can work pixel by pixel. Also, it has a ruler that I can use for locating pixel coordinates. Thanks tho!
-
Does anyone know what the Origin is for?
-
Origin is to define the "anchor" for the object, it's used for sorting objects, it's also the center of the physics object and it's the point thats used for when snapping stuff to the grid in the editor. In general it should be where the object meets the ground, so for a character it should be between their feet, for a tree it should be in the middle of the base of the trunk, and so on.
-
So origin is actually unimportant but makes it easier to work with it in the editor?
-
Well, its important for the sorting of sprites and for the physics collisions.
-
yeh, seen that in another post^^ But thanks for the information
-
Got it thanks, I tweaked it up and its working! Doing touch ups and a death animation, then I'll post the final :D