Textures coordinates?

Started by Alenerel, December 21, 2016, 08:49:02 AM

Previous topic - Next topic

Alenerel

I want to make the damage box in one table. Im trying to copy the default tables, which have this:

      <drawSize>(4,4)</drawSize>
      <damageData>
        <rect>(0.05,0.27,1.9,1.73)</rect>
        <cornerTL>Damage/Corner</cornerTL>
        <cornerTR>Damage/Corner</cornerTR>
        <cornerBL>Damage/Corner</cornerBL>
        <cornerBR>Damage/Corner</cornerBR>
      </damageData>
    <size>(2,2)</size>


Now, how are those coordinates in rect referenced? What means drawSize and size? I think that these two mean how big the object is but being 1 unit = 64 px, but Im not sure. How can I get my coordinates to put them in rect?

sulusdacor

size is what the game occupies on space in game. draw size is how the texture gets "strechted" so to speak. its centered in the space(size you define) and gets "opend up" from there. the 64px for a square is what is mostly used. you can use other resolutions i think, but it gets scaled by the game anyway. so it will probably not be worth the effort and details will get lost in this process.

as for the damage it's some time, when i did something with that, but from what i remember/understand your idea can not be done with pure xml:
the damage is more of an overlay. shapes with the damage texture get placed on top of the existing one. different angles and places inside the original texture/space. the <rect> does the shape. the corner TL,TR etc means the TopLeft etc. and it just "says" the game your object is a square please use the square corner damage textures in the topleft and so on (if object takes damage at that spot).

for the numbers inside <rect>. just try it with different numbers yourself ;)
(it determines the size of the damage textures. 3 of them for size, the 4th i don't know, probably just an offest value. was not important for my mod. just check the damage draw code if you want to know excatly.)

the main reason i think you idea would not work is you would need the right angle on the damage texture and if you have a rotateable object it would need to take the rotation into account. from what i remeber the damage textures don't do both things. so even if you would scale them up to the object size it would still rotate them randomly.

there was someone doing a mod that used different textures for different weapons quality in the work in progress forum section. i know weapon textures are a bit different from the objects/furniture. but you might be able to convert the idea/approach he used to just check for hitpoint and not quality and then let the game draw the textures. i don't know how far this was along or if it was released yet. but might be a good place to start looking.