1. Hey Guest! We've announced our new game Wargroove, check out the new forums!
    Dismiss Notice

Modding Help Projectiles with lit images

Discussion in 'Starbound Modding' started by Tamamo89, Feb 15, 2017.

  1. Tamamo89

    Tamamo89 Subatomic Cosmonaut

    So i'm trying to make a projectile that moves and rotates towards the activeItem.ownerAimPosition and has a dual image, one with fullbright and one without. Is this possible to do?

    Code:
    {
      "projectileName" : "fu_lasereye_eyeball",
      "physics" : "hover",
      "bounces" : -1,
      "speed" : 0,
      "timeToLive" : 6,
      "damageKindImage" : "icon.png",
      "lightColor" : [0, 150, 0],
      "piercing" : true,
      "image" : "fu_lasereye_eyeball.png",
      "animationCycle" : 0.5,
      "orientationLocked" : true,
      "flippable" : true,
      "frameNumber" : 4,
      "power" : 0,
      "damagePoly" : [ [-12, 0], [-9, 9], [0, 12], [9, 9], [0, 12], [9, -9], [0,-12], [-9, -9] ],
      "supportsProcessing" : true,
      "onlyHitTerrain" : true,
      "actionOnReap" : [
        {
          "action" : "config",
          "file" : "/projectiles/explosions/globeexplosions/greenglobeexplosion/greenglobeexplosion.config"
        }
      ],
      "damageKind" : "electricplasma",
    
      "scripts" : [ "/projectiles/activeitems/staff/lasereyestaff/fu_lasereye_eyeball.lua" ],
    
      "projectileType" : "fu_lasereyeshot",
      "projectileParameters" : {},
      "spawnRate" : 0.2,
    
      "controlMovement" : {
        "maxSpeed" : 40,
        "controlForce" : 30
      },
      "controlRotation" : {
        "maxSpeed" : 60,
        "controlForce" : 80,
        "friction" : 10
      },
    
      "persistentAudio" : "/sfx/melee/barrier_create_electric.ogg"
    }
    
     
  2. bk3k

    bk3k Giant Laser Beams

    For the fullbright, I'd imagine same as anything
    Code:
    "imageLayers" : [ { "image" : "fu_lasereye_eyeball.png:<color>.<frame>", "fullbright" : true }, { "image" : "fu_lasereye_eyeball_lit.png:<color>.<frame>" } ],
    In the animation under part properties add "fullbright" : true to the fullbright part. like
    Code:
    "parts : {
      "projectile" : {
        "properties" : {
          
        }
      },
      "projectile_FB" : {
        "properties" : {
          "fullbright" : true
        }
      }
    }
    
    That little snippet doesn't include any "partStates" that you'd need to add, etc. Also putting both parts in the same "rotationGroup"
     
    IHart likes this.
  3. EmissaryOfInfinity

    EmissaryOfInfinity Astral Cartographer

    b3k3, while you're here, I was wondering if there was any way to add a fullbright image to armors. While I know nothing had been discovered previously, the last thread I saw on it was fairly old, and I wasn't sure if anything new had come up.
     
  4. bk3k

    bk3k Giant Laser Beams

    Hmm.

    Since your question is a bit off-topic(this is about a projectile) I'll use a spoiler.

    On objects and probably most things you can replace "image" with "dualImage" or vise versa. In that case you can also use an "imageLayers" array with the objects containing "image"/"dualImage", "fullbright", "position" etc.

    But the armor is a far more simple implementation and doesn't list "image" or anything like it. It might be less flexible on the engine side. The best thing is to experiment with things you aren't sure will work. Let me provide old JSON code from the now depreciated object that you can experiment with.


    Code:
    {
      "objectName" : "avianshiplockerTier0",
      "tags" : ["avian","storage"],
      "printable" : false,
      "rarity" : "Common",
    
      "category" : "decorative",
      "description" : "Store some stuff, why don't you?",
      "shortdescription" : "Shiplocker",
      "race" : "avian",
    
      "lightColor" : [102, 61, 61],
    
      "apexDescription" : "Avian storage locker.",
      "avianDescription" : "For storing lots of useful items. It looks broken.",
      "floranDescription" : "Ssssstorage.",
      "glitchDescription" : "Indifferent. Avian storage locker.",
      "humanDescription" : "An Avian storage hatch.",
      "hylotlDescription" : "Storage.",
    
      "particleEmitter" : {
        "emissionRate" : 1,
        "pixelOrigin" : [164, 27],
    
        "particle" : {
          "type" : "textured",
          "image" : "/objects/ship/emid.png",
          "size" : 1,
          "color" : [255, 255, 255, 255],
          "fade" : 0.0,
          "initialVelocity" : [0.0, 0],
          "finalVelocity" : [0.0, 0],
          "approach" : [0, 0],
          "timeToLive" : 0.5,
          "layer" : "front",
          "fullbright" : true
        }
      },
    
      "inventoryIcon" : "shiplockericonTier0.png",
      "orientations" : [
        {
          "image" : "avianshiplockerTier0.png:<color>.<frame>",
          "imagePosition" : [-16, -8],
          "frames" : 8,
          "animationCycle" : 1,
          "spaceScan" : 0.1,
          "anchors" : [ "background" ]
        }
      ],
    
      "animation" : "/objects/noisy/noisy.animation",
    
      "scripts" : [
        "/objects/noisy/noisy.lua"
      ],
    
      "sounds" : [ "/sfx/interface/ship_error1.wav" ]
    
    }
    

    In particular there you could look at the "particleEmitter" and see if that functions after adding onto your armor. You can trade out particles, but you see the particle itself is fullbright. Usually "particleEmitter" is found in .animation files rather than .object files, and the animation files usually just reference an external particle file. The point being that there are usually multiple ways to get the same thing accomplished. This object doesn't rely upon an external .particle file but defines everything internally.
    Now a particle(basically your armor overlay image) overlaying the armor could be a solution if not an optimal one.

    I believe you can do the same with .animation files like so.
    Code:
    "animationCustom" : {
      //place what would be in the animation here
    }
    
    I think that's actually intended to put over-rides or additions to what is in your .animation file already. But does this apply? I dunno. Try adding an animation file to the armor and see.

    Code:
    "animation" : "/path/file.animation",
    "animationParts" : {
      "chest" : "chest.png",
      "chest_FB" : "chest_FB.png"
    },
    "animationPosition" : [0, 0]
    
    What of that will actually work in armor, I think you'll have to experiment with.
     
  5. EmissaryOfInfinity

    EmissaryOfInfinity Astral Cartographer

    Yeah, sorry for the off-topic, but I figured it might be convenient to keep things to a single thread. I'll have to try those methods on the armor once I get back from vacation, and see if I can get that fullbright idea working on my projectiles too. Thanks for the help, as always.
     

Share This Page