Modding Help How to figure out object rotation centers and firing points?

Discussion in 'Starbound Modding' started by Karull, Dec 11, 2013.

  1. Karull

    Karull Big Damn Hero

    I'm trying to make a tech using the mech as a starting point, and I cannot figure out how they determine the rotation centers and firing points. Can anybody explain to me how exactly these work and how to determine these things for your own images?

    edit: also would be nice to be explained for guns as well.
     
    Last edited: Dec 11, 2013
  2. Lynx88

    Lynx88 Phantasmal Quasar

    Rotation centres and firing point coordinates are dependent on the exact centre of your object. If you're using Photoshop, use the horizontal and vertical guides to easily find the centre of the image.

    So, the centre of the image is 0,0.

    Then turn on your pixel grid, and start counting the pixels from the centre to where your rotation and firing points are. 1 pixel = 1 coordinate shift.

    Hope that helps.
     
  3. madtulip

    madtulip Phantasmal Quasar

    If the object is animated (has frames) the picure is further seperated into the single animation frames(pictures) which is defined in *.frames
    Code:
      "frameGrid" : {
        "size" : [80, 64],
        "dimensions" : [9, 1]
    
    "size" defines to cut the basis *.png down into frames of 80 (left right direction) times 64 (up down direction) pixels.

    "dimensions" defines how many of those pictures are in the basis *.png. here i.e. 9 in left right direction. the new center of each of those 9 is the center of the single [80,64] frames. they usualy use the first dimension of "dimensions" for the animation cycle and the 2nd dimension for different colors of the same object.

    In an .object file you can then define by "imagePosition" how this [80,64] pixels of each animation should be shifted relative to the block at which it is placed inside the game. (everthing ive seen in game so far is just one block with a shiftable picture attached to it).
    Code:
      "orientations" : [
        {
          "imagePosition" : [-72, -32],
          "spaces" : [ [-1, 0], [0, 0], [1, 0]],
          "anchors" : [ "bottom" ]
    if the "imagePosition" is 0,0 then the bootom left corner of your [80,64] pixel frame is the anchor for the block which will support the image in game. you gotta play around with those also. i believe that 8x8 pixels of the original image form one block in game grafics so it would be wise to use n*8 x m*8 pixel dimension for the initial image.

    there is an "anchor" which tells the object towards which side the object has to "snap against forground blocks or if it should snap against the background. the "spaces" define virtual blocks around the anchor block which also need to fullfill the snap condition against the world in order to be placeable here. if i.e. you have 1 anchor (everthign has) and 1 "spaces" to the left and right of the anchor and "anchor" it to bottom then you need a flat area of at least 3 blocks to place it.

    hope some of this is correct :D

    edit: guns i dont know :) they probably dont use an anchor block as they are connected to the player. dont know how that mechanic works :p. hey , those smiley colors are the wrong way around.
     
    Last edited: Dec 11, 2013
    SuperMandrew likes this.
  4. Karull

    Karull Big Damn Hero

    unfortunately, those don't really help with the mech :/ thanks though, I will be able to set up weapons better now!

    edit: these did help me out after all.
     
    Last edited: Dec 17, 2013
  5. Pinchy

    Pinchy Subatomic Cosmonaut

    This helped me set the correct position for my crafting table.
     

Share This Page