Custom NPCs

    Doomsider

    Server scriptologist
    Joined
    Jan 21, 2013
    Messages
    215
    Reaction score
    43
    Anyone interested in making custom NPCs for various fun? If so I would like to get a team of people together to make some to spice things up.
     

    Kojinus

    Feline Overlord
    Joined
    Oct 14, 2014
    Messages
    62
    Reaction score
    22
    • Purchased!
    What goes into making said NPCs? 'Cause it sounds like it'd be fun. :)
     

    Doomsider

    Server scriptologist
    Joined
    Jan 21, 2013
    Messages
    215
    Reaction score
    43
    That is a good question, from what I can see so far is this

    /StarMade/data/script

    Which contains all the scripts for NPCs

    Also we have the following admin commands
    creature_animation_start
    DESCRIPTION: forces an animation for a creature
    PARAMETERS: Animation(String), LoopMode(String), Speed(Float), FullBody(Boolean)
    EXAMPLE: /creature_animation_start TALK_SALUTE loop/dont_loop 1 true/false

    creature_animation_stop
    DESCRIPTION: stops the forced animation
    PARAMETERS:
    EXAMPLE: /creature_animation_stop

    creature_enter_gravity
    DESCRIPTION: debug for gravity on AI creature
    PARAMETERS:
    EXAMPLE: /creature_enter_gravity

    creature_goto
    DESCRIPTION: order selected to go to
    PARAMETERS:
    EXAMPLE: /creature_goto

    creature_rename
    DESCRIPTION: Renames the selected creature or AI character
    PARAMETERS: Name(String)
    EXAMPLE: /creature_rename ACreature

    creature_roam
    DESCRIPTION: makes the select one roam in a small space
    PARAMETERS:
    EXAMPLE: /creature_roam

    creature_script
    DESCRIPTION: sets the creature to a script in /data/scripts/
    PARAMETERS: Script(String)
    EXAMPLE: /creature_script MyScript.lua

    spawn_creature
    DESCRIPTION: (debug)
    PARAMETERS:
    EXAMPLE: /spawn_creature

    spawn_creature_mass
    DESCRIPTION: (debug)
    PARAMETERS: amount(Integer)
    EXAMPLE: /spawn_creature_mass 2

    A quick test in the client confirms that creatures can be spawned easily.
     

    Kojinus

    Feline Overlord
    Joined
    Oct 14, 2014
    Messages
    62
    Reaction score
    22
    • Purchased!
    Hmm, so you'd need to basically write a new script for the creature_script with whatever behavior you'd want the NPC to have? On top of having a model for it and what not.
     

    Doomsider

    Server scriptologist
    Joined
    Jan 21, 2013
    Messages
    215
    Reaction score
    43
    Yes that is what I am thinking, spawn the creature and set it to the script. I am doing some research but I am not seeing a way to set the model though.
     

    Kojinus

    Feline Overlord
    Joined
    Oct 14, 2014
    Messages
    62
    Reaction score
    22
    • Purchased!
    Well considering there's only like 2 models in the game at the moment it's probably hard coded I would think. When you spawn something in game using all the defaults what does it spawn?
     

    Doomsider

    Server scriptologist
    Joined
    Jan 21, 2013
    Messages
    215
    Reaction score
    43
    Just another silly astronaut ofc, If we can't change the model it loads then all we can do is create custom NPC scripts. That is still cool, but not nearly as neat as being able to spawn unique models for a variety of space creatures
     

    Kojinus

    Feline Overlord
    Joined
    Oct 14, 2014
    Messages
    62
    Reaction score
    22
    • Purchased!
    Hmm, looking through some of the scripts I don't see a way to define the model using those. Looks like we'd be stuck with the default astronaut.

    I'm not very knowledgeable with LUA, so if I was gonna help write any scripts I'd have to figure out what I was doing first but it still seems like this'd be fun to do. :)
     

    Doomsider

    Server scriptologist
    Joined
    Jan 21, 2013
    Messages
    215
    Reaction score
    43
    I can definitely capture things the NPC or player says to trigger events as well so not just limited to what the LUA script can do.
     
    Joined
    Dec 8, 2014
    Messages
    226
    Reaction score
    52
    • Purchased!
    • Legacy Citizen 4
    this should be a feature.

    I would love to see, different npc factions having different skins. Like being able to make a rebels faction, and an empire faction, and seeing the mobs fight it out in space and on planets.