[INACTIVE][MECH]NpcSpirit v1.11 - Block based NPC system[cb617]

Discussion in 'Inactive/Unsupported Plugins' started by acegiak, Mar 6, 2011.

  1. Offline

    acegiak

    NpcSpirit: Npc Souls are stored in blocks!
    Version: 1.13

    The point of NpcSpirit is to create an Npc system that will tie in well with world economies and player constructed environments, rather than having them be an administrated constant. A certain kind of block (sponge by default but editable in config) is denoted as containing the souls of NPCs. When this is placed, it spawns an npc and will continue to do so when the npc is killed. Admins or the Npc's owner may change the npc's name(and associated skin pulled from minecraft.net), equipped item, greetings, threats and conversation.

    Requires permissions & sqlite.

    This is based heavily on Redecouverte's NpcSpawner lib which is craftbukkitbased, not bukkit based. So it may become unstable/stop working if craftbukkit changes the way it processes HumanEntities too much. But that's what we get for making plugins for in development software.

    Lastly, the ultimate goal of this plugin is to have a player scriptable AI system, so that players can have armies of Npcs battling each other or tilling their fields etc, provided they have the capital to invest in such extravagances.

    JAR:
    http://www.machinespirit.net/ace/minecraft/NpcSpirit.jar

    Commands:
    Place a sponge block to start spawning an NPC there. (they need headroom)
    while targeting the soulblock for the npc:
    /npcs rename [NEWNAME] - renames/reskins the npc on next respawn
    /npcs givethis - changes the NPC's held item to the player's held item on next respawn
    /npcs respawn - kills and respawns the npc
    /npcs sethi [TEXT] - adds a greeting to the npc
    /npcs delhi [KEYWORD] - removes all greetings with the keyword
    /npcs setow [TEXT] - adds a thread (damage message) to the npc
    /npcs delow [KEYWORD] - removes all threats with the keyword
    /npcs setclick [TEXT] - adds a chat phrase (said when right clicked) to the npc
    /npcs delclick [KEYWORD] - removes all chat phrases with the keyword

    Config:
    First load up will generate the file plugins/NpcSpirit/global.yml .
    To change what kind of block acts as NPC spawner, just change the property "npcblocktype" to the decimal ID of the block you want to use. For example, to use a LapisLazuli Block set it to:
    Code:
    npcblocktype: 22
    skins are set by the name of the npc. These are pulled from minecraft.net. there ia no way for bukkit or it's plugins to change that link. Names = skins. You have been told.

    Permissions:
    npcspirit.admin - grants the right to F with everyones npcs, not just your own.

    Todo:
    • Persistence
    • Config File
    • Pathfinding
    • Scriptable AI system:
    changelog:
    1.13
    Updated for build 617, may have broken persistence saving.
    1.12
    Added debug methods to answer "why aren't they spawning?"
    1.11
    moved NpcSpirit.db into it's plugin folder to conform with standards.
    1.1
    Added config file to change blocktype
    1.0
    Added sqlite persistence!
    0.75
    Npcs now spawn anywhere there is space for them up to 10 blocks above their spawner.
    Made npcs despawn when their block gets changed by other mods.
    0.7
    Added respawn command to remedy pvp issue found by Wulfspider
    0.6
    Fixed a few bugs that popped up when updating to 493, including constructor troubles.
    0.5.1
    Gave admins power over other people's soulblocks
    0.5
    Added remove ability to chat lines
    0.4
    Added chat customisation and held item customisation.
    0.3
    Added skin changing & owner recognition over multiple logins
    0.2.1
    Created soulmanager to make main class less bloated
    0.2
    Associated NPC souls with blocks
    0.1
    Got Redecouverte's library working
     
  2. Offline

    acegiak

    @Jendon23 the reason I'm using the block spawned system like this is that I could put sponge/whatever in the global shop for my server and have it be exorbitantly priced. But I might add the option for sign based spawners later as it's not a bad idea.
     
  3. Offline

    Riot

    Pretty great. However:
    @acegiak
    • Npc spawns right above the sponge.
    • No pathfinding (Keep at it :-] )
    • No random spawn location
    This plugin has great potential! Keep coding!
     
  4. Offline

    acegiak

    @Riot thanks for the encouragement! I'll be working on this project again on Monday. Also, are you aware that you can place the sponge under a hard block and the npc will spawn onto of the hard block?
     
  5. Offline

    Swoosh Bear

    Does this plugin require Persistance? Because I installed it, it loaded up fine, and when I place a sponge, it says its fine, but it won't spawn any NPC's.

    I have npcspirit.admin set to my permissions, btw. When i place a sponge it says:
    Code:
    Swoosh_Bear placed a new spawner at location{world=CraftWorld{name=world}x=337.0y=81.0z=-31.0pitch=0.0yaw=0.0}
    updating the npcspirit db
     
  6. Offline

    acegiak

    @swoosh bear , this doesn't require persistence, it uses sqlite to do that. Can you try using the old non-persistent debug version http://machinespirit.net/ace/minecraft/NpcSpirit0.75.jar
    And then post the output debug spam when you place a sponge block?
    Also what version of craftbukkit are you using? And what plugins?
     
  7. Offline

    Jendon23

    aw! I was a troll! I didn't read the full topic and I thought when you said "npc's" you meant blocks with dialogue. If it's alright with you I think I'm just gonna try to make the sign faced people into my own plugin.....it can't be that hard, right? <=P
     
  8. Offline

    GhostToast

    Can someone clarify what type of entity this counts as when it is killed? I'm interested in implementing it with stats and achievements possibly. Would it count as a "Player" kill?
     
  9. Offline

    Jendon23

    Possibly Mob or Monster
     
  10. Offline

    acegiak

    @GhostToast in code you would check for an entity that is a humanentity but isn't a player methinks.

    Also my eclipse has died so it'll be Wednesday night before the next update is out.
     
  11. Offline

    Joe_Young

    I like it, but it could use a lot of improvement
     
  12. Offline

    acegiak

  13. Offline

    GhostToast

    yea not to sound like a flamer but that's a pretty empty critique. providing some useful feedback would benefit everyone, and is the least you could do if you're going to hint that plugin author hasn't done an adequate job.
     
  14. Offline

    Joe_Young

    Well, I mean, where to begin? Most of any suggestions I have are already on your TODO, especially under scripted AI. But if pressed, I have a few....
    * I'd like more control on how quotes from the NPC work. I might want them to be public, or private, but I'd like to customize it more. If you could possibly run it through iChat, even, that would be boss.
    * Having the NPC yell something every single time it got hurt is annoying and counter-intuitive. The way it displays health is atrocious and same as the point above, I'd like to toggle whether it shows help that way at all.
    * Why sponge? Why can't I use any block? Something like pointing the curser at a block, typing "/npcs create [NAME]" to cause that block to begin spawning. You could make that automatically protect the block too. It might be better if blocks were registered somehow too, so you can modify them remotely (in case you can't stick around an hostile NPC)
    * NPC scripting could be rather complicated, but can't you make a few default AIs, at least at the start? The hostile mob, the stand-around-and-pick-your-nose mob, the wandering neutral mob who walks around and attacks if attacked, the helpful npc who follows you and fights mobs, the guard mob who attacks certain users or permission groups (or ignores certain users or groups), and your basic shop NPCs.
    * Customizable item is all well and good, will it affect the NPCs combat abilities? Can it use bows/arrows? Will they be able to wear armor.

    The reason I didn't say anything is because these are pretty much the features most people would want.

    You're a moron. I said "I like it" and the fact it could use improvement was pretty much an agreement to what the OP said. Yes, it was empty, but it's hard to critique until the NPC has a real purpose. I never hinted the author hasn't done an adequate job. I didn't want to nitpick on it because it's so early in development. So please kindly take your foot out of your mouth and stop reading into this so deeply.
     
  15. Offline

    Karinth

    Can you use custom names and skins or does it pull from the Minecraft.net Cloud?
     
  16. Offline

    acegiak

    It's pulled from the username.
     
  17. Offline

    Karinth

    Is there a different way to do it. Using usernames and not being able to create your own is very restricting. I ask because I am trying to make a RP server with NPCS but the default skin wont work in the world.
     
  18. Offline

    acegiak

    Like I've added to the op. No, there isn't it's hardcore into the client. The way to do what you want is to register minecraft.net accounts with the names/skins you want. If you do, please share. One person was kind enough to create an account called Police__Officer (two underscores) I'm thinking about buying "Barman" and maybe some others. I'm also working on a script to probe minecraft.net for all the skins.
     
  19. Offline

    Karinth

    Unfortunately I need, at last count 130 NPC's I cannot afford that many accounts.
     
  20. Offline

    acegiak

    Haha, wow. Unfortunately what you need is then impossible.
     
  21. Offline

    Karinth

    Well, Craftizins allowed what I want but unfortunately I do not know how to move it to bukkit and NO ONE is willing to. I do love your plug in though, I give you major credit.
     
  22. Offline

    Joe_Young

    Yeah, I had to register a lot of 'general name' accounts for a possible rpg server like Elven_Man, but there's quite a few I've gotten.
     
  23. Offline

    Karinth

    Use the Glonick Plugin to change their names to what you need.
     
  24. Offline

    Joe_Young

    It's inactive, and will it even work for NPCs?
     
  25. Offline

    chickenmove

    the npc not comes i set a sponge with nothing over it but it not spawn =(
     
  26. Offline

    acegiak

    Ok guys! Update released!
    FIRSTLY:
    You can now change the blocktype that is used as spawner in the global.yml file that is stored in the NpcSpirit plugin directory! It's a decimal integer, check the first post for more info if you need it.
    SECONDLY:
    The NpcSpirit.db now loads from it's plugin directory rather than from the bukkit root dir. If you upgrade to the new version from an old version all you need to do to keep your old NPCs is move the NpcSpirit.db file from your bukkit root dir to the plugins/NpcSpirit/ folder!
     
  27. Offline

    Solest

    Hi Acegiak!
    First off, brilliant plugin and I've been looking for an up to date NPC addon for quite some time. I consider it a crutch to make iConomy useful...
    But I'm having a few problems with it and I'd appreciate if you could toss me some feedback when you're able. I'll lay them out nice and neat for you :)

    1. The respawn/spawn command will not work. I lay down the sponge block, which is set as the "soul" block, and my server recognizes it being placed. It lists the location and reads "updating the npcspirit db". It even allows me to rename and set all the messages, yet no NPC spawns.
    2. Are there any other plugins that would clash with this not allowing it to spawn? My server does not report any error messages and I have sqlite and permissions installed so the dependencies are there. But I use several others and was thinking that maybe the previous problem could be caused by conflicting addons?
    3. The communication with the NPC is limited to simply destroying and laying down the soul block. It recognizes that I am adding text chat abilities to it and reads that it updates it, however no NPC spawns and there is no interaction of any kind.

    Let me know when you get the chance! I'd love to use your plugin if I could just get these few things resolved.
     
  28. Offline

    Colin Sweneey

    Im having the same issue and im not to sure why please help me out ive tried the debugger and it just repeats that its adding it to the database
    any help would be appreciated thanks and good night
     
  29. Offline

    acegiak

    gonna add some debug lines so we can see what's actually going on here

    Ok update to 1.12 and chuck debug on.

    should get something like this in console when spawning an npc:

    00:50:38 [INFO] One of the npc blocks isCraftBlock{chunk=CraftChunk{x=0z=5}x=11y=68z=83}
    00:50:38 [INFO] Infact, it is in need of spawning now. Let's try:
    00:50:38 [INFO] spawning npc forLocation{world=CraftWorld{name=world}x=11.0y=68.0z=83.0pitch=0.0yaw=0.0}
    00:50:38 [INFO] updating the npcspirit db

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 11, 2016
  30. Offline

    Omniscient

    Hi, I can't get your plugin to work for me.
    I'm using CB 557, and I'm getting a awesome error.
    Something like
    Code:
    java.lang.ClassNotFoundException: org.sqlite.JDBC
    2011-03-21 17:28:08 [SEVERE]     at java.net.URLClassLoader$1.run(Unknown Source)
    2011-03-21 17:28:08 [SEVERE]     at java.security.AccessController.doPrivileged(Native Method)
    2011-03-21 17:28:08 [SEVERE]     at java.net.URLClassLoader.findClass(Unknown Source)
    2011-03-21 17:28:08 [SEVERE]     at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:30)
    2011-03-21 17:28:08 [SEVERE]     at java.lang.ClassLoader.loadClass(Unknown Source)
    2011-03-21 17:28:08 [SEVERE]     at java.lang.ClassLoader.loadClass(Unknown Source)
    2011-03-21 17:28:08 [SEVERE]     at java.lang.Class.forName0(Native Method)
    2011-03-21 17:28:08 [SEVERE]     at java.lang.Class.forName(Unknown Source)
    2011-03-21 17:28:08 [SEVERE]     at acegiak.NpcSpirit.DbMan.loadflats(DbMan.java:10)
    2011-03-21 17:28:08 [SEVERE]     at acegiak.NpcSpirit.NpcSoulManager.fill(NpcSoulManager.java:41)
    2011-03-21 17:28:08 [SEVERE]     at acegiak.NpcSpirit.NpcSoulManager.<init>(NpcSoulManager.java:33)
    2011-03-21 17:28:08 [SEVERE]     at acegiak.NpcSpirit.NpcSpirit.onEnable(NpcSpirit.java:95)
    2011-03-21 17:28:08 [SEVERE]     at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:118)
    2011-03-21 17:28:08 [SEVERE]     at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:451)
    2011-03-21 17:28:08 [SEVERE]     at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:217)
    2011-03-21 17:28:08 [SEVERE]     at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:92)
    2011-03-21 17:28:08 [SEVERE]     at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:70)
    2011-03-21 17:28:08 [SEVERE]     at org.bukkit.craftbukkit.CraftServer.reload(CraftServer.java:260)
    2011-03-21 17:28:08 [SEVERE]     at org.bukkit.command.SimpleCommandMap$ReloadCommand.execute(SimpleCommandMap.java:196)
    2011-03-21 17:28:08 [SEVERE]     at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:80)
    2011-03-21 17:28:08 [SEVERE]     at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:221)
    2011-03-21 17:28:08 [SEVERE]     at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:380)
    2011-03-21 17:28:08 [SEVERE]     at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:366)
    2011-03-21 17:28:08 [SEVERE]     at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
    2011-03-21 17:28:08 [SEVERE]     at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    2011-03-21 17:28:08 [INFO] Reload complete.
    2011-03-21 17:28:47 [INFO] GroupManager - INFO - Scheduled Data Saving is set for every 10 minutes!
    2011-03-21 17:28:47 [INFO] GroupManager version 1.0(alpha-2) is enabled!
    2011-03-21 17:28:47 [INFO] NpcSpirit version 1.12 enabled.
    2011-03-21 17:28:47 [INFO] NpcSpirit version 1.12not enabled. Permissions not detected
    2011-03-21 17:28:47 [INFO] NpcSpirit version 1.12 disabled.
    2011-03-21 17:28:47 [SEVERE] loader constraint violation: when resolving method "acegiak.NpcSpirit.NpcSoulManager.<init>(Lacegiak/NpcSpirit/NpcSpirit;)V" the class loader (instance of org/bukkit/plugin/java/PluginClassLoader) of the current class, acegiak/NpcSpirit/NpcSpirit, and the class loader (instance of org/bukkit/plugin/java/PluginClassLoader) for resolved class, acegiak/NpcSpirit/NpcSoulManager, have different Class objects for the type acegiak/NpcSpirit/NpcSpirit used in the signature loading NpcSpirit v1.12 (Is it up to date?)
    java.lang.LinkageError: loader constraint violation: when resolving method "acegiak.NpcSpirit.NpcSoulManager.<init>(Lacegiak/NpcSpirit/NpcSpirit;)V" the class loader (instance of org/bukkit/plugin/java/PluginClassLoader) of the current class, acegiak/NpcSpirit/NpcSpirit, and the class loader (instance of org/bukkit/plugin/java/PluginClassLoader) for resolved class, acegiak/NpcSpirit/NpcSoulManager, have different Class objects for the type acegiak/NpcSpirit/NpcSpirit used in the signature
        at acegiak.NpcSpirit.NpcSpirit.onEnable(NpcSpirit.java:95)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:118)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:451)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:217)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:92)
        at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:70)
        at org.bukkit.craftbukkit.CraftServer.reload(CraftServer.java:260)
        at org.bukkit.command.SimpleCommandMap$ReloadCommand.execute(SimpleCommandMap.java:196)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:80)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:221)
        at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:380)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:366)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    2011-03-21 17:28:47 [INFO] Reload complete.
    2011-03-21 17:32:56 [INFO] GroupManager - INFO - Scheduled Data Saving is disabled!
    2011-03-21 17:32:56 [INFO] GroupManager version 1.0(alpha-2) is disabled!
    2011-03-21 17:32:56 [SEVERE] Could not load plugins\Permissions.jar in plugins: null
    org.bukkit.plugin.InvalidPluginException
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:113)
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:159)
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:107)
        at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:61)
        at org.bukkit.craftbukkit.CraftServer.reload(CraftServer.java:260)
        at org.bukkit.command.SimpleCommandMap$ReloadCommand.execute(SimpleCommandMap.java:196)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:80)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:221)
        at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:380)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:366)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:109)
        ... 11 more
    Caused by: java.lang.NullPointerException
        at com.nijikokun.bukkit.Permissions.Permissions.<init>(Permissions.java:77)
        ... 16 more
    I'm guessing the problem lies with Permissions, since the error contains: Caused by: java.lang.NullPointerException
    at com.nijikokun.bukkit.Permissions.Permissions.<init>(Permissions.java:77)
    ... 16 more.
    Hope you can help me.
     
  31. Offline

    Solest

    Thanks for the reply and update Ace :) Updated and turned debugger on and here's the new list of errors I'm receiving. Caused by "PythonInterpreter".

    15:00:51 [INFO] Solest placed a new spawner at Location{world=CraftWorld{name=So
    ciety}x=183.0y=68.0z=314.0pitch=0.0yaw=0.0}
    15:00:51 [SEVERE] Could not pass event BLOCK_PLACED to NpcSpirit
    java.lang.NoClassDefFoundError: org/python/util/PythonInterpreter
    at acegiak.NpcSpirit.JythonFactory.getJythonObject(JythonFactory.java:21)
    at acegiak.NpcSpirit.NpcBrain.loadMind(NpcBrain.java:198)
    at acegiak.NpcSpirit.NpcBrain.<init>(NpcBrain.java:28)
    at acegiak.NpcSpirit.NpcSoul.<init>(NpcSoul.java:55)
    at acegiak.NpcSpirit.NpcSoulManager.createSoul(NpcSoulManager.java:68)
    at acegiak.NpcSpirit.NpcSBlockListener.onBlockPlace(NpcSBlockListener.java:19)
    at org.bukkit.plugin.java.JavaPluginLoader$21.execute(JavaPluginLoader.java:264)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:255)
    at net.minecraft.server.ItemBlock.a(ItemBlock.java:107)
    at net.minecraft.server.ItemStack.a(ItemStack.java:56)
    at net.minecraft.server.ItemInWorldManager.a(ItemInWorldManager.java:160)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:495)
    at net.minecraft.server.Packet15Place.a(SourceFile:57)
    at net.minecraft.server.NetworkManager.a(SourceFile:230)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:76)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:357)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Caused by: java.lang.ClassNotFoundException: org.python.util.PythonInterpreter
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:30)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 20 more
     

Share This Page