Spawn a NPC w/ Name you choose

Discussion in 'Plugin Suggestions' started by Sgt.Soldier, Mar 15, 2012.

  1. Sgt.Soldier New Member

    Is it possible to make a plugin that enables to spawn a guide with whatever name you choose example:
    /spawnnpc "22" "Ryan"
    Then it would spawn the guide with the name Ryan.
    It would be a really cool plugin but is it possible to make?
  2. Olink TShock Developer

    the names are hard coded into the terrara spawn code, so no, its not possible without adding the support in the server code.
  3. Sgt.Soldier New Member

    Would it be possible to have the plugin add the support automatically into the server code? Or still impossible?
  4. Olink TShock Developer

    you dont understand the difference between a plugin, and the server...le sigh
  5. Snirk Immington TShock Plugin Developer

    Yea, the plugin adds to terrariaserver.exe, that "TShockAPI" adds to the server.
    They can work ahead of the server, like choosing if you can destroy a tile (region protect), but they can't change the fundamentals, like the names or types of mobs I guess. Could you write something that kills a guide every time he spawns until you get the right name? ;p
  6. WhiskeyD Member

    Plugin would require a list of all possible names for that NPC, otherwise player could set off an infinite loop of guide spawn/slay.
    Snirk Immington likes this.
  7. Snirk Immington TShock Plugin Developer

    Sounds like a good way to spam the chat :p
    Here is how TShock spawns monsters: (taken from source for command /king)
    Code:
    TSPlayer.Server.SpawnNPC(king.type, king.name, amount, args.Player.TileX, args.Player.TileY);
    The parenthesis are arguments: the type (NPC ID), amount (here "amount" is player-specified), NPC name ...and two numbers that keep it spawned onscreen.
    The "NPC name" is just a source code thing, I believe an item in a list of spawned monsters.
  8. Karisma New Member

    Snirk Immington likes this.

Share This Page