[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

    nathanaelps

    Right. Say 'buy' or 'sell' to the NPC, and an interface (like the interface for chests, but NPC specific) pops up. Economic magic happens when you close the interface.

    Lol, exactly the same place I'm in. Good to know nolimit, though. Does that allow for only certain *items* to be nolimit (i.e., the aforementioned glass) or does it make *all* items to be nolimit? I mean, I don't care if NPCarl sells a million stacks of cobblestone, but I don't want him to be able to sell more green discs than he buys.

    (Because I've been jabbing a fork into the MySQL DB, I'll say this...) I suppose itemized nolimits would logically be in the merchant_entries table, but all the columns in merchant_entries are unsigned ints. Quite functional, yes, for the basics. But what if we were to change the amount field to a signed int, allowing -1 to be 'infinite'? And, while we're at it, change the buyprice and the sellprice to decimal(10,2) or even get carried away and change the prices to decimal(10,8) (if iConomy permits).

    Though, I suppose the previous paragraph may become completely moot when the wiz brings the Slegehammer of Fixing to bear on the inner workings.

    Edit- I read this after I posted and *dang* I sound like a pompous windbag. Sorry about that. Wiz, whatever you choose to do is great. If I don't like it, then I can just sit down, learn java, discover extra hours in my day, fork it, and create a monstrosity. And I don't see that happening anytime soon. So, instead, I'll just say 'thanks' for what you're doing. -N
     
  3. Offline

    wizjany

    To be honest, I have no clue what to do with the database. All of persistence is a bit muddly right now, and I don't have much experience with using it. My biggest problem is being able to store lots of different kinds of data using just strings and ints and so on.
     
  4. Offline

    angel0fmars

    I've tried this on my server and it works great. One problem though with merchants: they can list the items they're selling and you can sell those items to them, but you can't buy things from them. You end up putting the command in chat for everyone to see and wonder what the heck you're doing. Any help?
     
  5. Offline

    wizjany

    What exactly are you typing?
     
  6. Offline

    angel0fmars

    I made an NPC that sells wooden logs (item ID 17). I type "buy 17 2" and I end up typing in chat so that everyone can see. Selling and list work perfectly fine though. I'll post a screenshot when I have time.
     
  7. Offline

    PsychoNecrosis

    Use the item name. Item numbers are no longer highlighted in pink, meaning they no longer trigger the npc.

    I literally just tested this. Running RB766
     
  8. Offline

    angel0fmars

    I tried putting in "buy log 2" but I still end up posting that on chat. What are you typing?

    EDIT: Just now realized there was an error in the server console. Here it is:

    [SEVERE] Could not pass event PLAYER_CHAT to npcx
    java.lang.NoClassDefFoundError: com/iConomy/iConomy
    at net.gamerservices.npcx.myPlayer.getPlayerBalance(Unknown Source)
    at net.gamerservices.npcx.myNPC.parseMerchant(Unknown Source)
    at net.gamerservices.npcx.myNPC.onPlayerChat(Unknown Source)
    at net.gamerservices.npcx.npcxPListener.onPlayerChat(Unknown Source)
    at org.bukkit.plugin.java.JavaPluginLoader$6.execute(JavaPluginLoader.java:236)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:257)
    at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:646)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:634)
    at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:32)
    at net.minecraft.server.NetworkManager.a(NetworkManager.java:195)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:74)
    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)
     
  9. Offline

    wizjany

    read first post
     
  10. Offline

    angel0fmars

    Ah, sorry, I did not read it carefully. Thank you!
     
  11. Offline

    deianthropus

    That's what I meant... I hope that the rewrite intrinsically fixes it. i'll let you know.

    I have to voice my disapproval of decimal prices. Plugins must be fast. And Java is by nature a slow language.

    EDIT: Also working on a PHP frontend to my own standards. maybe i'll release it if it stands up to any other... but i really won't get going on it until the [first stable] rewrite release.

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

    wizjany

    Sucks for you.
    That could take a while as far as database stuff is concerned.
     
  13. Offline

    deianthropus

    how many NPCs do you want to run on YOUR server?

    Hrm. You do the Java, i'll take care of the SQL. :p
     
  14. Offline

    wizjany

    If you think using doubles instead of ints for prices will slow it down that much, fork it and change it yourself.
    Actually I get to do loads of SQL too.
     
  15. Offline

    nathanaelps

    Ooh. I'm not a professional with MySQL and I have no idea how to make Java do jack, but--like I said--I've been poking a fork in it recently. Maybe I'll give it a look.

    *check out github, look at java source*

    Holy crap. I have NO idea what I'm looking at. I mean, I've got some idea how to use MySQL (especially in the world of PHP) but apparently either I don't know how to use github (likely) or Java is completely unlike ANYTHING I'VE EVER SEEN. Doubtful, but I suppose in the universe there are such things.

    Though, I think Deianthropus and myself are both willing to help brainstorm the SQL, and I know that I'm willing to help think about the entire experience as well. I'm going to bed now, though. I'll deal with thinking about it tomorrow.
     
  16. Offline

    wizjany

    You're probably looking at mixxit's code. I have no clue what I'm looking at either.
     
  17. Offline

    cyberjacob

    I tried to create a spawn group. I got
    Code:
    22:20:44 [WARNING] npcx: error: null[Ljava.lang.StackTraceElement;@eb706d
    22:20:44 [SEVERE] java.lang.NullPointerException
    22:20:44 [SEVERE]       at net.gamerservices.npcx.npcx.onCommand(Unknown Source)
    22:20:44 [SEVERE]       at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
    22:20:44 [SEVERE]       at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:97)
    22:20:44 [SEVERE]       at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:278)
    22:20:44 [SEVERE]       at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:701)
    22:20:44 [SEVERE]       at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:666)
    22:20:44 [SEVERE]       at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:660)
    22:20:44 [SEVERE]       at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:32)
    22:20:44 [SEVERE]       at net.minecraft.server.NetworkManager.a(NetworkManager.java:196)
    22:20:44 [SEVERE]       at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
    22:20:44 [SEVERE]       at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    22:20:44 [SEVERE]       at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:377)
    22:20:44 [SEVERE]       at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:292)
    22:20:44 [SEVERE]       at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    
     
  18. Offline

    Nitnelave

    It's pretty useless to post errors now, as it is still mixxit's code, and he is completely re-writing it. You can post errors once he releases his own version of the plugin, but I don't think he will provide support for a soon-to-be outdated plugin that is not even his own...
     
  19. Offline

    wizjany

    most likely bad syntax
     
  20. Offline

    Atticus Craft

    I rofl'd
     
  21. Offline

    Ovelha

    Hey, everytime i try to add a npc to the spawn group, it says "An error ocurred" ....

    Someone help me?
     
  22. Offline

    keithhhhhh

    can this program be used to spawn mobs in certain areas, that would normally have light from torches or something? im planning on making a area that will spawn mobs, like an ambush but i dont want creepers as it would ruin the area but i dont want to disable the creepers explosion
     
  23. Offline

    Nitnelave

    Well that, my friend, is not at all relevant to this plugin. It is used to spawn HUMAN mobs, that have interactions, and everything... As for a mob spawning area, either you get worldGuard, or another protection plugin that can disable creeper spawning in an area, and you make your mobs spawn in a always-dark place, linked to your arena, or killing-mobs zone; or the other solution is a plugin request... but remember that mobs burn in sunlight!
     
  24. Offline

    sansprenom

    Since the mysql installation is still not working, i want to try it on another pc. Has it any effects, if i do it on another pc than the one i use to configure the server?
     
  25. Offline

    PsychoNecrosis

    As long as you point the plugin to the correct address that MYSQL is installed at, it should be fine.
    Might produce a MYSQL setup guide soon.
     
  26. Offline

    sansprenom

    This is the fact i dont understand. The Mysql Database will be installed on a personal computer, but the server is set on a ... server. So if I turn off my pc, how is the plugin able to connect with mysql?
     
  27. Offline

    PsychoNecrosis

  28. Offline

    sansprenom

    so npcs do not work if my pc is disconnected?
     
  29. Offline

    PsychoNecrosis

    If the server can't see the database, the plugin won't work.

    Thus, if it's not always online, the plugin will stop working
     
  30. Offline

    sansprenom

    so for what reason i install it on my pc?
     
  31. Offline

    PsychoNecrosis

    I have no idea. I assumed you were running the server on the same machine.
     

Share This Page