Question how to make a pants mod?

luau_

Newcomer
i wanted to make a simple pants mod, but i'm having a bit of trouble.

pants.png


this huge image is the only pants sprite i could find, and i just don't know what i'm supposed to do lol. am i supposed to modify every single sprite in the image?

the mod is for Fashion Sense, and it seems like every other mod for FS is a few simple sprites, very different from this monstrosity of sprits right here. i'm lost on what to do.
 

SomeoneEls

Farmer
Looking at the wiki for fashion sense, you only need 5 sprites minimum in a row.
In order to parse the pants for each row, you want to add the height of all the previous rows to the Y value.
For example, if the first row is 10 pixels high, the starting y position of the second row is 10.

{How compsci graphics work bc this stuff is not intuitive lol, skip if ya already know}

[How Y and X works]
If you want to get a specific pixel to start a row, the top left corner is regarded as 0,0.
if you go one pixel down, its 0,1
if you go 1 more pixel right from 0,1, you go to 1,1.

[Width and height]
For a point at 0,0...
If the width is 1 pixel, then the line stops at 1,0
if you add a height of 1 pixel, the sprite is the shape enclosed by the lines
0,0 -> 0,1 Left
1,0 -> 1,1 Right
0,0 -> 1,0 Top
0,1 -> 1,1 Bottom


{ Exposition over. }

Just think of the height going down and the width going right.

So! When defining sprite size and where the sprite starts..

"StartingPosition": { <-- Top left corner of the starting sprite
"X": 0, //X
"Y": 10 //Y
},
"BodyPosition": { <-- Where on the character sprite the pant will be (mess with this later if the pants look weird)
"X": 0,
"Y": -21
},
"PantsSize": { <-- Width and length of each sprite
"Width": 16, //Bottom right corner x is X+16 = 16
"Length": 10 //Bottom right corner y is Y + 10 = 20
//Bottom right corner of the sprite is 16,20 !
}

All sprites have to have the same size. You dont have to fill up the box where the sprite is all the way, but the pant has to be inside that box.
For diffrent rows, you can change the size per row, but uh.. it makes the sprites look messy.

For each row, it can be FrontPants, BackPants, LeftPants or RightPants.
Frontpants is rendered when the farmer is facing front, ect.

Movement Animation
For a movement animation, each element is showed in sequence.
JSON:
{
        "Frame": 0, //1st frame
        "EndWhenFarmerFrameUpdates": true,
        "Conditions": [
          {
            "Name": "IsWalking",
            "Value": true
          }
        ]
      },
      {
        "Frame": 1, //2nd frame
        "EndWhenFarmerFrameUpdates": true,
        "Conditions": [
          {
            "Name": "IsWalking",
            "Value": true
          }
        ]
      },
      {
        "Frame": 0,  //3rd frame
        "EndWhenFarmerFrameUpdates": true,
        "Conditions": [
          {
            "Name": "IsWalking",
            "Value": true
          }
        ]
      },
      {
        "Frame": 2,  //4th frame
        "EndWhenFarmerFrameUpdates": true,
        "Conditions": [
          {
            "Name": "IsWalking",
            "Value": true
          }
        ]
      },
For example, this walk cycle is made up of 3 sprites and 4 frames.
The "Frame" tag tells the game what sprite to use in that row.
In compsci, people start counting at 0, so the 0th sprite is the first one and so on.

So, the animation looks like, in order..
0th sprite shown (1st)
1st sprite shown (2nd)
0th sprite shown (1st)
2nd sprite shown (3rd)

Each frame has contidtions to be shown. Following frames have to have the same conditions in order to be seen in the same cycle.
If the next frame has a diffrent condition, then the following frames are of a new cycle with those conditions.

So yeah! Here is the wiki in case I forgot anything or got anything wrong. Happy coding!

 
Last edited:
Top