Modding Help Help with projectile offset

Discussion in 'Starbound Modding' started by NeonTinkerbell, Jan 26, 2021.

  1. NeonTinkerbell

    NeonTinkerbell Void-Bound Voyager

    I'm working on creating some custom weapons and I'm having a major issue where the projectile is spawning about 5 frames below the muzzle flash. I'm using standardbullet as the projectile type and so far I haven't been able to find where I can change this in any of the activeitem, animation or projectile files. changing the muzzleoffset moves both the flash and projectile together.

    If someone can let me know which value I need to change to fix this that would be awesome!
     
  2. NeonTinkerbell

    NeonTinkerbell Void-Bound Voyager

    Still haven't been able to figure this one out. Any help would be greatly appreciated!
     
  3. Zaakari

    Zaakari Pangalactic Porcupine

    Can you post a picture of the offset? Or, better yet, can you zip up your gun files and attach them to a post (then I can have a look at it in game, and at the code)?
    Even the vanilla guns' projectiles seem to be offset from the muzzle flash, but I assume the offset is much greater in your mod (I'm not sure what you mean by "5 frames").
    You're not using a custom muzzle flash or anything, are you?
     
  4. RedBastion

    RedBastion Intergalactic Tourist

    I am also new to Modding and I also have issue with that but I found how to by adjusting offsets. I just don't understand how the offset works : Ex. "fireOffset" : [3.25, 0.625], in a 16x16 pixels how do I know where this leads? I presume its X, Y? but like if I do 4.25, and 1.625, I would move diagonaly by 1 pixel? I presume that the projectile starting location would be set inside the weapon activeitem files when the weapon fires? I am working on something else more complicated but If I can have more info when getting back to it it woulod be great :)
    PS.: FireOffset is the projectile trajectory.
     
  5. Zaakari

    Zaakari Pangalactic Porcupine

    You should really make your own post for your own questions. However, you are right, the first value in a coordinate array [3, 4] is the x (3), the second is the y (4). I believe a value of 1 represents 8 pixels, so [0.125, 0.125] would be one pixel down and to the right (at least, I think positive Y is down).
     
  6. RedBastion

    RedBastion Intergalactic Tourist

    Thanks, in someway it should also help NeonTinkerBell :).
     

Share This Page