Modding Help world.spawnNPC Parameters

Discussion in 'Starbound Modding' started by Mirau, Sep 1, 2016.

  1. Mirau

    Mirau Pangalactic Porcupine

    Hey all, so I'm basically trying to convert some of my custom NPCs that I made in an instance world back in beta just into a LUA command so I can have some interesting characters on my ship.

    Code:
    world.spawnNpc(tech.aimPosition(), "human", "villager", 1, 0, {items={ default = [ [0, [{back = [ { name = "hunterback" } ]}]]]}})
    I tried with ='s, with :'s, with parameters in quotes and not in quotes and a whole consortium of variations.

    I basically tried to go with the same setup I used to convert JSON item parameters into LUA, like this:
    Code:
    world.spawnItem("secretnote", mcontroller.position(), 1,
            {
            description = "^gray;Hey a custom note.^reset;",
            shortdescription = "^gray;A neato custom note!^reset;"
            }
            )
    Anybody know the correct syntax for the parameters? I would greatly appreciate it.
     

Share This Page