Modding Help Request for a NPC creation tutorial

Discussion in 'Starbound Modding' started by haynesy566, Jun 5, 2015.

  1. haynesy566

    haynesy566 Heliosphere

    Hi community

    If there are any modders out there who know how to create fully functioning NPC's could they create a tutorial thread for it please? I need one for an upcoming mod...
     
    Kayuko likes this.
  2. I can... but too busy to do so. There's a few threads that I've responded to that go extensively over creating NPCs... sadly my phone is not allowing me to search through my posts. Search this forum with my name as the poster and you should run into them.
     
    Kayuko and haynesy566 like this.
  3. haynesy566

    haynesy566 Heliosphere

    Thanks a heap!
     
  4. Murlaine

    Murlaine Scruffy Nerf-Herder

    The | Suit and haynesy566 like this.
  5. RiNickolous

    RiNickolous Void-Bound Voyager

    [​IMG]

    I need a little help with this. I'm assuming you're the creator of this mod, Murlaine, but if you're not, please point me in the general direction of the creator.

    I'm trying to make an npc with specific looks (that of my character) and after tinkering with the mod for a few hours, I finally thought to mess around with this number (74741) in the blink.lua file.
    Upon changing the number, I managed to spawn a vastly different npc. Of course, this npc's look was the same for each copy I spawned.

    The problem I'm having is this: I have no idea how this number works. I've adjusted it by 1, or by 1000. It seems to make no sense.
    Do you know how to adjust this to suit my needs?
     
  6. Peelz

    Peelz Giant Laser Beams

    http://doc.playstarbound.com/stable...lbacks.html#a7ad1bb26e760f3610d848e2864e20c4f

    As the above documentation notes, the number you are changing is the seed that is used for selecting random NPC characteristics. If you use the same seed you will get the same random characteristics every time, but a different seed will give you a new set of random characteristics - which is why you saw such a drastic difference when you changed the seed value. Unfortunately I don't think there is currently a way to manually choose the specifics of an npc's appearance such as gender/ hair color/ etc. I could be wrong though... the devs have been making a lot of changes recently.
     
  7. RiNickolous

    RiNickolous Void-Bound Voyager

    Thanks for the info. I'm not very good at modding, so please excuse me if I'm asking nooby questions, but if the direct editing of the seed isn't possible yet, is there a way to read the seed of the player? Does it use the same system, allowing us to read and copy the seed of the player entity to create an npc identical to the player?
     
  8. Kayuko

    Kayuko Oxygen Tank

    Just dumped my playerfile to Json to find out (yeah, curious).
    Result: There is no such value as a "seed", the looks are handled in another way in there.

    //depending on what you need the npc for there might be a way, tho.
     
  9. RiNickolous

    RiNickolous Void-Bound Voyager

    How so? I just need the entity to be idle, and behave like a normal villager, which it already does. Just need to get it to look like my character.

    Character in question, if needed to anyone:
    [​IMG]

    Also, JSON file of the character, also in case it's needed:
    https://www.mediafire.com/?0te8pbmo3pz44p8
     
  10. Peelz

    Peelz Giant Laser Beams

    Your character will not have a seed value because none of your character's attributes are randomly generated.

    Computers rarely generate TRULY random numbers. They typically use a predefined algorithm to generate numbers that only SEEM to be random to human eyes. You can tell that this is the case here because when you have the computer generate an npc with "random" attributes, it will generate the same npc every time UNLESS you change the seed value. A seed value is fed into a random number generator and tells it HOW to generate those random numbers. You could think of it as a starting point of sorts. You can read more about this here:
    https://en.wikipedia.org/wiki/Pseudorandom_number_generator

    Anyway, what I'm trying to say is that the only way currently to generate an NPC that looks identical to your character is to try plugging in different seed values into your spawnNpc function until you get lucky and happen to generate one that looks like you. That could take forever though. I -think- the devs are working on giving modders more control over npc's but @Kawa would know more.
     
    Kayuko likes this.
  11. RiNickolous

    RiNickolous Void-Bound Voyager

    So, the solution is to wait until Chucklefish change this. Seems fine to me.
     
  12. Kawa

    Kawa Tiy's Beard

    Here I come to document how to save the daaaaaay!

    npctypes/kawa.npctype:
    Code:
    {
        "type" : "kawa",
        "npcname" : "Kawa",
        "identity" : {
            "imagePath" : "felin",
            "personalityIdle" : "idle.2",
            "personalityArmIdle" : "idle.1",
            "personalityHeadOffset" : [0, 0],
            "emoteDirectives" : "?replace;a85636=625244;6f2919=4e3b2e;e0975c=836752;ffca8a=998779?replace;951500=4e3b2e;be1b00=625244;dc1f00=836752;f32200=998779",
            "hairDirectives" : "?replace;735e3a=2d1606;d9c189=7d3c1c;a38d59=4d240b;f7e7b2=914b35",
            "hairType" : "male4",
            "gender" : "female",
            "bodyDirectives" : "?replace;a85636=625244;6f2919=4e3b2e;e0975c=836752;ffca8a=998779?replace;951500=4e3b2e;be1b00=625244;dc1f00=836752;f32200=998779"
        },
        //The rest as before, eventually getting to the items key, specifying what to wear. If you give only one option...
    }
    You can glean directives and personalities from decoded player files and such. Note that I have no idea which versions of SB support this. Stable probably doesn't, in which case identity and npcname will be ignored and it'll randomize as usual.
     
    RiNickolous likes this.
  13. RiNickolous

    RiNickolous Void-Bound Voyager

    Oh my goodness, thank you so much for this. In the meantime, I found a much worse solution. In the human.species file, which is in the NPC store mod linked above, deleting and replacing all hair and skin with just one combination also does the trick. However, it also makes it impossible to create a human character with different attributes than those chosen.

    I now see that the issue I've been having is caused entirely by syntax in the NPC spawning tech (modified blink tech) file.

    I'll modify the NPCs when I next have access to a computer, but hey, results!


    [​IMG]
     
    Last edited: Jun 14, 2015
  14. Kawa

    Kawa Tiy's Beard

    Here's a thing: if you look in your .player file, basically anything in the identity key can be used in an npctype. Also, npctypes and species can have customized, personal humanoid.config files. Nuru and the outpost penguin use this.
     
    Kayuko likes this.
  15. RiNickolous

    RiNickolous Void-Bound Voyager

    Do you know if and how this would work on an npc that isn't a specific npc type?

    I'm trying to spawn in npc's using this mod:

    https://www.dropbox.com/s/cau3m6l2u52e4xo/Sample NPC Store.zip?dl=0

    and the thing I was having trouble with was the hair/body/emote/personality parameters. As stated above, the deletion of every other option in the human.species file works, but it also disables customization of new humans while the mod is enabled.

    My goal is being able to use this mod, and specifically the targetblink.tech file within it, to completely control the looks of the npc, without adding any assets, such as new npctypes.

    Also, I don't see any sort of 'identity' tag within any of the .npctype files. Are you sure this is transferable?
     
  16. Kawa

    Kawa Tiy's Beard

    You can't do it without adding new npctypes, I'm afraid. But I'm sure if you did add new npctypes, it'd work since I successfully did it myself five times over ;)

    Assuming your SB supports them in the first place but we covered that already.
     
  17. RiNickolous

    RiNickolous Void-Bound Voyager

    I'm calling it quits on making a tutorial. I certainly do not have the required knowledge to teach others about this.

    Good luck with npcs and stuff, y'all.
     
  18. SpotBrony

    SpotBrony Big Damn Hero

    I'm surprised this hasn't been updated since 2015. I'm having the similar issue, but not tutorials, trying to create custom crew.
    It worked but now I'm having trouble understanding RNG for seeds. My other characters may or may not have one but I'll check, but in the meantime I need help changing their personality.
     

Share This Page