Nexus scripts - Class skills

edited April 2020 in Mechanic's Corner
Bored so I decided to try and learn Nexus. I'm not an expert at it or Javascript, so feel free to offer suggestions. But, I did create a useful script to capture your skills and current abilities from GMCP in a two dimensional array. It's useful for classflexing or sharing systems, and it's something I'm building from to create an influencer, debate system, and bashing system eventually.

This part would go in the function called onGMCP: 
if (args.gmcp_method == "Char.Skills.Groups")
{
    hasSkill = [];
	for (var i = 0; i < args.gmcp_args.length; i++) 
        {
            send_GMCP("Char.Skills.Get {\"group\":\"" + args.gmcp_args[i].name + "\"}");
	}
}
if (args.gmcp_method == "Char.Skills.List")
{
    for (var j = 0; j < args.gmcp_args.list.length; j++)
    {
        hasSkill[args.gmcp_args.group] = args.gmcp_args.list
    }
}
To use this, like in an if statement:
if (hasSkill.influence.includes('Wheedling'))
   <do wheedling stuff>

Comments

  • Edit: Forgot one. This should go in the onLoad function:
    send_GMCP("Char.Skills.Get {\"group\":}")

Sign In or Register to comment.