[WIP] Server Mod Help Chat

Discussion in 'Work-In-Progress Mods' started by wondible, December 28, 2014.

  1. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    Release Thread

    Offer help on server mods via a chat bot. Chat is available in the game lobby and in game. In the lobby, it will greet new players in order tell them about the !topics command.

    Chat Commands

    - !commands: list commands
    - !topics: list topics
    - ?<topic>: print the text associated with the given topic

    Providing Chat Help

    This mod attempts to load a file named `<server mod idenfier>/mod_help.json`. The directory name *must* be the same identifier which appears in your `modinfo.json`. Example: `com.wondible.pa.my_awesome_mod/mod_help.json`.

    Chat Topics

    The JSON file should contain a `topics` object with simple topic-text pairs.

    Code:
        {
          "topics": {
            "my awesome mod": "Brief overview",
            "another topic": "...",
            "mymod tips": "..."
          }
        }
    
    All chat topics are merged, so please try to choose topic names which are unlikely to collide with other mods (such as `tips`)

    Announcements

    The JSON file may contain an `announcement` string. Announcements occur when a player enters the lobby. The intended use is for mods that can offer additional lobby functionality by shadowing. Please use with restraint.

    Code:
        {
          "announcement": "Extra lobby functionality is available.  If you don't see XXXX, refresh the UI (F5 by default).",
          "topics": {...}
        }
    
    Mod

    - https://github.com/pamods/server_mod_help_chat

    Mods with provisional support

    To test, download an archive.

    - https://github.com/JustinLove/extreme_energy_combat
    - https://github.com/JustinLove/extremely_efficient_engineers
    - https://github.com/JustinLove/finite_metal
    - https://github.com/JustinLove/junkyard_wars
    - https://github.com/JustinLove/no_metal_commander
    - https://github.com/JustinLove/puppetmaster
    - https://github.com/JustinLove/reclaimable_features
    Last edited: January 23, 2015
    stuart98 and killerkiwijuice like this.
  2. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
  3. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    Server Mod Help Chat 0.2.0

    - Fix greeting players.
    - Disable greeting players when there are no topics.
    - Simple prefix matching (!c matches !commands, and so on)
    killerkiwijuice likes this.
  4. killerkiwijuice

    killerkiwijuice Post Master General

    Messages:
    3,879
    Likes Received:
    3,597
    Should I credit you in the modinfo.json if I use this?

    EDIT: Also is there an example mod that I can see to find out how to add the chat bot? I looked in pupetmaster and there was nothing. The only thing that is confusing me is the "topics" stuff. I already made the server_mod_help.json.
    Last edited: December 29, 2014
  5. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    Not for just a JSON file.

    Key (e.g."puppetmaster" is the thing you can type (prefixed by ?, so "?puppetmaster"), and then the bot answers with the value (a summary of the mod, in this case)
    killerkiwijuice likes this.
  6. killerkiwijuice

    killerkiwijuice Post Master General

    Messages:
    3,879
    Likes Received:
    3,597
    I placed everything inside the coui path (ui/mods/server_mod_help_chat) and placed the server_mod_help.json inside the server mod identifier, but when I load up the game, it doesn't work.

    Maybe it's a bug or something? I'll post a link (file is too large) to my .zip here if you want to take a look, unless I did something stupid with the paths.

    I want this to be a thing!!! :D
  7. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    Git branch may work better for the large file issue.

    This is a client mod; the chatbot runs in your client. This will be a lot more obvious once it's on PAMM. (The player guide version will either be a server mod or a framework you add to your mod, depending on how things shake out) All you need is the JSON file.

    I tried it and the file loads fine.

    "mod name", "advice", "summary", and possibly "fabricators" are too generic. "mod name" can simply be "dox4lyf", which might be better pointed at summary. You could try a simple prefix for the rest like "d4l advice"

    Let me know if that seems awkward - I've got it in WIP to shake things out. If you want each mod to have it's own namespace, I'm open to ideas on how to make the chat interface handle that gracefully.
    killerkiwijuice likes this.
  8. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    I basically got a client mod for free while making player guide help, so the json file will be changing from server_mod_help.json to mod_help.json. If it's not too hard, the chat mod will have one interim version that loads both files.
    killerkiwijuice likes this.
  9. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    Server Mod Help Chat 0.3.0

    - Interim version supports both mod_help.json and server_mod_help.json. server_mod_help will be removed in next version
    - Matching is case-insensitive
    - If a mod provides no topics, a default is provided with the mod description
    - More general substring matching
  10. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    All of my mods with provisional support have been moved to mod_help.json on github.
  11. nixtempestas

    nixtempestas Post Master General

    Messages:
    1,216
    Likes Received:
    746
    I've looked at the examples you got on there but it doesn't appear to be working for me :(

    can you take a peek when you have a moment and let me know what about this situation is busted?

    https://github.com/lrolleman/anti-popcorn-pamm
  12. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    It's not in a directory with a name matching the mod identifier. This is confusing in your repo because you've got the mod one level deep, in a directory that happens to have the same name. So relative to the repo you'll need to put it in com.nixtempestas.antipopcorn/com.nixtempestas.antipopcorn/mod_help.json
    nixtempestas likes this.
  13. nixtempestas

    nixtempestas Post Master General

    Messages:
    1,216
    Likes Received:
    746
    strange, but it now works, so I can live with strange

    I'm now including the mod help as part of anti-popcorn on PAMM. I really like this :)

Share This Page