[FUN/MECH] npcx (v0.0.31) - The NPC eXtender (now for 1.8.1) [1097-1157]

Discussion in 'Inactive/Unsupported Plugins' started by wizjany, May 9, 2011.

  1. Offline

    wizjany

    npcx - The NPC eXtender
    Version: 0.0.31

    UPDATE: mixxit has took the initiative to update the npclib to 1.8, all credit for this update goes to him! it should work on any 1.8 version of craftbukkit

    If you are having trouble, please read the old thread here and the included readme.txt that mixxit left. If you know of any other tutorials, do post and I'll add them.

    Info Update: Well long story short I am beginning to get bored of Minecraft and I don't have as much time as I would like to develop this plugin. This probably means that the rewrite I had planned is just going to die. Besides lack of time and motivation, I find it extremely pointless to write an API for NPCs outside of bukkit/craftbukkit, which makes the rewrite I was working on very frustrating. However, I will continue to update mixxit's code for new versions of minecraft, but don't expect any new features or anything.
    Update 2: As NPCs are being planned natively for 1.8 (the adventure update), I will probably be working on a (separate) plugin or directly with the NPC API if I have time.

    Note: If you have iConomy, make sure you have at least version 5+ or you'll get an error like this.
    Code:
    [SEVERE] Could not pass event WHATEVER_EVENT to npcx
    java.lang.NoClassDefFoundError: com/iConomy/iConomy
    You should also be able to add "use-iConomy=false" in the npcx properties file.

    If you're having trouble installing MySql on windows, here's a nice guide: http://forums.bukkit.org/posts/293544, thanks to Atticus Craft. Basic WAMP/LAMP/MAMP servers should work fine too, just make sure you have the username/password correct and the database with permissions to the right user.

    Features:
    • You can create npcs
    • And they do stuff
    • Everything should work like it did in mixxit's last version
    And by "work like it did" I mean I have no clue if there were bugs from then, but they're probably still around now. Please report any you find so I can take them into consideration.

    For MC 1.8.1 (1097+, no RB yet) Download
    For MC 1.7 (937+, 953, 1k): Download
    For MC 1.6 (807+): Download
    For MC 1.5 (740-803): Download
    Source Code

    Changelog:
    Version 0.0.31
    • Updated to MC 1.8.1 (by Mixxit)
    Version 0.0.3
    • Updated for Grum's internal renaming
    Version 0.0.2
    • Updated for 1.6
    Version 0.0.1
    • Updated for 1.5
    • Began code revamp
    All credits go to mixxit for his work. Special thanks to sk89q and fullwall, even if they don't know they helped.
     
    wassilij, Zoaen, nathanaelps and 2 others like this.
  2. Offline

    Zerco

    Yes, the first NPCX had this problem keep your names to 15 or less just to be safe.

    Also works like a charm, cheers. :D
     
  3. Offline

    PsychoNecrosis

    Odd, my npcx was loading fine with long names.
    Let's log in to the database and test this though. I'll edit with results :)

    Edit

    @Zerco
    Seems to have fixed it, thanks!
     
  4. Offline

    sansprenom

    As I said a few posts before, it does not work. Ifollowed the README of mixxit, but apperently couldn`t get along with it. So maybe someone is able to make a detailed tutorial ;) The video tutorial does not use MySQL Workbench, so it doesn't helped me so much ;)
     
  5. Offline

    Hawtin

    Hi,

    how can I create path exactly?

    /npcx pathgroup add 1 1 does not work?

    thx
     
  6. Offline

    Flenix


    I just started getting this. seems to be tempermental, someone else was getting it this morning...

    Funny thing is, I'd only just wiped the NPCX library (must have been from ages ago as it was always there) so we had no NPCs loaded... but it has worked since that wipe.
     
  7. Offline

    Smurphy88x

    You sir are an excellent man! =D

    I am migrating over to this thread now!

    If you need/want any help on this task, I am at your disposal! =)

    @wizjany
    Hi dude! First off congrats on getting it working! :D
    Secondly, I would like to offer my help on this one. I have substantial experience with java coding, but unfortunately not with plugins for minecraft. However I was looking through the code and trying to get the old npcx.jar mixxit left us with fixed, so I have some idea of how his coding is layed out.
    If you have any sections of coding you would like worked on but don't have the time/motivation to do them yourself, just let me know! =) PM me if you would like a hand with anything in this plugin. Like everyone else here, I would really like to see it fully functional, and would love to offer a hand to get that done.
    Cheers,
    Smurphy88x

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 16, 2016
  8. Offline

    PsychoNecrosis

    @wizjany

    I'd start looking at the event listeners as a matter of priority, a lot of those will have changed from the older builds, and I know the chat listeners and iConomy hooks are going to be throwing lots of console errors.

    Also, it'd be nice to know what causes the exponentially growing lag from having too many npcs together. - I mean, a set amount of lag I can understand, but the delay getting longer and longer doesn't make sense to me.
     
  9. Offline

    Ann

    A couple things I have noticed. I'm still using the previous version of Iconomy and so far every thing is working fine. I have noticed It you use essentials and create nick names it seems to cause some permission problems. Before adding the new jar I took the old one out and reran the server. Previously on other applications not removing the old jar caused some errors. I know previously you had to be a OP to run this plug in I would guess that still is the case. I'm also running a performance tweek plug in that seems to have helped the lag when using npcx
     
  10. Offline

    Smurphy88x

    I've been using the fixed version by wizjany to quickly figure out what was working and what wasn't. On my server, all of the commands work, except for the civ commands which wizjany already said he was not supporting (I agree with this decision frankly).
    I wanted to find out about the lag issue first hand, so I made 30 spawngroups 30 pathgroups (attached to those spawngroups), and 10 different npcs attached to 3 spawngroups each. The pathgroups consisted of 10 different nodes. Personally, I experienced no lag whatsoever, I run the server on my own computer with a few close friends connecting via hamachi. I don't know if bigger servers would be different, but with 6 of us on at once, I checked the bandwidth usage and asked them to let me know if they experienced any lag. None of them experienced any lag whatsoever, and the bandwidth consumption rate of the server did not appear to increase by any noticable degree.
    How many NPCs are you creating, and when you say exponential delay, do you mean per NPC or per game clock tick?
    Also, I tried iConomy, and didn't run into any errors. I don't use iConomy though, so I just tried a few simple commands, but they worked fine. With the chat listeners, are you referring to the ones involving the right-clicked npcs? Or to the chat listeners for npcx commands? As far as I know all of the npcx commands are functioning just as well as before beta 1.5
    The event listeners will need looking into I agree. Personally the npc movement and patrol pathing are what is bugging me the most right now. npcs don't seem know how to go around blocks, that are too tall for them, and they don't move like normal players/mobs.
    @wizjany
    What I'd like to see fixed first and foremost personally are the npc movement and patrol pathing issues. If you like, I can look into these:
    Right now, the npcs take short steps with delays in-between. I don't know why mixxit made them move this way, or if it was even his intention, but I think it needs to be changed.
    When heading to a patrol point, the npcs will get 'stuck' behind blocks which are 2 above the current block they are standing on. This is a simple pathing issue, which I am sure could be easily fixed.
    Npcs don't move like normal mobs and players, in that they don't jump, but simply walk up blocks like they are walking up a slope. They can actually walk up 2 high blocks sometimes and get stuck (they don't walk off '2-high' edges, which is probably a good thing, and I think should be left like that). I personally think this kind of movement looks ugly, and it also probably ties in with the pathing issues. I'd be willing to look into mob movement to fix this.
    So yeah, I don't know what you have planned right now, but if you would like a hand, I'll be happy to help out where I can. If you're not already working on it, I'd like to take a stab at the pathing/movement issues.
    Cheers,
    Smurphy88x

    Oh, and a couple more things related to pathing I forgot to mention. mixxit has gone for an exact coordinate system for paths and npc spawnpoints. I don't think the npcx mod needs this kind of accuracy in spawn point placement and npc patrol paths. npc spawn points and patrol paths would be better off simply on the top surface of a block in the centre of that surface IMO. Also, the npcs will move anywhere within a 3 block diameter of a patrol path, which I think limits the usefulness of patrol paths. I think it would be better off to either have a new chat command to configure the diameter of a patrol point, or (for now atleast) it would probably be better to simply make each patrol point consist of a single point on the top surface of a block in the centre of that surface.
    Again, I'd be happy to work out the kinks and give it a crack myself, what do you think?

    Heres how it works as an example:
    ----------------------------------------------------
    /npcx pathgroup create examplepathgroup
    - pathgroup is created with a unique ID (lets say 1 for this example)
    /npcx pathgroup add 1 1 pathgrouplocation1
    - pathgrouplocation1 is added to pathgroup 1 as the 1st location on the path (examplepathgroup)
    /npcx pathgroup add 1 2 pathgrouplocation2
    -pathgrouplocation2 is added to pathgorup 1 as the 2nd location on the path
    ------------------------------------------------
    Continue this way to add as many pathgroup locations as you want, and the npcs will follow (as best they can) in a continuous circuit.
    NOTE: The path location name is all you are missing in that command. It can be whatever you like, but try to keep it shorter then 15 characters and don't include any spaces or special characters.
    WARNING: Pathgroups don't work very well right now, npcs get stuck and move strangely. Make sure there are no obstacles on a 3 block wide path between each path location for your npcs if you want them to move without getting stuck (this includes from the final path location to the first path location).

    They're in mixxits readme, but I think I might simply quote it here:
    -----------------------------------------------------------
    All of the following commands will list syntax to more subcommands:
    /npcx spawngroup
    /npcx npc
    /npcx pathgroup
    /npcx loottable
    /npcx faction
    /npcx merchant
    -----------------------------------------------------------
    I would list all of the sub-commands, but frankly theres a lot to type out, and its easy enough for people to do it themselves in-game. If you use these commands then have trouble with any of the subcommands, I'm pretty familiar with the syntax so feel free to ask me AFTER trying to figure it out yourself.

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

    Taylor179

    is 1.5 gigs enough ram?
     
  12. Offline

    Hawtin

    Thx works :)
     
  13. Offline

    LucidLethargy

    This begs a fairly good question... it is said these npc's "are seen by the server as players", does this simply mean it will keep chunks loaded, and that those of us on limited vps's should restrict them to certain areas, or will they really raise our player limit somehow?

    I have 900mb's of ram with my server, and we only have 5 people or so online at any given spike right now, so i'm wondering if this plugin might potentially impact us. It's so amazing i'll be at least adding one of these in, but I wanted to check in case someone was nice enough to help out with an answer!
     
  14. Offline

    wizjany

    Yea I had this problem too, I also manually edited my database. I didn't feel like making it truncate old names because it was 2:30 am.

    They're considered human entities, which are pretty much players, but not quite. Also they shouldn't keep chunks loaded (at least, they weren't loading chunks when i started up my server without a real player nearby).

    @Smurphy88x @PsychoNecrosis thanks for helping out in the thread, gone for one day and so many replies :p
    If you want to help out coding, the best way to contact me is probably in irc. wizjany on esper, I idle in #npcx and a bunch of other channels. I'm not sure how much doing stuff right now will help as I'm planning on starting from (almost) scratch.
     
  15. Offline

    Flenix

    Question: Are the chat settings working alright? I've tried setting up an NPC to have a conversation with using the "/npcx npc triggerword add NPCID(number) wordtorespondon responsegoeshereandcan" command, and it says its added. I then right click the NPC and it says I'm talking to them. I type my first word, but they don't respond.

    Same thing with using triggers, I tried to set one up that would attack a player who came near (to work as a guard) - again, it did nothing.

    Also while i'm posting, you know how you can add an NPC to a Faction - is there any way to specify standard players to the same faction, and as such it would only attack "enemy" players? I couldn't find it in the ReadMe anywhere
     
  16. Offline

    PsychoNecrosis

    The chat event listener doesn't seem to be working.

    @Smurphy88x

    First off, you should edit and not multipost, lest an angry mod come down on your head :p

    As for the rest of your stuff, it might be easier to come to my server and have a look - I'll PM you the address if you're up for that.
     
  17. Offline

    wizjany

    The chat and the special triggerwords are working fine for me...can you give me any more info? eg other plugins, craftbukkit version, etc
     
  18. Offline

    getpaperboyd

    hey whenever i try to spawn an npc /npcx npc create [name]. i get a message 'An error occured' any help?
     
  19. Offline

    EggRoll

    /me noms wizjany
     
  20. Offline

    Flenix

    cb 740

    Plugins:

    Code:
    Aimcannon
    Arrowwall
    AssignPermissions
    BigBrother
    BlockCantKeepUpSpam
    Blueprint
    CopyCat
    Cabinet
    Clothcolour
    CommandIConomy
    ControllerBlock
    CookieMonster
    CraftBukkitUpToDate
    dynmap
    Elevators
    Essentials
    EssentialsChat
    FalseBookBlock
    FalseBookExtra
    FalseBookIC
    FireLord
    GoldenSprint
    iChat
    iConomy
    iConomyChestShop
    Landmarks
    LWC
    Minecart Mania (all 8)
    MobRider
    MonsterTamer
    MoveCraft
    MultiVerse
    NeoMeteorites
    NoCheat
    npcx
    Permissions
    PermissionsSupport
    Persistence
    RealTools
    SimpleBarter
    SimpleSave
    Spells
    Sploderrows
    Sprint
    SpyerAdmin
    SpyerFun
    Stargate
    Towny
    Wandmin
    Whitelist
    WorldEdit
    WorldGuard
    Zeus
    Sorry for the list...

    Back up and delete everything to do with NPCX, then stick a fresh download of the .jar file on. Worked for me
     
  21. Offline

    wizjany

    Fuuuuuuuuuuuuu
    Try disabling iChat, it might be conflicting with chat.
     
  22. Offline

    darkm3tr01d

    Got it up and running no problems.
    Are you planing on continuing to add to this plugin?
    If so what is the best way to propose ideas?
     
  23. Offline

    Kazeron

    Dude you are SO freaking awsome. I have wanted this back so bad and was crushed when it fell off the forms. The only thing is you have got to get a link up for commands, I don't know where it went but the old commands list may still bearound somewhere. would be awsome. I would just send them to you but my server hard drive took a serious crash shortly after 1.5 came out and I lost all my links and .pdfs with all the commands to the plugs I use.
     
  24. Offline

    wizjany

    I was not aware of a list, however there are a few in this thread already and there's the readme that has a bunch of commands explained.

    Um, haven't gotten around to setting up anything really, but you can use the github issue tracker for now. And yea I'm planning on making this much more efficient and extensible and then add new npc types and stuff.
     
  25. Offline

    Izbay

    Thank you soooo much for continuing this! I've been wanting to use it to make boss monsters in my dungeons forever! I'm running into an issue with aggro, though. T_T

    Code:
    I've set up a faction with -5000 base amount, but even though I added an NPC to the
    faction... he just stares at me doing nothing.  No errors or anything.  CB 740 and a hefty
    plugin list
    
    citizens
    cookbook
    essentials
    fencestack
    herochat
    iconomy
    itemdetector
    lwc
    magiccarpet
    mcmmo
    npcx
     permissions
     portecoulissante
    propertime
     puzzlequest
    realshop
    redstonechips
    redstonemobspawn
    retractablebridge
    runecraft
    sortal
    spyeradmin
    towny
    treeassist
    uquest
    uquesttracker
    worldedit
    worldguard
    
    (Sorry for the mess.  Trying to conserve space!)
    
    Edit:  I'm also getting an error spam when I attack NPCs.  I'm not sure how iConomy factors into
    npc aggro :S
    
    
    00:45:05 [SEVERE] Could not pass event ENTITY_DAMAGE to npcx
    java.lang.NoClassDefFoundError: com/iConomy/iConomy
            at net.gamerservices.npcx.myPlayer.getPlayerBalance(Unknown Source)
            at net.gamerservices.npcx.myNPC.variablise(Unknown Source)
            at net.gamerservices.npcx.myNPC.onPlayerAggroChange(Unknown Source)
            at net.gamerservices.npclibfork.BasicHumanNpc.onDamage(Unknown Source)
            at net.gamerservices.npcx.npcxEListener.onEntityDamage(Unknown Source)
            at org.bukkit.plugin.java.JavaPluginLoader$42.execute(JavaPluginLoader.j
    ava:458)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:59)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:257)
            at net.minecraft.server.EntityHuman.d(EntityHuman.java:522)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:776)
            at net.minecraft.server.Packet7UseEntity.a(SourceFile:33)
            at net.minecraft.server.NetworkManager.a(NetworkManager.java:195)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:73)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:370)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:285)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    Caused by: java.lang.ClassNotFoundException: com.iConomy.iConomy
            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:36)
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:24)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            ... 17 more
     
  26. Offline

    wizjany

    Hm, factions definitely working for me (I also just found out that they go past god mode, I assume the npc doesn't actually damage the player, but just swings its arms and damage is dealt)
    Make sure that everything is connected with the right IDs? And if all else fails, try with the event_close triggerword.

    Edit: well if you're editing, guess I will too
    Make sure you're running iConomy 5.x, the API changed between 4.x and 5.x and I've only compiled on 5 (damn plugins changing their API -_-) Also yea, i have no clue how iconomy factors into npc aggro, that's another thing going with code rewrites
     
  27. Offline

    Izbay

    Thanks for the response! I've been putting off the upgrade to 5.x... so I guess I'll get around to that once and for all. Thanks again! ^_^

    Edit: and I'll edit later if that solves it :] ... edit
     
  28. Offline

    Yggy

    Hmmm... if they just swing their arms and damage is dealt, that needs to be taken care of. The damage should come from the NPC itself, not from a routine that deals direct-damage. Not sure how that would affect mcMMO or some of the health mods that are floating around, as it would seem to be a cause of some issues. Unless that's how Minecraft enemies deal damage, period.
     
  29. Offline

    radur

    You still need mySQL?
     
  30. Offline

    Flenix

    Just throwing out an idea of why iConomy might be linked to aggro;
    Maybe the original dev was going to set up a money drop system, so killing the specified NPC would give you X coins? maybe if multiple people killed it, it would split/give to the one who did most damage, which would be why it was triggering while just attacking anot quite killing.
     
  31. Offline

    fragen

    I get the following error whenever I execute a command
    Code:
    2011-05-12 12:29:01 [WARNING] npcx: error: null[Ljava.lang.StackTraceElement;@1735b26
    2011-05-12 12:29:01 [SEVERE] java.lang.NullPointerException
    2011-05-12 12:29:01 [SEVERE]     at net.gamerservices.npcx.npcx.onCommand(Unknown Source)
    2011-05-12 12:29:01 [SEVERE]     at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
    2011-05-12 12:29:01 [SEVERE]     at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:85)
    2011-05-12 12:29:01 [SEVERE]     at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:255)
    2011-05-12 12:29:01 [SEVERE]     at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:677)
    2011-05-12 12:29:01 [SEVERE]     at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:640)
    2011-05-12 12:29:01 [SEVERE]     at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:634)
    2011-05-12 12:29:01 [SEVERE]     at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:32)
    2011-05-12 12:29:01 [SEVERE]     at net.minecraft.server.NetworkManager.a(NetworkManager.java:195)
    2011-05-12 12:29:01 [SEVERE]     at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:74)
    2011-05-12 12:29:01 [SEVERE]     at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    2011-05-12 12:29:01 [SEVERE]     at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:370)
    2011-05-12 12:29:01 [SEVERE]     at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:285)
    2011-05-12 12:29:01 [SEVERE]     at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
     

Share This Page