Custom NPC's

    Joined
    Jan 25, 2014
    Messages
    386
    Reaction score
    27
    • Legacy Citizen
    • Legacy Citizen 2
    Would it be possible for you guys to put theses things in jar files (or something else) that will put the scripts in the correct files?
    Edit: Spelling
     
    Joined
    Jan 4, 2015
    Messages
    28
    Reaction score
    5
    • Legacy Citizen 2
    Sounds very exciting! If you can get this mod to work, it would heavily expand Starmade, and make the game more interesting.
     
    Joined
    Jun 29, 2013
    Messages
    144
    Reaction score
    64
    • Modder
    • Legacy Citizen 4
    • Purchased!
    hey there, i've some functions to add to your list for npc coding ;)

    JavaScript:
    String getConverationPartnerAffinity()
    return ship or object affiliation
    return "none" if there's no affiliation​


    JavaScript:
    String getConverationPartnerFactionName()
    return faction name
    return "neutral" for fid = 0
    return "unknown" for fid = null​


    JavaScript:
    String getConverationPartnerOwnerName()
    return player owner name or "none"​


    JavaScript:
    String getOwnName()
    return NPC's name​


    JavaScript:
    String getConverationParterName()
    return NPC's name​


    JavaScript:
    String getScriptName()
    return script name​


    JavaScript:
    String getConversationState()
    return state or "none"​


    JavaScript:
    boolean isConverationPartnerInTeam()
    return true or false​


    JavaScript:
    boolean isAtBlock(int x, int y, int z)
    test if NPC is at x,y,z
    return true or false​


    JavaScript:
    int setConversationState(String paramString)
    change conversation state
    return 0
    return -1 on error​


    JavaScript:
    int giveType(short type, int count)
    give block id
    return 0
    return -1 on error​


    JavaScript:
    int giveGravity(boolean paramBoolean)
    enable/disable gravity for player
    return 0 on disabled
    return 1 on enabled
    return -1 on error​


    JavaScript:
    int destroyShip(String entityName)
    destroy entity with name entityName
    return 1
    return -1 on error​


    JavaScript:
    int callTutorial(String folderName)
    call the tutorial inside */StarMade/data/tutorial/folderName
    return 0​


    JavaScript:
    int moveTo(int x, int y, int z)
    move NPC to x,y,z
    return -1​


    JavaScript:
    int giveBuildProhibiter(int credits)
    give buil prohibiter for defined amount of credits
    return 0 no error
    return -1 not enought credits
    return -2 inventory full​


    JavaScript:
    int giveFlashLight(int credits)
    give flashlight for defined amount of credits
    return 0 no error
    return -1 not enought credits
    return -2 inventory full​


    JavaScript:
    int giveGrappleBeam(int credits)
    give grapple beam for defined amount of credits
    return 0 no error
    return -1 not enought credits
    return -2 inventory full​


    JavaScript:
    int giveHealingBeam(int credits)
    give healing beam for defined amount of credits
    return 0 no error
    return -1 not enought credits
    return -2 inventory full​


    JavaScript:
    int giveHelmet(int credits)
    give helmet for defined amount of credits
    return 0 no error
    return -1 not enought credits
    return -2 inventory full​


    JavaScript:
    int giveLaserWeapon(int credits)
    give laser weapon for defined amount of credits
    return 0 no error
    return -1 not enought credits
    return -2 inventory full​


    JavaScript:
    int giveMarkerBeam(int credits)
    give marker beam for defined amount of credits
    return 0 no error
    return -1 not enought credits
    return -2 inventory full​


    JavaScript:
    int givePowerSupplyBeam(int credits)
    give power supply beam for defined amount of credits
    return 0 no error
    return -1 not enought credits
    return -2 inventory full​


    JavaScript:
    int giveRocketLauncher(int credits)
    give Rocket launcher for defined amount of credits
    return 0 no error
    return -1 not enought credits
    return -2 inventory full​


    JavaScript:
    int giveLaserWeapon(int credits)
    give laser weapon for defined amount of credits
    return 0 no error
    return -1 not enought credits
    return -2 inventory full​


    JavaScript:
    int giveSniperRifle(int credits)
    give sniper rifle for defined amount of credits
    return 0 no error
    return -1 not enought credits
    return -2 inventory full​


    JavaScript:
    int giveTorchBeam(int credits)
    give torch beam for defined amount of credits
    return 0 no error
    return -1 not enought credits
    return -2 inventory full​


    JavaScript:
    int giveTransporterMarkerBeam(int credits)
    give transporter marker beam for defined amount of credits
    return 0 no error
    return -1 not enought credits
    return -2 inventory full​


    JavaScript:
    int spawnCrew(int credits)
    spawn a new crew member for amount of credits
    return 0 no error
    return -1 not enought credits
    return -2 player has 5 cew member​


    JavaScript:
    int unhireConverationPartner()
    unhire NPC
    return 0
    return -1 if NPC isn't in team​


    JavaScript:
    int hireConverationPartner()
    hire NPC
    return 0
    return -2 if player already has 5 crew member
    return -3 if player has a diffrent faction id​


    JavaScript:
    int activateBlock(int x, int y, int z, boolean paramBoolean)
    enable/desable block at x,y,z
    return 0 on disabled
    return 1 on enabled
    return -1 on error​


    JavaScript:
    int activateBlockSwitch(int x, int y, int z)
    toggle activation block at x,y,z
    return 0
    return -1 on error​