Welcome to the Achaea Forums! Please be sure to read the Forum Rules.

GMCP Help

DynouDynou Posts: 4Member
edited August 1 in Tech Support
Hello. Sorry if this has already been posted but I have been looking for the past few days and found nothing.

gmcp.Char.Skills - keeps a list of ALL skills but in other muds I have played it only keeps the skills you have rather then ALL skills for that skillset.

I have a script to capture what skills are in GMCP Currently (lets say for weaponry has I have 0 skills in it), it shows

 weaponry = {
    "Proficiencies",
    "Targeting",
    "Weaponprobe",
    "Parrying",
    "Decapitate",
    "Envenom",
    "Throw",
    "Targetthrow",
    "Shatter",
    "Behead"
  }, - shows as trans

Does anyone know how to cancel out the skills you DONT have?

function parse_skillsets()
charskills = {}
charskills.list = {}
for _, set in ipairs(gmcp.Char.Skills.Groups) do
local skills = string.format("Char.Skills.Get %s", yajl.to_string({ group = set.name }))
sendGMCP(skills)
end
send("\n")
end

With the event handler set to ' gmcp.Char.Skills.Groups ' I've never had this before in the other IRE muds,

the feed back I get from that mud is

Weaponry = {
  "Proficiencies",
  "WeaponProbe",
  "Weaponbelts",
  "Targeting",
  "Quickwield",
  "Armaments",
  "Parrying"
} -- not trans




Tagged:

Comments

  • RyzethRyzeth Posts: 1,105Member ✭✭✭✭✭ - Grand Achaean
    edited August 1
    As of right now, there's no way to directly parse which skills you do and don't have. I believe @Makarios was in the process of brainstorming something to allow you to, without breaking the way it's currently setup for the backend of things...

    If you want to do that, you'll have to individually parse the skills to determine the ones you don't have. The way wundersys does it is like so:
    sendGMCP([[Char.Skills.Get { "group": "survival", "name": "clotting" }]])
    That'll tell GMCP to check the skill you want. From there it uses another function that does the following to determine whether or not you have it.

    if gmcp.Char.Skills.Info.skill == "clotting" then
    if not string.findPattern(gmcp.Char.Skills.Info.info, "You have not yet learned this ability") and gmcp.Char.Skills.Info.info ~= "" then
    wsys.settings.haveclot = true
    --wsys.report("You have the clotting ability")
    end
    --etc

  • DynouDynou Posts: 4Member
    edited August 1
    @Ryzeth How are you getting the Char.Skills.Info ? The info isn't in GMCP from what I am seeing

    Oh found it <
  • DynouDynou Posts: 4Member
    Thanks for the script but that seems a very hard thing todo for something so simple :/ I wont track if I have the skill or not and just wing it :)
  • RyzethRyzeth Posts: 1,105Member ✭✭✭✭✭ - Grand Achaean
    Wundersys typically parses the skills directly on login, to prevent too many GMCP requests. Then, as the function shows, sets a variable true/false depending on what's returned.
  • DynouDynou Posts: 4Member
    Aye, now to figure out all the skills!

    Thank you so much for helping
Sign In to Comment.