[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

    QQCucumber

    Nice! I'll let my players play with this soon. Any plans on incorporating a trading system that uses iConomy, or perhaps making it so the npc created uses a monster? Like creepers and whatnot?
     
  3. Offline

    Wulfspider

    Welp, none of the commands seem to work for me very well. I looked at the soulblock and attempted to rename, and it said the name was changed, but I can't seem to destroy the NPC so that it can change it's name.

    Also, depending on what item you have in hand and if you left-click or right-click, it displays the name differently in chat. Such as peon(10), peon(19), or just peon.
     
  4. Offline

    acegiak

    Wulfspider, do you have pvp disabled? I have it enabled but it occurs to me that one might not be able to kill their npcs to rename them if they can't be hurt. I'll fix that with a /kill command now. Also the health only displays for damage events, because I found it distracting for chat/greetings. Should I make it display for all messages?

    I should work out how to do the healthy chat display.

    ok update coming in ~ 15 mins
    --- merged: Mar 6, 2011 10:56 AM ---
    Fixed! thanks for finding that @Wulfspider
     
  5. Offline

    Wulfspider

    @acegiak , I didn't know what the numbers were for, but they didn't seem to be changing often if any... I'll have to test it more later. I do have PvP enabled too. I tried outside of Towny limits and inside, both resulting in the same. If it had some way of showing the health bar from the 2.x iChat, that would be neat as I think Healthy is depreciated. I prefer to not have any < or [ around my user names/players chat too fyi.
     
  6. Offline

    NEO

    This looks very interesting.

    So npcs that spawn basically function as mods? Or do they stand in one place and stare?
     
  7. Offline

    Wulfspider

    @NEO , they stand on a sponge and stare at you and say stuff when you attack or right-click them. OP is saying that there will be more functions later hopefully though that would involved more than staring. :p
     
  8. Offline

    acegiak

    @NEO , for the moment they stand in one spot and respond to being hit/right clicked. I'm working on the ability to write AI scripts for them though, giving them instructions.
    @Wulfspider , :confused: might you have a plugin that is cancelling the entitydamage event? Cause that's what I'm catching. Because the library makes npc damage only seem to happen once, I catch the event, apply the damage myself and cancel the event so that the npc doesn't bug up and not receive further damage events.
    Also did the /npcs respawn command work for you?
     
  9. Offline

    Wulfspider

    @acegiak , that's what I'm unsure of. I will have to remove my plugins and try. I don't see what would be affecting them though as I can normally damage any other player as long as they are not a resident of my Towny town and within it's limits. I haven't tested the respawn command yet either as I am in bed and should be asleep! I'll have to look into it in a few hours.
     
  10. Offline

    Rauchi85

    Hy .
    When I start the Minecraft Server whit your Plugin he say :NpcSpirit version 0.7not enabled. Permissions not detected.

    What i have do to ?

    Mfg
     
  11. Offline

    acegiak

    @Rauchi85 , have you got the permissions plugin installed? NpcSpirit won't run without it.
     
  12. Offline

    Rauchi85

    Ah sry no , where i become it ?
    --- merged: Mar 6, 2011 12:05 PM ---
    I have it, Thxs for the Help and good Luck white the AI ;)
     
    lopee50 likes this.
  13. Offline

    QQCucumber

    Why not just make Persistence a dependency instead of making your own? I'm pretty sure NathanWolf did intend on that, granted it's a bit broken right now but it'll be fixed here soon.
     
  14. Offline

    acegiak

    yeah I've pretty much just gotta work out how to hook into persistence and then I'll probably do that.
     
  15. Offline

    Adamadz

    I have the plugin, but the only problem is only the rename, giveitem and kill re spawn work non overs like text ones work.
     
  16. Offline

    acegiak

    sorry @Adamadz I don't quit understand what you're saying there. Can you rephrase your problem for me?
     
  17. Offline

    Adamadz

    Ok sorry.
    Everything works like actually making the NPC.
    These are the thing what work:

    /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

    However no overs work and no errors come up when try the overs either.
     
  18. Offline

    contex

    I'm posting here as I did on the other NPC plugin, do you know if there is anyway to change the skin of the NPC by for example setting a new parameter in the properties called skinurl? And then just upload skins to your website or something, how does the skin get chosen in the NPC lib?
     
  19. Offline

    acegiak

    @Adamadz after trying repeatedly to decipher your message I have no idea what you mean by over. Do you mean like the text overlay? I worked out that the reason only those commands are working for you is because I'm an idiot and listed the others as /npcs addhi, /npcs addow and /npcs addclick when the commands are actually /npcs sethi, /ncps setow and /npcs setclick. I've now updated the first post.

    @contex The npcspawnerlib from what I've seen poking through the code works by mimicing a player entity of sorts, the skin is actually set by the minecraft client and pulled based on what the server says the name of the "player" (in this case the npc) is. One suggestion in the npcspawnerlib thread was that we all pitch in to buy some really common npc names and give them appropriate skins as player accounts for minecraft.net I know the person who suggested it was really awesome and straight up bought Police__Officer(yes two underscores) so that people could use it in their games with these sorts of mods.
     
  20. Offline

    Adamadz

    Yeah that's what i ment by "overs" i ment over commands.
    Thanks for fixing :)
     
  21. Offline

    contex

    Thank you alot for the quick answer :)
     
  22. Offline

    acegiak

    I still have no idea what an over command is. :confused:
    --- merged: Mar 6, 2011 2:03 PM ---
    WAIT, you mean OTHER commands! Just read it aloud to a friend to help me work it out.
    hahaha! Talk about a cautionary tale in spelling and grammar!
    I'm so sorry for not getting that sooner.
     
  23. Offline

    Adamadz

    Sorry for asking all the questions, However i find that restarting the server actually removes the NPC's and i have no idea how to give them a skin.

    Thanks :)

    P.S.
    Yes sorry i ment other :L stupid me!
     
  24. Offline

    Sol

    Hey this is great :D

    I was wondering if there was some possibility of being able to hide the sponge block? Being able to bury it just 1m under the ground would be ideal, if there is some way to make it happen? :/

    Thanks in advance! I look forward to the scripting and AI additions. I will have some convincing guide-bots should this work! :D

    ~Sol
     
  25. Offline

    Adamadz

    I found that if use WorldEdit on the block and change it, the NPC still stays.
     
  26. Offline

    Sol

    Does the NPC also still respawn? If so this could be useful indeed... I could even use something like "ControllerBlock" to hide them :D

    ~Sol
     
  27. Offline

    acegiak

    @Adamadz yeah, when you restart the server is removes all the npcs. Persistence ( to fix this) is the top of my todo list. Also good bugfind with worldedit, I've patched that up now in 0.75

    @Sol : feature now in place, anything up to 10 blocks up is now valid spawn range.
     
  28. Offline

    Wulfspider

    @acegiak , the NPC entities do not get removed when you replace the block with air using a plugin such as BlockPaint. The NPC is not actually functional, but they still show in the world.

    Also back to the point I made earlier, that if I hit them with different things... such as air and a sword, I get different results for health? 10 for a sword, 19 for hand/air. That is what the health is right? I thought that was what you meant earlier.
    zwy7p.png

    When you said "anything up to 10 blocks up is now valid spawn range", what does that mean? I've tried placing the NPC sponge under blocks to hide it like what Sol said, but it doesn't spawn with anything filling the 2 blocks directly above it.
     
  29. Offline

    Sol

    Wow awesome :D

    One other thing I noticed... not sure particularly what it is related to, but if any "guests" (using the GuestPrev plugin, and Permissions) kill the NPC, he refuses to respawn unless the sponge is destroyed and replaced.

    I assume this is related somehow to the way GuestPrev and/or permissions works? :confused:

    ~Sol
     
  30. Offline

    Futil

    Any progress on making it save npcs?
     

Share This Page