PDA

View Full Version : Day Job roll


risner
June 27th, 2010, 08:12 PM
How do I add a skill that allows you to pick a Craft, Perform or Profession skill you already have and only add certain things to it?

For example, I'd like to make a Day Job skill that either picks automatically your highest ranked Craft/Perform/Profession or allows you to pick from just those skills. Then only add ranks, ability modifier, feat bonuses, and trait bonuses to it. Ignoring all other bonuses (like from items) to that skill.

Mathias
June 28th, 2010, 08:28 AM
Actually, you want to make this an Ability, rather than a new skill, since what you want to do is to look up all the existing Craft/Perform/Profession skills.

Then, you'll need a way to add it to your character.

So, in the editor, go to the Mechanics tab, and create a new mechanic. The last option there is "Sources" - go there, and create a new source as a child of the House Rules header - call it "Show Day Job Roll".

Give your mechanic a Unique Id, like "mechDayJob", and save it.

Switch back to the main Hero Lab window, open up a blank character, and add each of craft, profession, and perform skills.

Now go to the develop menu, and make sure that the first item, "enable data file debugging" is checked.

Back to the skills tab, and for each of those skills that you've added, right click on it, and select "Show Selection Tags".

Study the three tag lists (and you'll want to see the tags for some other skill, too), and you'll find that all Craft Skills have the Helper.SkCatCraft tag, Perform has Helper.SkCatPerf, and Profession has Helper.SkCatProf.

Clear out those windows, and right-click on any skill. This time select "Show Selection Fields" - leave that open and add a level of a class that doesn't offer this skill as a class skill, then add a rank to the skill. Watch how the fields change. Try using the skill focus feat to modify the skill, and add a trait that modifies this skill. Then add a class that does offer this as a class skill, and see what changes when it's a class skill.


Alright, now that we know what we're looking for, we'll write the ability.

Back to the editor, to the same file the Mechanic is in.

Go to the Ability tab, and create a new Ability. Name it "Day Job Roll".

Now, press the Eval Script button.

Change the phase to Render and the priority to 10000.

First, we'll search through all the skills on the hero, limiting our search to craft, perform and profession skills (we'll also set up some variables):


var skilltemp as number
var skillbonus as number
var skillname as string

foreach pick in hero from BaseSkill where "Helper.SkCatCraft | Helper.SkCatPerf | Helper.SkCatProf"


Now, for each skill, we'll total all the bonuses we want to include:


skilltemp = eachpick.field[skTotal].value - eachpick.field[BonAlch].value - eachpick.field[ModCirc].value - ...

(You'll need to finish out that line, subtracting out any fields you don't want included in the total, like enhancement or sacred bonuses)

And then compare that total to our previous total, to see if this one's bigger. If so, we'll use this new skill's bonus and name instead of what we had.


if (skilltemp > skillbonus) then
skillbonus = skilltemp
skillname = eachpick.field[name].text
endif


Now, close the foreach, and generate a name from what we've found:


nexteach

~if we didn't find any appropriate skills, hide us
if (skillbonus <= 0) then
perform assign[Helper.SpecUp]
else
~otherwise add the name and bonus of our best skill to our name
field[livename].text &= ": " & skillname & " " & signed(skillbonus)
endif


Putting that all together for easy copying:


var skilltemp as number
var skillbonus as number
var skillname as string

~search through our Craft, Perform, and Profession skills.
foreach pick in hero from BaseSkill where "Helper.SkCatCraft | Helper.SkCatPerf | Helper.SkCatProf"

skilltemp = eachpick.field[skTotal].value - eachpick.field[BonAlch].value - eachpick.field[ModCirc].value - ...

~if this skill is better than our previous best skill, use its name and bonus
if (skilltemp > skillbonus) then
skillbonus = skilltemp
skillname = eachpick.field[name].text
endif
nexteach

~if we didn't find any appropriate skills, hide us
if (skillbonus <= 0) then
perform assign[Helper.SpecUp]
else
~otherwise add the name and bonus of our best skill to our name
field[livename].text &= ": " & skillname & " " & signed(skillbonus)
endif


Now, give your ability a unique Id (like "abDayJob"), save it, and press the "Test Now!" button on the top left.

Once that's done, switch back to the Mechanic, and press the "Bootstraps" button on the top right. Fill in the Unique Id of the ability ("abDayJob"), save and test the mechanic.

Now, everything should be working (reminder: you've set a source for this mechanic, so you'll need to go to the Configure Hero Form and turn that option on.)

Theocrat
June 28th, 2010, 12:03 PM
Just wondering, Risner, but doesn't your GM or you add it to your Chronicle sheet?
When I GM PFS Game Days, I add that to the total that they get for their tier. They get 497GP for Tier 1 plus a roll of 5GP - in the box marked GP Earned for Session (or whatever it's called - but it's one of the 3 boxes that the GM initials) I'd put 502GP. In your HL Journal you'd just add 502GP (plus or minus any money spent, items sold, bought etc...).
This seems like an awful lot of extra work!

Be Well. Be Well Unemployed.
Theocrat Issak

risner
June 28th, 2010, 04:23 PM
Awesome Mathias, I'll look at adding this tonight.


Theocrat, Yes. But I want something to tell me what my bonus is without having to calculate it up myself. Dayjobs can ONLY add ability, feats, or traits. No other modifiers can be added, so I can't just use the Craft Alchemy listed on the sheet, because it will include other bonuses not allowed.

risner
July 1st, 2010, 12:41 PM
Seems to be working:


var skilltemp as number
var skillbonus as number
var skillname as string

~search through our Craft, Perform, and Profession skills.
foreach pick in hero from BaseSkill where "Helper.SkCatCraft | Helper.SkCatPerf | Helper.SkCatProf"

skilltemp = eachpick.field[skTotal].value - eachpick.field[BonAlch].value - eachpick.field[ModCirc].value - eachpick.field[BonComp].value - eachpick.field[BonEnhance].value - eachpick.field[BonInsight].value - eachpick.field[BonLuck].value - eachpick.field[BonMorale].value - eachpick.field[BonProfane].value - eachpick.field[BonSacred].value

~if this skill is better than our previous best skill, use its name and bonus
if (skilltemp > skillbonus) then
skillbonus = skilltemp
skillname = eachpick.field[name].text
endif
nexteach

~if we didn't find any appropriate skills, hide us
if (skillbonus <= 0) then
perform assign[Helper.SpecUp]
else
~otherwise add the name and bonus of our best skill to our name
field[livename].text &= ": " & skillname & " " & signed(skillbonus)
endif

risner
July 1st, 2010, 01:13 PM
One more thing, any way to check to see if you are a companion? I want the "Day Job Roll" to not show up as an ability on Companions/Familiars/etc?

Colen
July 2nd, 2010, 09:42 AM
I think if the hero has a "CompIs" tag, it's a companion of some sort. For example, Druid animal companions have the "CompIs.cAnimComp" tag, indicating that they're an animal companion.

So for your "Day Job" ability, I think you want to add a "ContainerReq" test at phase First, priority 1000 (you can do this in the editor by pressing the ContainerReq button on the ability):

!CompIs.?

This should hide the ability if any CompIs tag is present on the hero, indicating that the hero is a companion of some sort.

risner
July 2nd, 2010, 12:35 PM
Hmm, didn't make a difference. It still shows in the "star" popup. It doesn't appear (even without the containerreq) in the minion with a value. It just shows "Blah, Day Job Roll, Blah2" in the pop up for the start (next to the sword, shield, money bag, etc) buttons.