RP PlayerCards

Discussion in 'Plugin Requests' started by DrBreadgun, Mar 28, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    DrBreadgun

    Plugin category: Role Playing, Misc, Mechanics

    Suggested name: Roleplay Player Cards

    What I want: I run a serious Role Play server, and I need a character card feature. For those who don't know, this is where information about a player's character is stored. This concludes of basic RP information such as their character's name, age, race, description, etc.

    Once said parameters were set, a player would be able to right-click another player to see their playercard, which would look something like:

    Player Card Example (open)
    -------[%player%'s Character Card]--------
    Name: ((RP nick))
    Gender: ((Male/Female/Unknown))
    Age: ((RP age))
    Race: ((RP race))
    Description: ((RP Description))
    ---------------------------------------------------



    Ideas for commands:
    /setname - Set rp character's name. This will also change the player's chat nick/nickname in the chat
    /setgender - Male/Female/Undefined, or can possibly add/alter in the config
    /setage - Update's the character card's "age" argument to said numerical value.
    /setrace - Update's the character card's "race" argument to desired playable race, in which the server owner could possibly add/alter more playable races in the config to their desire.
    /setdesc - Set the character card's descripton.
    /adddesc - Adds more text to the character card if the player is unable to type more in the Minecraft Chat Box.

    Ideas for permissions:
    rppc.*
    rppc.setname
    rppc.setgender
    rppc.setage
    rppc.setrace
    rppc.description

    When I'd like it by: From now to two weeks from now, take your time!
     
    MrMe1003 likes this.
  2. Offline

    _Hybrid

    @DrBreadgun
    Do you use Essentials?
    If so, there is an easier way to do this without an extra plugin,
    and it will only have one command:
    /playercard <nick> <gender> <age> <description>
    Also what item do you want the player card to be?
    (You do not need essentials to get this to work, it will make it easier though)

    So if you want to use this method I can write out what the command

    (I just realized you might get confused, playercard isn't a command in essentials,
    but I can give you some script so you can add a custom command)
     
  3. Offline

    nverdier

    @_Hybrid How exactly does Essentials make it easier?
     
  4. Offline

    _Hybrid

    @nverdier
    (in the commands.yml) you can add the essentials command
    give <player> <cardItem> 1 <name> <lore|moreLore>

    So for the name and stuff you add extra arguments and tada... it gives you your card with
    the info you type on it
     
  5. Offline

    DrBreadgun

    @_Hybrid

    Well, this isn't a physical item. This is when you right click the player and the playercard pops up in the chat, and the players can change it (not the admins) however they want.
     
  6. Offline

    undeaD_D

    Should be ready tomorrow ;)

    Images (open)

    After rightclick:
    [​IMG]
    Configuration:
    [​IMG]
    Item:
    [​IMG]
     
  7. Offline

    _Hybrid

    @DrBreadgun
    Oh okay, I thought you meant it was an item xD
     
  8. Offline

    MrMe1003

    The only thing is I don't think he intended to have the card be something you have to keep in your inventory. More like have the information for each character stored in a file in the plugin's folder.
     
  9. Offline

    undeaD_D

    i could do that ... but that would be less efficient :/
    i will rewrite it tomorrow ...
     
  10. Offline

    DrBreadgun

    @undeaD_D

    Also, it would be great if you could make this for Craftbukkit 1.7.10
     
    Last edited: Mar 30, 2015
  11. Offline

    MrMe1003

    @undeaD_D
    Sorry if it's a hassle; I do appreciate you taking the plugin on. I've been looking for something like this for a while.
     
  12. Offline

    undeaD_D

    @DrBreadgun @MrMe1003

    Plugin is ready ...
    Link: http://pokemon-online.xyz/plugin/

    Installation:
    1. download RoleplayCards.jar from the link.
    2. download SQLibrary.jar frome the link.
    3. put them both in your plugin directory.
    4. reload / restart your server ...
    5. edit config.yml
    6. /rpc reload to reload the config ...
    7. have fun ;)

    Information:
    - supported versions: 1.7.x - 1.8.x
    - stores data into sqlite database
    - if you want to manually edit informations use this programm: http://sqlitebrowser.org/
    - working on longer description ... maybe by using books !? idk

    comment if you have problems / questions ;)
     
    Last edited by a moderator: Mar 31, 2015
  13. Offline

    MrMe1003

    @undeaD_D
    (I don't want to seem like I'm butting in on/taking over DrBreadgun's thread; I made my own but since it was basically for the same plugin I thought I'd come here. Anyway: )

    Just a few bugs/suggestions:
    It looks like the "/rpc reload" command doesn't work, so changing the config requires restarting the server.

    Also, it looks like each field doesn't allow for spaces, so, for example, when I type "/rpc description I don't have a description", all that shows up in that field is "Description: I"; likewise if I type my name as "/rpc name My Name" it shows up as "Name: My"

    Those are the only bugs I noticed, otherwise it looks to work totally fine. I do like the customizable layout of what shows up. I do have a few suggestions, though.
    Would it be possible to have whatever you enter in the "Name" field be configured to also replace your name in the text box when talking, including spaces?
    Also, a much more insignificant thing, could there be a little confirmation message when you set a field, just so you're sure it worked? Like after "/rpc name [name]", it would show "Your name has been set!" And to add onto that, maybe a way to check your own card to make sure everything is the way you want it, like with "/rpc check", or "/rpc view", or something along those lines.

    And as DrBreadgun said earlier in the thread, maybe make it so you can extend your description by doing "/rpc AddDesc" to add more text, while "/rpc description" completely resets it, starting from the first line, if you want to do that.

    (Sorry for the long-winded reply, we just seem to be available at very different times, so I just wanted to make sure I got everything down while I'm thinking about it. And again, thanks for taking on his request.)
     
    Last edited: Mar 31, 2015
  14. Offline

    undeaD_D

    @MrMe1003, @DrBreadgun

    Download v 2.0:
    Link: http://pokemon-online.xyz/plugin/
    (sqllibrary.jar is still the same ...)

    Please remove the RPC folder before your reload / restart your server ;)

    Updates:
    - fixed /rpc reload
    - now supports spaces ---> /rpc name my name is undeaD_D
    - added two settings:
    - prefix ---> replaces your name in chat with your nick from the database
    - confirm ---> displays a confirm message (editable in config.yml)
    - added one permission: rpc.prefix ---> if prefix is turned on your name will get replaced with your nick
    - added new command: /rpc check ---> displays your own RolePlayCard

    TODO:
    - prevent sql injection (use prepared statements ...)
    - more lines for description


    have fun.
    ps: im from germany ;)
     
    MrMe1003 likes this.
  15. Offline

    MrMe1003

    @undeaD_D

    Overly-Long Usage Report/Feedback:

    Alright, it looks like everything is working beautifully. :) The only (small) problem I've noticed is that descriptions can't have apostrophes in them, so if I type "/rpc description I don't have a description", nothing happens. This really isn't a big deal, but I just thought I'd put it in there anyway.

    A problem I'm personally having, though, is that I use HeroChat to format text/channels, which seems to be overriding the "prefix" function of your plugin. Would it be possible to, instead of setting the layout of the chat, the Prefix only changed your displayed name, much in the way Essentials' "/nick" command works?

    Addressing adding information to descriptions:
    The more I think about it, I think using books, as I said in my thread--
    --would make it easier to edit specific parts, rather than having to redo the whole thing to fix a single error, as would be the problem with the "/rpc adddesc" command idea.

    Another suggestion:
    Show Spoiler
    Another suggestion that came to mind while I was typing, if possible, maybe make a way to save multiple cards under one user? This really isn't that important of an addition, but it would be convenient if a player (such as a staff member) had more than one character they wanted to play, then they could more seamlessly transition between them. If this could be done, then maybe they could type a command like "/rpc save [CardName]", which saves all the info for that card under the given name, which they can then reload with "/rpc load [CardName]". If this seems like too much work, then don't worry about it. It was just something that came to mind.


    That makes sense; I'm in the western U.S., and most days am home in the evenings.. :(
     
    Last edited: Apr 1, 2015
  16. Offline

    undeaD_D

    @MrMe1003

    Download v 3.0:
    you know where to find it X-) ...

    remove the RPC folder before your reload / restart your server ;)

    Updates:
    - added option to overwrite displayname instead of textformat
    - finally added longer descriptions :O
    - took me quite some time ...
    - added options to customize the description book
    - added new command: /rpc toggle
    - toggles between two RPC cards ...
    - added new permission: rpc.toggle ---> you can now use /rpc toggle
    - fixed sql injection (90%) ...
    - there can still be security problems!
    - it would be the best to check the database every one in a while !?!
     
  17. Offline

    MrMe1003

    @undeaD_D
    Everything looks like it works just like it should, I just have a few minor tweaks to point out.. If that's no trouble. I realize at this point it can be a little annoying of me. >_< You are doing me, and I'm sure others, a big favor by making this.

    It appears with the new way of setting descriptions, any formatting plugged into the config doesn't work. Example:
    Show Spoiler
    [​IMG]
    As you can see, I set it so the Description should appear gray and italicized like the other fields, but it didn't take.
    Also, if you could find a way to make it so apostrophes could be added, that would be appreciated.

    Would it be possible to make it so you could write your description in the book without signing it, and then if you wanted to change it, you would type "/rpc description" and get the book back, already filled out? That would make it easy to edit if you just misspelled a word near the end.. Though I understand if this is a bit of a hassle.
    Other than that, it looks to work exactly how I personally would've liked, especially the names. ^_^

    And again, I really do appreciate you doing this plugin

    Edit: I just thought of how anyone could add color formatting to their name, and other fields. Would it be possible to make it so this could be disabled fer certain users via permissions? It's not a necessity; staff could just make sure no one does it, if it's too much trouble.
     
    Last edited: Apr 1, 2015
  18. Offline

    DrBreadgun

    @undeaD_D

    Hmm... For some reason I get this when I use it.

    Must I run it on 1.8.1 servers?
    [​IMG]
     
  19. Online

    timtower Administrator Administrator Moderator

  20. Offline

    undeaD_D

    @timtower He did ... my plugin wont even load without it ;)

    im using the StringUtils.join("","") function from org.apache.commons.lang3.StringUtils;
    but i can implement that function in the next update ...


    @DrBreadgun
    No ... it has nothing to do with your minecraft version ;) dont worry ...

    -------------------------------------------------------------------------------------

    @MrMe1003, @DrBreadgun

    Download v 4.1 is ready:
    remove the config.yml before your reload / restart your server ...

    Source:
    Link: https://github.com/CustomCraftDev/RolePlayCards

    Updates:
    - implemented own join() function.
    - removed prefix from every message
    - added message-prefix entry :p
    - added new option to edit the book lore ...
    -- you can expand the list if you want :p
    - added new permission check rpc.color
    -- there are five new permissions:
    --- rpc.color.name / rpc.color.gender / ... / rpc.color.description
    --- if the player has these his card can display colorcodes ... if not existing ones will be removed
    - im now replacing `and ' with %AP% so that they wont cause errors with sqlite ...
    -- %AP% gets replaced with ' if it gets displayed in chat ;)
    - increased description size (before 500 characters) to 999 characters ... 3-4 book pages
    - added my small update notifier (for future updat possibilities)
    -- it opens my website and checks the newest version (on restart / reload)
    -- if there is a newer one uploaded it will notify users that have the permission:
    -- rpc.update
    -- it will also print a message in the console ;)
    - added option to turn uptdate-check off :(
    - fixed predefined description colors !!! FINALLY -.-
    -- i cant seem to find the mistake i made :/ <--- found it :D
    - added book rewriting ... :O
    -- lines can be a big buggy though ... havent tested it enough ;)

    <Edit by mrCookieSlime: Merged posts. Please don't double post. There is an Edit Button right next to the Date.>

    @mrCookieSlime :/ these are two different topics ... and i definetly know how to edit posts ^^
     
    Last edited: Apr 2, 2015
    MrMe1003 likes this.
  21. Offline

    MrMe1003

    @undeaD_D

    I just got a chance to try out the latest update, and for my own purposes, the plugin seems to be working just perfectly. :)
     
    undeaD_D likes this.
  22. Offline

    Ranger2415

    Something like this should be make into a legit plugin, plenty of people out there could use it!
     
  23. Offline

    undeaD_D

  24. Offline

    Flashera

    Overwrite displayname does not seem to be functional (I suspect HeroChat).

    You should also add a configurable gendertype for gender (meaning all genders you can be, so the config will say:
    Gender:
    - Male
    - Female
    *same for races*

    Also, you should require an integer for age.

    The above should say First joined, last online/online since (same line), and if they are/have been banned before (with reason listed as well as how long for/how long ago), and maybe an option for whether they are muted.

    Also make dashes be per permission, so only mods can see IPs for example.

    Perhaps also an option for either seeing group prefix, or the group itself in the actual card.

    Configurable ability to get playercard in a command similar to /seen as well as configurable shift-rightclick to see playercard.

    You should also add some tagname (ie, the name you see when seeing a player) functionality (ex, tag says permissionprefix playername (nickname) )

    @undeaD_D
     
    Last edited: Apr 7, 2015
  25. Offline

    undeaD_D

    @Flashera

    1. i see no way to change the displayname without using a third party plugin (like protocollib)
    2. added configurable gender enforcement - can be toggled in config.yml
    3. added age enforcement (integer) - can be toggled in config.yml
    4.a) which above field ? ...
    4.b) last online/online since use essentials for that info :p
    4.c) ban counter would make absolutely no sense for me ... if a user is banned he wont be able to join -.-
    you could use McBan ... i think the got you covered with the ban counter.
    4.d) mute is an essentials command ... i have no intention to add dependencies to other plugins ... unless there is a large request.
    5. prefix/suffix are features of vault ... as i said in 4.d) i have no intention unless there is a large request ;)
    6. bukkit and spigot both have a file called commands.yml ... you can add aliases there ...
    http://wiki.bukkit.org/Commands.yml
    7. no intention to add this feature without a larger request ... sry (you could use any permission manager ...)

    --------------------------------------------------------------------

    @MrMe1003, @Ranger2415, @DrBreadgun


    Download v 5.0 is ready:
    remove the sqllibrary.jar ... (not needed anymore)

    backup and remove the config.yml before your reload / restart your server ...

    Source:
    Link: https://github.com/CustomCraftDev/RolePlayCards

    DevBukkit Link:
    Link: http://dev.bukkit.org/bukkit-plugins/roleplaycards/

    Download Link:
    Link: http://pokemon-online.xyz/plugin/

    Updates:
    - implemented own sqllibrary (now depending on nothing :O)
    - removed overwrite-displayname setting in config (was never working :/)
    - added debug mode for full error messages (default: false)
    - added must shift rightclick feature (default: false)
    - added optional enforcement:
    -- age <--- number
    -- gender <-- customizeable list in config.yml
    -- added customizeable error messages for both
    - added second display for higher ranks (admins / ops)
    -- new permission: rpc.extended_display
    -- both support ever information (ip, ...)
     
    Last edited: Apr 7, 2015
  26. Offline

    Flashera

    @undeaD_D When I mean a "/seen" feature, I meant a way to view a player's CC without being next to them even if they are offline, ie (/rpc check <name>)
     
  27. Offline

    Ranger2415

    @undeaD_D Hey is this available for 1.7.10?
     
  28. Offline

    Flashera

    It /should/ be compatible unless he used methods added in the 1.8 version of Bukkit/Spigot.
     
    undeaD_D likes this.
  29. Offline

    undeaD_D

    @MrMe1003, @Ranger2415, @DrBreadgun, @Flashera

    Download v 5.1 is ready:
    the player.db may need to to be deleted !

    Updates:
    - added /rpc seen feature to look up cards of offline players
    - added rpc.seen permission to use /rpc seen command

    Bugs:
    - If multiple players have the same username (after a namechange) the seen feature will only pick the first one ...
    -- due to mojangs uuid featcher restrictions -.- there is no fast way of converting (name -> uuid)
    -- if this happens you can manually edit the wrong username out ... it will fix itself if the player with the wrong username -- logges in

    --------------------------------------------------------

    @Ranger2415
    it is fully compatible with 1.7.x - 1.8.x ...
    just
     
  30. Offline

    Flashera

    Does the /rpc seen work for online players as well?
     
Thread Status:
Not open for further replies.

Share This Page