Modding Help A Way To Make a Gun Change Sprite When Mouse Is Held Down?

Discussion in 'Starbound Modding' started by BitHorizon, Dec 24, 2013.

  1. BitHorizon

    BitHorizon Ketchup Robot

    I have a gun in a mod I'm making and would like it if as long as the fire button is held down, it changes to a sprite where it is "Open". Is there a way to do this?
     
  2. Westeller

    Westeller Space Penguin Leader

    Yes... I think so. I've never tried it before.

    You're going to want to look at

    \ items \ guns \ test \ bow.gun
    \ items \ guns \ test \ bowfull.png
    \ items \ guns \ test \ bowfull.frames

    \ leveling \ bow.functions


    I believe you could possibly do this one of two ways. You could do it the way the bow does it and reference and "imageFrameSelector" in another location - a .functions file you create............... or you could try using it in-line. Like so:

    Code:
    "imageFrameSelector" :  [ "linear", "clamp", [0, 0], [1.0, 4.9], [1.1, 3.9], [1.2, 3.9] ]
    
    No idea if that would work. If it doesn't, just make the .function file like the bow does, no big deal.


    Here. Phlosioneer wrote this out awhile back. I don't know if it works or not since I've never tried it and no one ever posted in the thread to comment on it working or not working. It's a tiny bit outdated now, since functions file is simply named .function as opposed to .lvlfunction and whatnot, but that's okay.
     
    Last edited: Dec 24, 2013
  3. Supergeek

    Supergeek Scruffy Nerf-Herder

    Look at my chickengun mod. It has a single alternate frame of animation for when the button is held down. It makes the chicken open its beak and raise its wing. :D
     

Share This Page