The way I read it is as this...
Benefit: The abilities of your animal companion or familiar are calculated as though your class were four levels higher, to a maximum
bonus equal to your character level. If you have more than one animal companion or familiar, choose one to receive this benefit. If you lose or dismiss an animal companion or familiar, you may apply this feat to the replacement creature.
The
Bonus to how your animal companion is calculated cannot exceed your character level. So a 5th level ranger who normally has a 2nd level Animal Companion now has a 5th level companion (I'll admit there is some ambiguity here, cuz it could be read as him having a 6th level companion too, since the +4 bonus does not exceed his character level of 4, but I know that can't be the case. I also see the case for not improving at all without non AC class levels, but since that is open to debate, its up to the GM

)
Anyways I am going with my interpretation and I just wanted to ask for some help coding.
Here is what I have that works fine for ranger.
Code:
~if the user hasn't selected a class to apply this feat to,
~there's nothing more we can do, so just get out
doneif (field[usrChosen1].ischosen = 0)
var bonus as number
bonus = 0
if (hero.childfound[cAnimClass].field[CompClAdj].value < #totallevelcount[]) then
bonus = (#totallevelcount[] - 1)
endif
bonus = minimum(bonus,4)
hero.childfound[cAnimClass].field[CompClAdj].value += bonus
To get it to work with a druid I would need it to calculate the bonus as (#totallevelcount[] - 4). So, my question is, how would I check what the user has chosen in the field[usrChosen1]? And if a ranger chose beastmaster as his alternate class feature would that show up the same as regular ranger in what was chosen? I wanna do something like
Code:
~pseudocode
if (field[usrChosen1] = Ranger) then
run this code etc.
if (field[usrChosen1] = Druid) then
run this code etc.