Senior Member
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 226
|
Hi everyone, thanks to the invaluable help of the editor community, I have been able to fix about half of my bug list for my custom class on my own. It was a lot of trial and error, but I eventually arrived at a solution, and I did many happy dances.
But that still leaves 9 bugs in the class that I am at a loss on how to correct (or in some cases, even how to script). 'If' statements worked out okay for me, but foreach statements are still not sinking in. If I could humbly ask for the communities help (and guidance) on how to fix these, I will gratefully share my work with any who want a copy. I can't promise elegant code, but it will hopefully work... Thanks everyone! |
#1 |
Senior Member
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 226
|
Bug #1:
I want to code an ability that grants a +1 competence bonus to AC and saving throws to any creature that the character uses as a mount. I recognize that mounts fall into the gizmo category, but if a mount is not added to the character, I get error messages. Any ideas on how to make the bonus conditional based on whether a mount is added or not? Gracias! |
#2 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
On the conditions tab there is a "mounted" condition, which points at any creature the hero is currently riding. You can transition from there to the other hero and make changes as necessary. Here is an example, from the Cavalier's Mounted Mastery ability:
Code:
~ get the strength bonus of our current mount if (hero.child[pstMounted].field[pMount].ischosen <> 0) then field[abValue3].value += hero.child[pstMounted].field[pMount].chosen.minion.child[aSTR].field[aModBonus].value endif |
#3 |
Senior Member
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 226
|
Quote:
Code:
~ Calculate bonus field[abValue2].value += round(field[xTotalLev].value / 4, 0, -1) + 1 ~ Add AC bonus to mount if hero is mounted. if (hero.child[pstMounted].field[pMount].ischosen <> 0) then hero.child[pstMounted].field[pMount].chosen.minion.child[ArmorClass].field[BonComp].value += field[abValue2].value endif |
|
#4 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
Well, timing is the first thing that comes to mind. When are you running the script?
Also, mind your bonus types and stacking. |
#5 |
Senior Member
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 226
|
AAARRRGGGGHHHH!!!! I hate when I forget to check the timing. Changing it from Final/15000 to Post-Attributes/11000 did the trick. Thanks for the millionth save, Aaron!
|
#6 |
Senior Member
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 226
|
Onward and upward!
Next issue: Class special ability grants the Amateur Gunslinger feat, and creates a Grit pool with a maximum grit point total of 1+INT modifier. I copied the Amateur Gunslinger feat, changed it so that INT is the attribute modifier, and the Amateur Gunslinger tab appeared, along with all Deeds that qualify as per the feat. I then thought that maybe I needed to copy the Grit ability so that I could change the trkMax field. Did that, changed the attribute modifier to INT, set trkMax to aINT value, but grit is still tracking based on WIS instead of INT. The code I am using is: Code:
hero.child[trkGrit].field[trkMax].value += hero.child[aINT].field[aBonus].value field[abText].text = hero.childfound[trkGrit].field[trkMax].value Shalom. |
#7 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
Grit is a bit special because there are several pools which combine with it (luck and panache), so there are a series of Helper tags which govern how it works. You can copy trkGrit to see how it is calculating charges and based on what. Or take a look at the Holy Grit class ability, which switches grit to be based on Charisma.
|
#8 |
Senior Member
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 226
|
Quote:
|
|
#9 |
Senior Member
Join Date: Jul 2008
Posts: 1,321
|
It's in the Helper Tags on the Bootstrap trkGrit: GrtUseCHA
Currently Running: Pathfinder Second Edition Currently Playing: Pathfinder First Edition, Star Trek Adventures Former HL Games: D&D 4e & 5e, Mutants & Masterminds 2E & 3E, Savage Worlds |
#10 |
|
|