Modding Help Custom npc holding weapon

Discussion in 'Starbound Modding' started by Dekadrachm, Mar 20, 2017.

  1. Dekadrachm

    Dekadrachm Heliosphere

    Hello, I noticed that NPCs like the penguin mercenaries hold weapons, how could I do this for a normal human NPC?
     
  2. bk3k

    bk3k Oxygen Tank

    Well guards hold weapons as well. I'm going to guess.
    1. Their equipment includes the weapon of course
    2. Holding the weapon is defined as part of their behavior.

    Behaviors are not something I've looked at enough to be useful. If I had, I'd like to revive "Enemies aren't stupid". Or if you study up on them, maybe you can.

    I'd also like musician NPCs that walk around carrying their instrument. But I don't know how/if they can actually play them. Playing is probably too hard coded to do. But it would add a lot of environment to go into a glitch village and hear a musician playing robotic medieval tunes etc. "Listen to the song of my people" etc. At the very least, if you can make a different background tune play once you enter a village. Can that be tied to dungeons? I don't know dungeons/tiled enough to have the answer.
     
    Dekadrachm likes this.
  3. MetaFace

    MetaFace Guest

    Actually (deleted my post from earlier), the items held is defined in the npctype file located in npcs folder. Here is an example of guard default equipment
    Code:
    "items" : {
        "default" : [
          [0, [
              {
                "head" : [ { "name" : "humantier1head" } ],
                "chest" : [ { "name" : "humantier1chest" } ],
                "legs" : [ { "name" : "humantier1pants" } ],
                "primary" : [
                  "npcpistol",
                  "npcmachinepistol",
                  "npcassaultrifle"
                ],
                "sheathedprimary" : [ "npcbroadsword" ]
              }
            ] ]
        ]
     
    IHart likes this.
  4. Dekadrachm

    Dekadrachm Heliosphere

    Well, that was surprisingly easy.
     
    MetaFace likes this.
  5. MetaFace

    MetaFace Guest

    Glad that helped.
     
  6. Dekadrachm

    Dekadrachm Heliosphere

    Well, I gotta test it first, it interests me that the weapons are defined with NPC in front of them. Would that disable custom weapons unless I were to edit some file defining what NPC weapons actually are?

    Now if only you could answer my more complex problem I posted about lol
     
    Last edited by a moderator: Mar 20, 2017
  7. MetaFace

    MetaFace Guest

    Those are actual weapons in game, located in "items\active\weapons\npc" in your unpacked assets. (this means you could use any weapon defined in any mod)

    And which problem would that be?
     
  8. Dekadrachm

    Dekadrachm Heliosphere

Share This Page