View Single Post
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,217

Old February 25th, 2009, 09:04 AM
Skills

Long section here. First, you should know that Rob, Colen, and I had a long phone conversation discussing what I would be doing in this project, and a lot of that time was spent on the Cortex skill system, since it uses mechanics that don't exist in any of the game systems that have already been added in HL.

For those who aren't familiar with Cortex, a short description of the skill system. Like attributes, skills are rated in dice - d0 (untrained) to d12+d4 (legendary mastery). If it were just that, skills would be as easy as attributes. What makes the Cortex skills unique is the way they handle specialties. A General skill, for example, Guns, can only be bought as high as d6. After that, you need to purchase specialties (ex: Pistols, Rifles, etc.) to go from d8 - d12+d4.

Implementing that in HL unfortunately requires that each specialty be added as a unique thing, rather than a selection menu. If your character is wielding a pistol, the weapon needs to be able to look up your Guns/Pistols skill. If it fails to find that, it will use your Guns skill, and if it fails to find that, it will be at d0. On the other hand, adding both the general skills and the specialties as separate things means that it's easy to present the skills a character has taken like the pre-generated characters in the book - Specialties are sorted under their general skill, and indented.

Coding skills:
There are three components written for skills. The Skills component includes all the behavior that all skills share, which is currently an identity tag (so that if something else wants to know if a skill is present on the hero, it can look for the tag Skill.xxx).

The SkillGen component includes all the behaviors that general skills have, Its trtUser is limited to a minimum of 1 and a maximum of 3 (d2-d6). General skills have an additional identity tag, SkillGen.xxx, along with the Skill.xxx identity tag they get from the Skills component. Unlike the Skill.xxx tag, which is forwarded to the hero as soon as the skill is taken, SkillGen.xxx is only forwarded to the hero if the General skill has a value of d6.

Specialties have a minimum value of 4 and a maximum of 8 (d8-d12+d4). Each is assigned (in the editor) a SkillGen.xxx tag that matches its parent General Skill. A pre-req defined on the specialty component will flag the specialty as invalid if its general skill isn't present, and isn't at a value of d6. Also, for each general skill, I've defined a specialty which unlike the rest, isn't unique, and has the User.NeedDomain tag. This adds the various domain behaviors to that skill, meaning that it shows a box for the user to fill in, defining its name. That way, if the user wants a specialty for their character that isn't defined, they just add the generic speialty, and name it whetever they want.

In the definition of the menu for choosing the skills your character has, I've used a needtag expression that requires both the hero and the skill to both have the same SkillGen tag, or the skill won't be displayed in the list of skills available. To make this work, I also had to define the tag SkillGen.zLast, and put that tag on the hero and on all general skills. The first reason for this is that if the needtag expression finds that there aren't any SkillGen's on the hero yet, it assumes that everything is a valid selection. So, at least one SkillGen needed to be on the hero before the user started selecting skills. Once you get into the skill selection, the various skills have to match at least one SkillGen that's on the hero. So, adding SkillGen.zLast to all the General skills means that they will show up in the list of skills you can take.

Here's what will happen as the user selects skills:
They'll click on the "Add Another Skill" button at the bottom of the skill list. Shown in the list are all the general skills available. Once they've choosen one of those general skills, and raised its value to d6, they can click on "Add Another Skill" again, and now the list of skills will show all the general skills they haven't taken, along with all the specialties that are available for the general skills they have at d6.

Sorting skills:
As I mentioned, each general skill generates its own SkillGen tag, and each specialty is assigned a SkillGen in the editor. Each general skill is also assigned SkillCat.General (order="1"), and each specialty has SkillCat.Specialty (order="2").

So, here's the sortset:
Code:
 
<!-- Sort skills, general first, then specialties -->
<sortset
id="Skills"
name="Skills">
<sortkey isfield="no" id="SkillGen"/>
<sortkey isfield="no" id="SkillCat"/>
<sortkey isfield="no" id="_Name_"/> 
 
</sortset>
What that means is that it first sorts all skills (general and specialty) by their SkillGen tag, so the Animal Handling skill and its specialties are sorted before Artistry and its specialties. The next thing it sorts by is the SkillCat tag. The SkillCat tag group is defined to have an explicit sort order, so within each SkillGen, the General skill gets sorted before all the specialties. The last thing to do is sort by _Name_, which simply means to sort the specialties alphabetically. The definition of the skill list in HL includes:

Code:
 
showsortset="Skills"
choosesortset="Skills"
so that the skills are sorted that way both before and after you select them.
Mathias is offline   #10 Reply With Quote