Author Topic: Basic .xml usage for actors  (Read 12382 times)

Heretic

  • Moderator
  • Posts: 305
  • Castle Runner
    • View Profile
Basic .xml usage for actors
« 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!

Juschlan

  • Posts: 75
  • I like trains.
    • View Profile
Re: Basic .xml usage for actors
« Reply #1 on: August 25, 2013, 08:37:28 PM »
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:

Quote
<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^^
« Last Edit: August 25, 2013, 08:41:20 PM by Juschlan »

Heretic

  • Moderator
  • Posts: 305
  • Castle Runner
    • View Profile
Re: Basic .xml usage for actors
« Reply #2 on: August 25, 2013, 09:12:22 PM »
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.

Heretic

  • Moderator
  • Posts: 305
  • Castle Runner
    • View Profile
Re: Basic .xml usage for actors
« Reply #3 on: August 26, 2013, 02:00:49 AM »
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.

dave

  • Posts: 6
  • ..needs food badly!
    • View Profile
Re: Basic .xml usage for actors
« Reply #4 on: August 26, 2013, 02:51:25 AM »
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 ;)

Juschlan

  • Posts: 75
  • I like trains.
    • View Profile
Re: Basic .xml usage for actors
« Reply #5 on: August 26, 2013, 09:53:20 AM »
I think every drawing programm should have a option to show a pixelgrid, if not, it's not for drawing -.-

Heretic

  • Moderator
  • Posts: 305
  • Castle Runner
    • View Profile
Re: Basic .xml usage for actors
« Reply #6 on: August 26, 2013, 11:37:00 AM »
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

Juschlan

  • Posts: 75
  • I like trains.
    • View Profile
Re: Basic .xml usage for actors
« Reply #7 on: August 26, 2013, 11:46:48 AM »
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^^

Heretic

  • Moderator
  • Posts: 305
  • Castle Runner
    • View Profile
Re: Basic .xml usage for actors
« Reply #8 on: August 26, 2013, 01:07:31 PM »
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!

Heretic

  • Moderator
  • Posts: 305
  • Castle Runner
    • View Profile
Re: Basic .xml usage for actors
« Reply #9 on: August 26, 2013, 03:08:42 PM »
Does anyone know what the Origin is for?

Myran

  • Developer
  • Posts: 183
    • View Profile
Re: Basic .xml usage for actors
« Reply #10 on: August 26, 2013, 04:29:37 PM »
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.

Juschlan

  • Posts: 75
  • I like trains.
    • View Profile
Re: Basic .xml usage for actors
« Reply #11 on: August 26, 2013, 04:43:34 PM »
So origin is actually unimportant but makes it easier to work with it in the editor?

Myran

  • Developer
  • Posts: 183
    • View Profile
Re: Basic .xml usage for actors
« Reply #12 on: August 26, 2013, 07:37:20 PM »
Well, its important for the sorting of sprites and for the physics collisions.

Juschlan

  • Posts: 75
  • I like trains.
    • View Profile
Re: Basic .xml usage for actors
« Reply #13 on: August 26, 2013, 07:57:19 PM »
yeh, seen that in another post^^ But thanks for the information

Heretic

  • Moderator
  • Posts: 305
  • Castle Runner
    • View Profile
Re: Basic .xml usage for actors
« Reply #14 on: August 26, 2013, 08:08:09 PM »
Got it thanks, I tweaked it up and its working! Doing touch ups and a death animation, then I'll post the final :D