[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

    Exone

    Can't get it to spawn anything at all.
    No errors or anything, and all commands seem to work. Just that there's never a NPC spawning :S
     
  3. Offline

    lokiman72

    can you make them NOT be deleted by the server crashing?
     
  4. Offline

    acegiak

    @Wulfspider , ok what's your craftbukkit version and full plugin list?
    @Exone , the same, what's your craftbukkit version and full plugin list?
     
  5. Offline

    Wulfspider

    @acegiak , I am running CraftBukkit 493. My plugin list is in the spoiler below. I forgot to give it a test without plugins, I'll have to do that in a bit.
    Show Spoiler
    Achievements.jar
    AnjoSecurity.jar
    AutoPlant.jar
    AutoReplace.jar
    Bacon.jar
    BigCatch.jar
    BlockPaint.jar
    BukkitUpdater.jar
    Citizens.jar
    CommandHelper.jar
    CommandSigns.jar
    CookieMonster.jar
    CraftBook.jar
    CraftBookCircuits.jar
    CraftBookMechanisms.jar
    CraftBookVehicles.jar
    DynMap.jar
    Essentials.jar
    EssentialsGod.jar
    EssentialsSpawn.jar
    EssentialsUpdate.jar
    FakePermissions.jar
    FenceDoor.jar
    GroupManager.jar
    Help.jar
    IceDrop.jar
    iChat.jar
    iConomy.jar
    InventoryProtection.jar
    InventorySort.jar
    ItemId.jar
    Lampstone.jar
    LocalShops.jar
    LWC.jar
    MagicCarpet.jar
    mcMMO.jar
    MCTelnet.jar
    MobileAdmin.jar
    MobRider.jar
    MoveCraft.jar
    MultiVerse.jar
    MyHome.jar
    MyWarp.jar
    OChestDump.jar
    PaintingSwitch.jar
    properTime.jar
    Quickbelt.jar
    RegexFilter.jar
    SendGift.jar
    SignColours.jar
    Snowballz.jar
    Stats.jar
    TelePlus.jar
    Tombstone.jar
    TorchBurn.jar
    Towny.jar
    War.jar
    WorldEdit.jar
     
  6. Offline

    contex

    Would it be possible to call the NPC something else and just give it a new setting called "sourceName", meaning the name of the player which has the skin you want.
    So for example player "HerpDerp" has a skin that looks like Hitler. I type /npc create Hitler HerpDerp (/npc create <NPCname> <PlayerName>) ?
     
  7. Offline

    acegiak

    @contex, no
    to all the people who keep asking about skin stuff: no
    The server only gets to pass the name of the entity to the client, it has no say whatsoever in skins. The client is the one that chooses the skin based on the name, if you change the name, the client will choose the skin of the new name. There is nothing craftbukkit can do to get around this. If you want a custom skin for your npc name, buy the account and give it the skin.

    ps if you do do this, please do post the account name in here so we can all benefit


    EDIT: It would be possible to have a different name displayed in chat, but that would be confusing not matching up to the name above their heads.
     
  8. Offline

    woodzy

    i cant get my dam NPC to spawn but everything else seems to work just find i dont get it
    craftbukkit 493
    plugins are
    commandsigns---------- YES
    controllerblock------- REMOVED
    craftbook------------- YES
    craftbookstuff-------- YES
    craftbookstuff2------- REMOVED
    creaturesbox---------- REMOVED
    fencestack------------ REMOVED
    infchests------------- REMOVED
    isee------------------ YES
    izone----------------- REMOVED
    logblock-------------- YES
    lwc------------------- YES
    musiccraft------------ REMOVED
    prefixer-------------- YES
    pvp------------------- YES
    redstinechips--------- REMOVED
    redstoneplugin-------- REMOVED
    sendgift-------------- REMOVED
    towny----------------- REMOVED
    vanish---------------- YES
    vplayersonline-------- YES
    worldedit------------- YES
    wormholeXtream-------- REMOVED
    chatbukkit0.1--------- REMOVED
    scrapbukkit----------- REMOVED
    Multi Homes----------- YES
    Plgsetspawn----------- YES
    StarGate-------------- YES
    VStopfire------------- YES
     
  9. Offline

    Exone

    git-Bukkit-0.0.0-470-g8642b13-b452jnks
    AccessBook.jar
    BigCatch.jar
    BorderGuardLite.jar
    dynmap.jar
    Essentials.jar EssentialsBan.jar EssentialsSpawn.jar EssentialsTele.jar
    Factions.jar
    iChat.jar
    iConomy.jar
    iSee.jar
    mcbans.jar
    MinecartManiaCore.jar
    MobRider.jar
    MultiVerse.jar
    MyHome.jar
    MyWarp.jar
    Permissions.jar
    PumpkinDiver.jar
    WorldEdit.jar
    WorldGuard.jar

    NPCs doesn't spawn anything, but all commands seem to 'work' (I get response)
     
  10. Offline

    tha d0ctor

    I found that you have to view the NPC and the block at a certain angle (above and to the center of the spong through the shoulder) to get it to register your blocks. What about saving to a flat file or something, I added a lot of text events before I realized this didn't save :/
     
  11. Offline

    acegiak

    Ok guys who aren't getting spawns, this: http://www.machinespirit.net/ace/minecraft/NpcSpiritSpawnDebug.jar should start putting spam in your console every few seconds about attempting to spawn npcs (once you've placed a sponge block) can you try that out and tell me what it says?
    --- merged: Mar 7, 2011 12:32 PM ---
    Just a heads up, It's now 11pm here. I've set aside all of tomorrow to dedicate to persistence, I said I'd have it working by the time wednesday rolled around and I'll meet that deadline.
     
  12. Offline

    Neko22

    Hey acegiak,
    Sounds like an interesting plugin. I was just wondering if your future plans include being able to create NPC Guards that would attack nearby mobs and/or players (depending on an AI script) for example?
     
  13. Offline

    acegiak

    @Neko22 that is exactly the kind of thing ai scripting would allow for.
     
  14. Offline

    NoSDuDe

    Very nice plugin thx :)

    I found a bug on my server that issue a total server crash.
    It happens when using Npcs with Izone.

    How to do it :
    You protect a zone
    You add those flags to the zone : Protection, High Protection, Monster Free
    A player without rights in this zone tries to place a sponge.
    And then the server goes on severe exception and dies in a painfull noise. :)

    Versions :
    git-Bukkit-0.0.0-493-g8b5496e-b493jnks
    iZone 5.1

    If you don't do that, evrything works nice except some NPC that disapear and only sponge blocks are left.

    Good work anyway :)
     
  15. Offline

    acegiak

    @NoSDuDe ooh! Sounds like a good crash! Can you post me the log of the severe exception?
     
  16. Offline

    woodzy

    OK, so i downloaded the plugin today again to do the debug for you, and i tryed it first with out the debuger and it just magely worked!!! but im useing some sign trader shop thing for now, i will be updateing to this npc style when i have $128 to upgrade my servers ram. but thanks LOVE the plugin!!!
     
  17. Offline

    acegiak

    @woodzy , haha, awesome glad to hear it! Once the ai scripting is implemented I'll provide template codes such as traders and guards.
     
    woodzy likes this.
  18. Offline

    woodzy

    like that one guys was saying about the Guards, i thing thats a great idea for any server lol npcs attking players that would be sweet to have. little castle guards all around
     
  19. Offline

    acegiak

    Ladies and gentlemen! I am proud to present! NpcSpirit 1.0! Requires Sqlite for...

    Persistent NPCS!
    *crowd roars with applause*
     
  20. Offline

    Schmogel

    *apllause still roaring*​
    Ne work, looks like a solid NPC plugin. I'll test it in a few days ;)
    But you should change the following line in your opening post, I was confused reading this ;P​

    And another suggestion, would it be possible to set your NPCs to crouching mode? That would change the visibility of their names through walls and in a far distance. Its annoying to have all those names floating around everywhere with too many NPCs ^^
     
  21. Offline

    acegiak

    I'll work on it on monday (my working week is thurs through to sun)
    Can people link to their servers if they're using the plugin? I'd like to see how it's being used.
     
  22. Offline

    SweetCraft Girl

    Hi :)

    Is is possible to allow the NPC Block Type to be defined instead of sponge?
     
  23. Offline

    acegiak

    Not yet, you'll see that config files is next thing on the todo list. So some time in the next week that'll become possible.
     
    SweetCraft Girl likes this.
  24. Offline

    Xylogeist

    Love this plugin, thanks acegiak :)

    Can't wait for AI. I'm gonna add NPC's like the ones in Oblivion, lol.
    "Guards guards! There's a psychopath on the loose!" - on hit
    "Stop! You've broken the law!" - when guard nears
     
    SweetCraft Girl likes this.
  25. Offline

    SweetCraft Girl

    Could it also accept block IDs that include a colon like 35:15 (black wool)?

    Servers that use plugs like Precious Stones or others that allow block definition for special use already have the Sponge block tied up intimately in the world. However, nothing lets you use the alternate block IDs like 35:2 through 35:15 - And since Brown Wool is not yet attainable, that becomes an excellent block choice (assuming 74/90 also are not available, and are not for me).

    If you wanted to eliminate such "block issues" due to various plugs (like this one and others) taking advantage of the admin only give able blocks, perhaps you may consider having the NPC be created from a Chest block that then has a single "Sponge Block" placed inside it (or whatever block is configured). This way creating a NPC allows for any admin only block no matter how it is used by precious stones, multiverse, or any other plugin, since it will never be active because it sits in a chest?

    Also, a process such as: Chest + Sign on chest - sign has on 1st line: [NPC], and on 2nd line the NPC name; and then your right click to activate it and NPC is born - that totally eliminates any block issues altogether, while probably creating more issues....lol...non-coders <ME> never know the chaos we create in your worlds (you coders) with our seemingly simple requests and suggestions. So please do no take offense, i am truly ignorant in the complexities of coding.

    Thank you for reading that!
     
  26. Offline

    Xylogeist

    Yea, I'm a PHP coder so I look at things from simple angles and sometimes forget all of the work you guys put into this stuff. It's hard work and you guys deserve credit. I hope to not give the wrong impression when I suggest things, I really appreciate the stuff you guys make :D Just giving my input, feel free to ignore it if it's un-doable or chaotic.
     
  27. Offline

    Neko22

    Sorry, got another suggestion! I don't code Java or Bukkit so I'm not familiar how easy or difficult it would be to do...

    You could assign NPCs to a 'faction name', and each faction could have a list of 'enemies' (player names and/or mob names) that it would attack on site, 'neutral' that they ignore, and 'friends' (player names, mobs, etc) that they would rush to the aid of if they were under attack (ie if a friendly player was attacked by a neutral player, the NPC would rush to the aid of the friendly player and attack the neutral player, maybe putting the neutral player on the list of enemies. If two neutral players fought each other, it would ignore them).

    Also, if you could give NPCs a class (I think you plan this with the AI script file), so it would come with certain objects etc (eg a stone sword and a leather helmet for example).

    Again, these are all ideas, I really have no idea how simple or complex it would be (I'm not sure how for example it could recognise two players fighting, maybe some sort of hit event or something).
     
  28. Offline

    acegiak

    Neko22, that'll be a really easy thing to do with the ai scripting engine. I'll provide some basic template scripts such as merchant, guard or farmer which can be used as is or used as a basis for new and more advanced scripts. I'm reading up on the docs I'll need for this over this weekend and am gonna have a go at getting started on it come monday, but it's a big job.
     
  29. Offline

    NFFPokemon

    I can only get one of my NPC's to say a phrase, the rest just keep saying OY! no matter what :( im useing cb493
     
  30. Offline

    69joske69

    can you set a video
     
  31. Offline

    Jendon23

    instead of sponge or a mob spawner as the block that has the npc's "spirit" could you make it so its a sign placed on a wood block? maybe you could make it so you write the name on the first line, other info on 2nd and 3rd lines, and on 4th, you write the npc's mood or personality. it sounds kinda stupid, but heres a pic of what it would look like when it's done:

    [​IMG]

    maybe the face text could change sometimes, so it would look like their mouths open and close when they talk, and their eyes blink occasionally!
     

Share This Page