PDA

View Full Version : Adding a Feat


RedBeardSean
April 23rd, 2010, 06:37 AM
Okay, I've been using the HeroLab software for a couple of years for my M&M game, but now I'm starting a Pathfinder game, and find I want to add a Feat. Of course, before I do, I'd like to make sure no one has already done the work- no sense reinventing the wheel, after all. (Not to mention the editor for feat addition is complex looking and I'd have to do a lot of reading to figure it out, and I'm essentially lazy).

The feat I want to add, you ask? I'm doing this at work, so this is just the basic gist...

Multicultural (General)
Prereq: 1st level Character
Description: Choose a race other than your parent race. You gain access to the bonus languages of that race, and qualify for prestige classes, traits (you get the Adopted trait as a bonus Trait) and feats for which that race is a prerequisite. You don't get access to magic items whose powers are built around your adopted race. You can take 10 on Knowledge and Sense Motive checks in regards to your adopted race.
Special: Half-races cannot choose either of their parent races as the object of this feat.
Special: You can only select this feat at 1st level.

So, adding this to HL would require a choice of race for the adopted race, and somehow adding a sub-routine that would allow access to some racial stuff (langauges, preqs for feats and talents, etc.) without changing the type or subtype of the character.

RedBeardSean
April 23rd, 2010, 06:43 AM
The idea here is that a half-orc, adopted and raised by dwarves, for instance, should be brought up as a dwarf, and have access to more than just the dwarf traits that the Adopted Trait would allow.

Mathias
April 23rd, 2010, 09:06 AM
Unfortunately, in Hero Lab, the prestige classes, magic items, feats and racial traits are checking for the same thing when they're checking if they're allowed for this race. I think your best bet there is to grant access to all of it, and leave a note about the magic items.

The way to start here is by examining how these components work. Begin with a blank character. In the develop menu, make sure "Enable data file debugging" is checked, and then at the bottom of the develop menu, select "Floating Info Windows" - from that list, select "Show Hero Tags".

Now, select Human as this character's race, and then in the develop menu, floating info windows, select "Show Selection Tags", and select Human in the list that pops up (note that the human race "rHuman" will be adjacent to the human subtype "stHuman" in that list - you want to look at the race).

Examine those two lists of tags. Now, change the race to Orc, and then to Half-Orc, each time looking at the tags for the race, and comparing them to the tags on the hero.

You'll note that each race has its own Race.? tag, like "Race.rHuman", and that the Half-Orc gets the Race.? tag for itself and the race tag for Orcs. Also, you'll note that all those Race.? tags are copied from the race to the hero - it's the Race.? tags on the hero that are what's checked by feats, racial traits, etc.

Also in that list of tags, note that each race has many Language.? tags, and that these tags are duplicated on the hero (also note that the human race has Language.Any). Those language tags are what's checked to see if the character is allowed that language as a starting language.


Now, how to get that information from another race.

Look at the tags on a race - look for a component tag that's shared among all races, and seems like it would only be on races (in this case, it's easy - "component.BaseRace", but this is a technique that can be used for things that are harder to distinguish).

In the feat section of the editor, go to the "Item Selection" header - you'll see "Select From..." is the next option. Looking through that list, unfortunately, doesn't show races as an available selection.

So, the next option after that is "Custom Expression" - enter "component.BaseRace" in that list (without the quotes).

The next option after that is "Restrict First List to..." - choose "All Things" in that list - since the race you're selecting isn't present on the character, you want to select from the things that haven't been selected, rather than the picks that have been selected.

In the Bootstraps button on the top right, you can add a bootstrap for the Adopted trait.

Give your feat a proper name, Unique Id, description text, etc., and then save and "Test Now!"

Go to the feats tab, select this feat, and make sure the race selection works as you intend, and make sure the adopted trait is showing up properly.

Now for the script. Go back to the editor, and create a new Eval Script.

This sort of thing - controlling basic properties of the character, like what race it is (or what race it counts as), is something that should be done relatively early, so the First phase is appropriate. The priority should be relatively late in the First phase, though - 20000, perhaps.

The first thing to add to the script is a quick check that the user has selected a race for the feat:


~if the user hasn't selected anything, there's nothing we can do
doneif (field[usrChosen1].ischosen = 0)


Next, we'll use the focus mechanism to record a pointer to the chosen race, which means less typing later on as we reference that race:


perform field[usrChosen1].chosen.setfocus


Now, find out what Race tags that race has, and pull them onto this feat, then the same for languages:


perform focus.pulltags[Race.?]
perform focus.pulltags[Language.?]

Now, we have that race's tags stored on the feat. Next, we'll forward them to the hero:


perform forward[Race.?]
perform forward[Language.?]


Assembling all that for easy copying:


~if the user hasn't selected anything, there's nothing we can do
doneif (field[usrChosen1].ischosen = 0)

perform field[usrChosen1].chosen.setfocus

perform focus.pulltags[Race.?]
perform focus.pulltags[Language.?]

perform forward[Race.?]
perform forward[Language.?]

RedBeardSean
April 23rd, 2010, 09:41 AM
Wow. I was going to ask you, since you're obviously a god of this kind of thing, where I would go to visit your shrine.

Then I saw that you work here.

I will pay you homage at the Lone Wolf booth at GenCon.

/salaam

RedBeardSean
April 24th, 2010, 07:05 AM
Okay, now that I've had a chance to play with this in the editor, it works only to a point. I get the Adopted Trait, I pull down the option Dwarf, for the feat, but I also get the following error pop-up.

Attempt to access pick information or behaviors for read-only thing 'rDwarf'
- - -
Attempt to access 'focus' pick from script when no focus exists
- - -
Attempt to access pick or thing information when no context exists
- - -
Attempt to access 'focus' pick from script when no focus exists
- - -
Attempt to access pick or thing information when no context exists

What did I miss?

Mathias
April 24th, 2010, 10:58 AM
I hadn't tested it before I gave you the code. Sorry about that.

A focus can't be set to a thing, only a pick.

Try this:


~if the user hasn't selected anything, there's nothing we can do
doneif (field[usrChosen1].ischosen = 0)

perform field[usrChosen1].chosen.pulltags[Race.?]
perform field[usrChosen1].chosen.pulltags[Language.?]

perform forward[Race.?]
perform forward[Language.?]

RedBeardSean
April 24th, 2010, 12:34 PM
Ah! Now it works perfectly. Awesome, and thank you again.