Adding paper-doll graphics
From VbGORE Visual Basic Online RPG Engine
This article refers to how to create graphics for existing paper-doll layers. Paper-doll refers to the ability to visually display equipment on a character. This way, you can have a base character that you keep naked, and stack weapons, armor and items on top of them, allowing your players to completely customize their characters visuals.
Each paper-doll layer is created the same way for the most part. By default, vbGORE comes with the following layers:
* Body * Head * Wings * Weapon * Hair
To edit the paper-doll layer, you must first add the graphics through the Grh system. Make sure for layers that animate (ie all but the head and hair) as you move, you create an animated grh. See the currently existing body grhs for examples.
Now, go to the \Data\ folder and open the corresponding *.dat file according to the layer you wish to edit in Notepad or Wordpad. For example, if you want to edit the body graphics, open Body.dat. Inside the file, you will see comments to what the numbers mean. All paper-dolling follows the following format:
[INIT] NumPaperdoll= [1] ... [2] ...
The [INIT] is required and placed at the very top. After it follows the variable that says the number of paper-doll graphic for the layer you have, as defined below. Each paper-doll graphic starts with a [x], where x is the ID of the paper-doll graphic. This is the value you use to tell the client which paper-doll graphic to draw. For example, if you create a graphic for a weapon under ID 2, then to use that weapon, in the object's data, you set it to change the weapon paper-doll layer to 2 when equipped.
How the information on the Grhs is defined itself is done depends on the paper-doll layer. For all paper-doll files, theres comments at the top on what the numbers mean. For this example, we will use the body:
[1] 'These are the values from Grh1.raw 'The numbers represent the direction the head is facing: '1 = North, 2 = East, 3 = South, 4 = West, 5 = NorthEast, 6 = SouthEast, 7 = SouthWest, 8 = NorthWest 'No letter = walking, a = attacking 1=1138 2=1137 3=1136 4=1139 5=1138 6=1137 7=1136 8=1139 a1=1140 a2=1141 a3=1142 a4=1143 a5=1140 a6=1141 a7=1142 a8=1143 HeadOffsetY=-19 HeadOffsetX=0
The number on the left often refers to direction the character is moving. As you can see, if you only use 4-directional graphics with 8-directional movement, you can just define where direction 5=1, 6=2, 7=3 and 8=4, or in other words, North-East = North, South-East = East, South-West = South, and North-West = West. As the comments say, the a in front of the number means it is the grh used when attacking.
For the numbers on the right, it gets a little trickier. These are all the animated grhs for the body. For better information, read how the grhs are defined in the GrhRaw.dat file provided with the engine.
The body layer's animation speed takes control over the rest of the layers attached to it. Other layers attached to the body that animate, such as the weapon and wings, do not calculate the animation value, and instead use the frame value returned by the body. This is vital to keep the other layers perfectly synchronized with the body because you don't want some layers animating faster than others. This means, though, that you also must keep the number of frames in each layer attached to the body equal to the body. If you have 8 frames in your body's walking, you must have 8 frames in your wing's and weapon's grhs. Any more frames than 8 will never be used, while any less may cause visual errors or even crashes.




