PDA

View Full Version : Call a skill instead of Attribute modifier (3.5e)



zaigadeke
April 21st, 2018, 01:51
This is the first of likely many questions I have that I haven't been able to solve by trying to dissect and understand the code.

On the Main page of the Character sheet, there're the rollable boxes for Initiative, Melee, Ranged, and Grapple. In the game I'm planning on starting, these will have dedicated skills (with ranks and such) corresponding to them. How can I make the Melee roll on the Main page point to a skill bonus modifier instead of the apparent Attribute modifier? I've been fiddling about with anything that looked like it was involved with this particular piece, but to no avail. So, instead of banging my head against this wall for another 3 weeks, I thought it'd be best to ask the nice people who know this code inside and out for help and guidance.

Thanks in advance.

damned
April 21st, 2018, 05:04
Welcome zaigadeke
these sorts of things are easy for human brains to calculate on the fly
for a computer - that involves a lot of code.
you are probably not going to find a quick code solution.

work out the difference between the two stats and use an effect or modifier or just adjust the melee attack using the magnifying glass.
once in a while recheck that the value you have been using is still valid.

zaigadeke
April 21st, 2018, 13:22
Drat, I thought I had my "problem" cornered around the source="attackbonus.melee.total" lines in the Record_Char_main.xml and all I needed was to replace this with a skill check. I'm not against doing the work myself, I'm just tired of sifting through the files to find the pieces of syntax and functionality I need. I know the Spot, Search, and Listen buttons call to a skill check of the corresponding skills, I want to do that with the Melee, Ranged, and Grapple rolls on the main page too.


How about a different question then. The game I'll be running has several custom races and there's quite a bit of flexibility in this world's Size distribution. I.E. In this world, a typical human (or most other races) can be anywhere from Small to Huge. If I drag a Halfling race link to a character sheet, it automatically sets that character's size to Small and applies the appropriate bonuses. Is there a way to set a custom race to have multiple possible Sizes to choose from? Or would I need to make multiple Race options like Human(small), Human(Medium), Human(Large), etc.

damned
April 21st, 2018, 14:21
zaigadeke give the code above a go - see what happens.

zaigadeke
April 21st, 2018, 16:24
That's what I meant when I said I fiddled with stuff. I tried setting a static number to test it, I tried replacing that bit with the code for the Listen skill-check, I tried calling the skill in similar syntax to the "attackbonus.melee.total". The results either had too many errors to reload the ruleset, or didn't do anything.

That's what I'm asking, is there a known syntax or whatever that would allow me to pull the total bonus modifier from a Skill and put it there.

I wanting to automate as much of the modifier math as I can so I don't have to keep track of it so much in game.

Trenloe
April 21st, 2018, 18:21
source="attackbonus.melee.total" is where the data displayed in that field is stored in the database. If you want that field to link to a different database field, then you need to know the exact FG database path to the data.

Skill bonuses are stored in skilllist.id-XXXXX.total - where XXXXX is a unique 5 digit number.

However, there are a few of gotchas -
1) You'll need to change the similar field on the combat tab - which has further modifiers. You may want to look at substituting the stat bonus here for the skill total - then you can have miscellaneous modifiers.
2) When doing a roll from this field (double-clicking on it) the getBaseAttackRollStructures function in campaign\scripts\manager_char.lua goes to the attackbonus.melee.total database field. This field is no longer being populated if you change the XML source to look somewhere else.
3)And also be aware that ability effects (STR, DEX, etc.) are coded to affect attack chances too.

So, there is a lot of code you're going to have to adjust at various points in the FG code. And these could get overwritten/break with future FG updates. It's really a lot of work, with possibly a lot of future pain.

If you *really* want to do this (and I mean - *really* want to do it), then what I'd recommend is that you start by changing the attribute bonus field in the combat tab to be linked to the skill you want to use as the base bonus (instead of the attribute). Then then you'll need to adjust the layout/code so that the default ability bonus is not used in the calculations in the "number_charmeleetotal" control template - which will need some further coding. And then you need to be aware of STR or DEX effects auto applying to attack rolls...