Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
Sphynx
Member
 
Join Date: Apr 2007
Posts: 60

Old December 6th, 2015, 06:15 AM
Rather than just divide the druid level amongst the animal companions, which we all know from experience is a terrible thing to do... I'm wanting to implement an equally simple system that won't destroy the archetype...

I'm wanting to set all the companion levels to be equal to:

Code:
var totalComps as number
var compLevel as number
var myLevel as number

totalComps = hero.childcount[Hero.MultComp]
myLevel = field[xTotalLev].value
compLevel = myLevel

if (totalComps > 1) then 
    compLevel =  myLevel - totalComps
endif

if (compLevel < 1) then
    compLevel = 1
endif
Or something to that effect... I however can't find anywhere where the pack lord's animal-companion-levels are set. It's not on the archetype, it's not in the companion, it's not in the Pack Bond, and I can't even find Nature Bond...

So, is this hard-coded stuff that can't be changed? It's not a huge problem since all it does is make some text red if you ignore the current rules (so char-gen is still possible), but was hoping to get my player out of the red if possible. :P
Sphynx is offline   #1 Reply With Quote
AndrewD2
Senior Member
 
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975

Old December 6th, 2015, 09:58 AM
As opposed trying to put what you want into code to explain, can you just explain what you want without the code?

It seems like you're trying to make your companion level equal to your druid level minus the number of companions.

If you have Rite Publishing's The Secret of Adventuring the Ranger's Pack Hunter archetype deals with having multiple companions and different levels than normally calculated for multiples.
AndrewD2 is offline   #2 Reply With Quote
Aaron
Senior Member
 
Join Date: Oct 2011
Posts: 6,793

Old December 6th, 2015, 04:31 PM
I think your main issue here is you're trying to get the number of animal companions on the hero by counting the Hero.MultiComp tags. There will only ever be one of those.

Instead, you'll likely have to foreach through all cAnimMult picks on the hero, count them, and then use that to calculate how many total levels should be spread among all the companions as well as what you want each companion level to be. Override the cAnimClass pick's CompClLev field with your total levels value, and add a second eval rule which foreaches through all cAnimMults on the hero and complains if their UserLevel field is set to an incorrect value.

Hope that helps!
Aaron is offline   #3 Reply With Quote
Sphynx
Member
 
Join Date: Apr 2007
Posts: 60

Old December 7th, 2015, 01:21 AM
Thanks to both of you for your responses. Unfortunately, I do not have that package from Rite's Publishing, which is why I tried to get my answers from the Pack Lord archetype.

Aaron, the scripting suggestions have been written in, but I seem to be doing it in the wrong place. I put it in a new Archetype (Pack Lady), but it generates the following error:
attempt to access field 'xTotalLev' that does not exist for thing 'arPackLady'

I changed the Pack Lady to use a new PackBond2 and placed the eval script there instead, which stopped the error, but had no visible effect. :/

Code:
var myLevel as number
var compLevel as number
var totalComps as number

totalComps = 0
compLevel = myLevel
myLevel = field[xTotalLev].value

foreach pick in hero from MultCompan
	totalComps += 1
nexteach


if (totalComps > 1) then 
    compLevel =  myLevel - totalComps
endif

if (compLevel < 1) then
    compLevel = 1
endif

hero.childfound[cAnimClass].field[CompClLev].value = compLevel
I assume that the problem is in that last line, which should undoubtedly be a foreach loop, but trying it on the MultiComp again didnt' work out either. :/

Again, thanks for your help so far, though if you could assist further, it would be greatly appreciated.
Sphynx is offline   #4 Reply With Quote
AndrewD2
Senior Member
 
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975

Old December 7th, 2015, 08:19 AM
xTotalLev doesn't exist on an archetype. What you'll want to use is

Code:
linkage[varies].field[cTotalLev].value
AndrewD2 is offline   #5 Reply With Quote
Aaron
Senior Member
 
Join Date: Oct 2011
Posts: 6,793

Old December 7th, 2015, 03:30 PM
As AndrewD2 says, you'd need to transition from the archetype, to the class to detect the level. Here is how I would do it.

Eval Script at First 490 (might need to shift this later)
Code:
doneif (islinkage[varies] = 0)

var numcomp as number

foreach pick in hero from MultCompan
 numcomp += 1
 nexteach

~ This variable stores the number of levels each companion should have.
var eachcomplv as number

~ The calculation is Class Level - (#companions - 1)
~ For example, a 10th level druid with 1 animal companion has each companion at 10th level. 2 animal companions lowers each by 1 level (so they are 9th level), 3 = 8th level and so on.
eachcomplv = linkage[varies].field[cTotalLev].value - maximum(numcomp - 1, 0)

~ Our total number of levels to be divided (evenly) among the animal companions is each companion's level times the number of companions.
hero.childfound[cAnimClass].field[CompClLev].value = (eachcomplv * numcomp)
Then an eval rule at Validation 10000
Code:
doneif (islinkage[varies] = 0)

var numcomp as number

foreach pick in hero from MultCompan
 numcomp += 1
 nexteach

~ This variable stores the number of levels each companion should have.
var eachcomplv as number

~ The calculation is Class Level - (#companions - 1)
~ For example, a 10th level druid with 1 animal companion has each companion at 10th level. 2 animal companions lowers each by 1 level (so they are 9th level), 3 = 8th level and so on.
eachcomplv = linkage[varies].field[cTotalLev].value - maximum(numcomp - 1, 0)

~ This variable tracks whether we have one or more companion not at the appropriate level.
var mismatch as number

foreach pick in hero from MultCompan
  if (eachpick.field[UserLevel].value <> eachcomplv) then
    mismatch = 1
    endif
  nexteach

validif (mismatch = 0)
Not tested, tweak as necessary.
Aaron is offline   #6 Reply With Quote
Sphynx
Member
 
Join Date: Apr 2007
Posts: 60

Old December 8th, 2015, 06:39 AM
Again, thank you to both of you, and so terribly sorry that you guys are practically writing this for me.

The only current problem is the validif, which gives the following syntax error upon compiling:

-> Script does not support the '@valid' special symbol so use of 'validif' is illegal

I commented it out, and the rest of the script compiled without error, so I guess I just need the validate. :/
Sphynx is offline   #7 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old December 8th, 2015, 06:55 AM
Pay close attention to what Aaron says just before each script - does he say to make that one an Eval Script or an Eval Rule?
Mathias is online now   #8 Reply With Quote
Sphynx
Member
 
Join Date: Apr 2007
Posts: 60

Old December 8th, 2015, 07:22 AM
Thanks Mathias, that got rid of the error, but no effect on the red.

I'm starting to think that the validation almost has to happen in the Animal Companion, not in the Archetype (after all, the Archetype is valid...). I'll try that next and see how that goes.
Sphynx is offline   #9 Reply With Quote
Sphynx
Member
 
Join Date: Apr 2007
Posts: 60

Old December 8th, 2015, 07:43 AM
Animal Companion is not added to the Druid Class.

The "Custom Ability" for "Nature Bond" is added

Nature Bond is not a Class Special nor a Custom Ability (so can't find it to copy it to add my version of Animal Companion).

Animal Companion is under Companion Type, but no way to tell the Archetype (or the Nature Bond) to pick a different/copied Animal Companion.

Not that I'm giving up, but I understand if too much time is being spent on this silly quest. I don't have a perceived notion that this is something needing to be fixed. I'll keep trying to work on it, but don't feel any obligation to make this work. (though if I'm right, and it is impossible with the app as-is, letting me know so I spend less time on it would be cool :P)
Sphynx is offline   #10 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 03:13 PM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.