Senior Member
Join Date: Dec 2011
Posts: 100
|
Quote:
Quote:
In the eval script you want something like: Code:
~ If we're not enabled, get out now doneif (field[pIsOn].value = 0) ~ Give our hero the Epic tag perform hero.assign[Hero.Epic] Quote:
As for progressing classes beyond 20th, I think that would have to be done as separate classes. For example a single class 30th level fighter would actually have 2 classes, Fighter 20 and Epic Fighter 10. I haven't dug deep into HL in a while, but if I remember correctly it limits the number a classes a hero can have so this may be a problem. |
|||
#11 |
Senior Member
Join Date: Jul 2010
Posts: 3,144
|
Quote:
|
|
#12 |
Senior Member
Join Date: Dec 2011
Posts: 100
|
Erin, Illyahr, Sendric, AND ANYONE ELSE INTERESTED
I've started working on a rough bit of script and I wanted to check something with you and the community. From what I can find of the Epic rules there is a little bit of ambiguity. Everything is fine if you are playing one of the base races with standard classes for 1-20th, but it gets a little foggy when it comes to non-standard races and templates that may add hit dice or level adjustments. Therefore I wanted to ask what people think: When should the epic progress start? a) ECL > 20 |
#13 |
Senior Member
Join Date: Dec 2011
Posts: 100
|
ok, I thought I'd put this little bit of code (for certain definitions of little) up for those more skilled with coding to look at and see if they could find a better way of doing everything so that it would not be quite as intensive.
Note that this is rather ugly so those of you who are code-aphobic, you may want to look away. As it stands, I'm thinking I may need to create separate specials to run the code for the sake of space and timing, but that could end up drastically increasing the number of foreach statements and therefore processing requirements. Code:
~ If we're not enabled, get out now doneif (field[pIsOn].value = 0) ~ If we're not epic, lets stop this now doneif (herofield[tTotLevel].value < 21) ~ for the easy part, lets add the epic tag to our hero perform hero.assign[Hero.Epic] ~ now the hard part, identifying our bonuses before epic. ~ first we are going to set up a bunch of veriables we can reference later var LevCnt as number var totHD as number var bBAB as number var bFort as number var bRef as number var bWill as number var Class0 as number var c0BAB as number var c0Fort as number var c0Ref as number var c0Will as number var Class1 as number var c1BAB as number var c1Fort as number var c1Ref as number var c1Will as number var Class2 as number var c2BAB as number var c2Fort as number var c2Ref as number var c2Will as number var Class3 as number var c3BAB as number var c3Fort as number var c3Ref as number var c3Will as number var Class4 as number var c4BAB as number var c4Fort as number var c4Ref as number var c4Will as number var Class5 as number var c5BAB as number var c5Fort as number var c5Ref as number var c5Will as number ~ at this time HL still limits us to 5 classes + 1 Race so I will stop here var epcLev as number var epcAtk as number var epcSave as number ~ now we will start looking at our classes/races/templates and try to retrieve information foreach pick on hero where (field[cIndex].value < 20) ~ don't do anything if we have already reached a epic if (LevCnt < 20) then ~ We need to identify what is at each index so we can get the information we need if (tagcount[Component.BaseRace] <> 0) then ~ If it is a race at this index then we can pull the specific values from the race bBAB += eachpick.field[rAttack].value bFort += eachpick.field[rFort].value bRef += eachpick.field[rRef].value bWill += eachpick.field[rWill].value ~ For now I am using the totHD and LevCnt to help me keep track of our progress and so we can stop the foreach if we reach epic early. totHD += eachpick.field[rHitDice].value LevCnt += eachpick.field[cLevelAdj].value endif ~ if it is not a race we need to know if it is a class or a template elseif (tagcount[Component.BaseClass] <> 0) then ~ HL calculates the BAB and saves based on number of total levels in a given class. So we will have to figure out how many levels our hero has of each class before going epic so we can calculate it later. ~ from what I can find, HL only supports up to 5 classes + 1 racial for a total of 6 class tags in total if (eachpick.field[cHelpIndex].value = 0) then Class0 += 1 elseif (eachpick.field[cHelpIndex].value = 1) then Class1 += 1 elseif (eachpick.field[cHelpIndex].value = 2) then Class2 += 1 elseif (eachpick.field[cHelpIndex].value = 3) then Class3 += 1 elseif (eachpick.field[cHelpIndex].value = 4) then Class4 += 1 elseif (eachpick.field[cHelpIndex].value = 5) then Class5 += 1 endif ~ again, we want to add to our totals here so we will know when to stop the foreach totHD += 1 LevCnt += 1 ~ The other major option is templates. Many add level adjustments, and some add to our HD or base saves elseif (tagcount[Component.BaseTemp] <> 0) then ~ much like races, the relevant bonuses can be pulled straight from fields on the pick. bBAB += eachpick.field[tmAttack].value bFort += eachpick.field[tmFort].value bRef += eachpick.field[tmRef].value bWill += eachpick.field[tmWill].value ~ For now I am using the totHD and LevCnt to help me keep track of our progress and so we can stop the foreach if we reach epic early. totHD += eachpick.field[tmHitDice].value LevCnt += eachpick.field[cLevelAdj].value endif endif endif nexteach ~ now to start our class calculations ~ we will start with the FIRST class space if (Class0 > 0) then foreach pick on hero where (field[cClsIndex].value = 0) ~ calculate our BAB bonus from this class ~ if we have good bab in the class then calculate our bonus as equal our level in class if (eachpick.tagcount[cAttack.Good] <> 0) then c0BAB = Class0 ~ if we do not have good BAB, check if we have medium and calculate our bonus as 3/4 class elseif (eachpick.tagcount[cAttack.Medium] <> 0) then c0BAB = round((Class0 * 3)/4,0,-1) ~ if we do not have good or medium BAB, check if we have Poor bab and calculate our bonus as 1/2 class elseif (eachpick.tagcount[cAttack.Poor] <> 0) then c0BAB = round(Class0 /2,0,-1) ~ if we do not have good, medium, or poor BAB tags we may be a race or template and have already gathered the BAB above else c0BAB = 0 endif ~ next we will start on the Fort save ~ if we have a good save, calculate our bonus if (eachpick.tagcount[cFort.Good] <> 0 then c0Fort = 2 + round(Class0/2,0,-1) ~ if we do not have a good tag then check if we have a poor Fort elseif (eachpick.tagcount[cFort.Poor] <> 0) then c0Fort = round(Class0/3,0,-1) ~ if we do not have a good or poor Fort tag we may be a race or template and have already gathered the bonus above else c0Fort = 0 endif ~ next we will start on the Reflex save ~ if we have a good save, calculate our bonus if (eachpick.tagcount[cRef.Good] <> 0 then c0Ref = 2 + round(Class0/2,0,-1) ~ if we do not have a good tag then check if we have a poor Reflex elseif (eachpick.tagcount[cRef.Poor] <> 0) then c0Ref = round(Class0/3,0,-1) ~ if we do not have a good or poor Reflex tag we may be a race or template and have already gathered the bonus above else c0Ref = 0 endif ~ next we will start on the Will save ~ if we have a good save, calculate our bonus if (eachpick.tagcount[cWill.Good] <> 0 then c0Will = 2 + round(Class0/2,0,-1) ~ if we do not have a good tag then check if we have a poor Will elseif (eachpick.tagcount[cWill.Poor] <> 0) then c0Will = round(Class0/3,0,-1) ~ if we do not have a good or poor Will tag we may be a race or template and have already gathered the bonus above else c0Will = 0 endif nexteach endif ~ now we move on to the next index ~ start looking at our SECOND class space if (Class1 > 0) then foreach pick on hero where (field[cClsIndex].value = 1) ~ calculate our BAB bonus from this class ~ if we have good bab in the class then calculate our bonus as equal our level in class if (eachpick.tagcount[cAttack.Good] <> 0) then c1BAB = Class1 ~ if we do not have good BAB, check if we have medium and calculate our bonus as 3/4 class elseif (eachpick.tagcount[cAttack.Medium] <> 0) then c1BAB = round((Class1 * 3)/4,0,-1) ~ if we do not have good or medium BAB, check if we have Poor bab and calculate our bonus as 1/2 class elseif (eachpick.tagcount[cAttack.Poor] <> 0) then c1BAB = round(Class1 /2,0,-1) ~ if we do not have good, medium, or poor BAB tags we may be a race or template and have already gathered the BAB above else c1BAB = 0 endif ~ next we will start on the Fort save ~ if we have a good save, calculate our bonus if (eachpick.tagcount[cFort.Good] <> 0 then c1Fort = 2 + round(Class1/2,0,-1) ~ if we do not have a good tag then check if we have a poor Fort elseif (eachpick.tagcount[cFort.Poor] <> 0) then c1Fort = round(Class1/3,0,-1) ~ if we do not have a good or poor Fort tag we may be a race or template and have already gathered the bonus above else c1Fort = 0 endif ~ next we will start on the Reflex save ~ if we have a good save, calculate our bonus if (eachpick.tagcount[cRef.Good] <> 0 then c1Ref = 2 + round(Class1/2,0,-1) ~ if we do not have a good tag then check if we have a poor Reflex elseif (eachpick.tagcount[cRef.Poor] <> 0) then c1Ref = round(Class1/3,0,-1) ~ if we do not have a good or poor Reflex tag we may be a race or template and have already gathered the bonus above else c1Ref = 0 endif ~ next we will start on the Will save ~ if we have a good save, calculate our bonus if (eachpick.tagcount[cWill.Good] <> 0 then c1Will = 2 + round(Class1/2,0,-1) ~ if we do not have a good tag then check if we have a poor Will elseif (eachpick.tagcount[cWill.Poor] <> 0) then c1Will = round(Class1/3,0,-1) ~ if we do not have a good or poor Will tag we may be a race or template and have already gathered the bonus above else c1Will = 0 endif nexteach endif ~ now we move on to our THIRD class space if (Class2 > 0) then foreach pick on hero where (field[cClsIndex].value = 2) ~ calculate our BAB bonus from this class ~ if we have good bab in the class then calculate our bonus as equal our level in class if (eachpick.tagcount[cAttack.Good] <> 0) then c2BAB = Class2 ~ if we do not have good BAB, check if we have medium and calculate our bonus as 3/4 class elseif (eachpick.tagcount[cAttack.Medium] <> 0) then c2BAB = round((Class2 * 3)/4,0,-1) ~ if we do not have good or medium BAB, check if we have Poor bab and calculate our bonus as 1/2 class elseif (eachpick.tagcount[cAttack.Poor] <> 0) then c2BAB = round(Class2 /2,0,-1) ~ if we do not have good, medium, or poor BAB tags we may be a race or template and have already gathered the BAB above else c2BAB = 0 endif ~ next we will start on the Fort save ~ if we have a good save, calculate our bonus if (eachpick.tagcount[cFort.Good] <> 0 then c2Fort = 2 + round(Class2/2,0,-1) ~ if we do not have a good tag then check if we have a poor Fort elseif (eachpick.tagcount[cFort.Poor] <> 0) then c2Fort = round(Class2/3,0,-1) ~ if we do not have a good or poor Fort tag we may be a race or template and have already gathered the bonus above else c2Fort = 0 endif ~ next we will start on the Reflex save ~ if we have a good save, calculate our bonus if (eachpick.tagcount[cRef.Good] <> 0 then c2Ref = 2 + round(Class2/2,0,-1) ~ if we do not have a good tag then check if we have a poor Reflex elseif (eachpick.tagcount[cRef.Poor] <> 0) then c2Ref = round(Class2/3,0,-1) ~ if we do not have a good or poor Reflex tag we may be a race or template and have already gathered the bonus above else c2Ref = 0 endif ~ next we will start on the Will save ~ if we have a good save, calculate our bonus if (eachpick.tagcount[cWill.Good] <> 0 then c2Will = 2 + round(Class2/2,0,-1) ~ if we do not have a good tag then check if we have a poor Will elseif (eachpick.tagcount[cWill.Poor] <> 0) then c2Will = round(Class2/3,0,-1) ~ if we do not have a good or poor Will tag we may be a race or template and have already gathered the bonus above else c2Will = 0 endif nexteach endif ~ now we move on to our FOURTH class space if (Class3 > 0) then foreach pick on hero where (field[cClsIndex].value = 3) ~ calculate our BAB bonus from this class ~ if we have good bab in the class then calculate our bonus as equal our level in class if (eachpick.tagcount[cAttack.Good] <> 0) then c3BAB = Class3 ~ if we do not have good BAB, check if we have medium and calculate our bonus as 3/4 class elseif (eachpick.tagcount[cAttack.Medium] <> 0) then c3BAB = round((Class3 * 3)/4,0,-1) ~ if we do not have good or medium BAB, check if we have Poor bab and calculat our bonus as 1/2 class elseif (eachpick.tagcount[cAttack.Poor] <> 0) then c3BAB = round(Class3 /2,0,-1) ~ if we do not have good, medium, or poor BAB tags we may be a race or template and have already gathered the BAB above else c3BAB = 0 endif ~ next we will start on the Fort save ~ if we have a good save, calculate our bonus if (eachpick.tagcount[cFort.Good] <> 0 then c3Fort = 2 + round(Class3/2,0,-1) ~ if we do not have a good tag then check if we have a poor Fort elseif (eachpick.tagcount[cFort.Poor] <> 0) then c3Fort = round(Class3/3,0,-1) ~ if we do not have a good or poor Fort tag we may be a race or template and have already gathered the bonus above else c3Fort = 0 endif ~ next we will start on the Reflex save ~ if we have a good save, calculate our bonus if (eachpick.tagcount[cRef.Good] <> 0 then c3Ref = 2 + round(Class3/2,0,-1) ~ if we do not have a good tag then check if we have a poor Reflex elseif (eachpick.tagcount[cRef.Poor] <> 0) then c3Ref = round(Class3/3,0,-1) ~ if we do not have a good or poor Reflex tag we may be a race or template and have already gathered the bonus above else c3Ref = 0 endif ~ next we will start on the Will save ~ if we have a good save, calculate our bonus if (eachpick.tagcount[cWill.Good] <> 0 then c3Will = 2 + round(Class3/2,0,-1) ~ if we do not have a good tag then check if we have a poor Will elseif (eachpick.tagcount[cWill.Poor] <> 0) then c3Will = round(Class3/3,0,-1) ~ if we do not have a good or poor Will tag we may be a race or template and have already gathered the bonus above else c3Will = 0 endif nexteach endif ~ now we move on to our FIFTH class space if (Class4 > 0) then foreach pick on hero where (field[cClsIndex].value = 4) ~ calculate our BAB bonus from this class ~ if we have good bab in the class then calculate our bonus as equal our level in class if (eachpick.tagcount[cAttack.Good] <> 0) then c4BAB = Class4 ~ if we do not have good BAB, check if we have medium and calculate our bonus as 3/4 class elseif (eachpick.tagcount[cAttack.Medium] <> 0) then c4BAB = round((Class4 * 3)/4,0,-1) ~ if we do not have good or medium BAB, check if we have Poor bab and calculate our bonus as 1/2 class elseif (eachpick.tagcount[cAttack.Poor] <> 0) then c4BAB = round(Class4 /2,0,-1) ~ if we do not have good, medium, or poor BAB tags we may be a race or template and have already gathered the BAB above else c4BAB = 0 endif ~ next we will start on the Fort save ~ if we have a good save, calculate our bonus if (eachpick.tagcount[cFort.Good] <> 0 then c4Fort = 2 + round(Class4/2,0,-1) ~ if we do not have a good tag then check if we have a poor Fort elseif (eachpick.tagcount[cFort.Poor] <> 0) then c4Fort = round(Class4/3,0,-1) ~ if we do not have a good or poor Fort tag we may be a race or template and have already gathered the bonus above else c4Fort = 0 endif ~ next we will start on the Reflex save ~ if we have a good save, calculate our bonus if (eachpick.tagcount[cRef.Good] <> 0 then c4Ref = 2 + round(Class4/2,0,-1) ~ if we do not have a good tag then check if we have a poor Reflex elseif (eachpick.tagcount[cRef.Poor] <> 0) then c4Ref = round(Class4/3,0,-1) ~ if we do not have a good or poor Reflex tag we may be a race or template and have already gathered the bonus above else c4Ref = 0 endif ~ next we will start on the Will save ~ if we have a good save, calculate our bonus if (eachpick.tagcount[cWill.Good] <> 0 then c4Will = 2 + round(Class4/2,0,-1) ~ if we do not have a good tag then check if we have a poor Will elseif (eachpick.tagcount[cWill.Poor] <> 0) then c4Will = round(Class4/3,0,-1) ~ if we do not have a good or poor Will tag we may be a race or template and have already gathered the bonus above else c4Will = 0 endif nexteach endif ~ now we move on to our SIXTH class space if (Class5 > 0) then foreach pick on hero where (field[cClsIndex].value = 5) ~ calculate our BAB bonus from this class ~ if we have good bab in the class then calculate our bonus as equal our level in class if (eachpick.tagcount[cAttack.Good] <> 0) then c5BAB = Class5 ~ if we do not have good BAB, check if we have medium and calculate our bonus as 3/4 class elseif (eachpick.tagcount[cAttack.Medium] <> 0) then c5BAB = round((Class5 * 3)/4,0,-1) ~ if we do not have good or medium BAB, check if we have Poor bab and calculate our bonus as 1/2 class elseif (eachpick.tagcount[cAttack.Poor] <> 0) then c5BAB = round(Class5 /2,0,-1) ~ if we do not have good, medium, or poor BAB tags we may be a race or template and have already gathered the BAB above else c5BAB = 0 endif ~ next we will start on the Fort save ~ if we have a good save, calculate our bonus if (eachpick.tagcount[cFort.Good] <> 0 then c5Fort = 2 + round(Class5/2,0,-1) ~ if we do not have a good tag then check if we have a poor Fort elseif (eachpick.tagcount[cFort.Poor] <> 0) then c5Fort = round(Class5/3,0,-1) ~ if we do not have a good or poor Fort tag we may be a race or template and have already gathered the bonus above else c5Fort = 0 endif ~ next we will start on the Reflex save ~ if we have a good save, calculate our bonus if (eachpick.tagcount[cRef.Good] <> 0 then c5Ref = 2 + round(Class5/2,0,-1) ~ if we do not have a good tag then check if we have a poor Reflex elseif (eachpick.tagcount[cRef.Poor] <> 0) then c5Ref = round(Class5/3,0,-1) ~ if we do not have a good or poor Reflex tag we may be a race or template and have already gathered the bonus above else c5Ref = 0 endif ~ next we will start on the Will save ~ if we have a good save, calculate our bonus if (eachpick.tagcount[cWill.Good] <> 0 then c5Will = 2 + round(Class5/2,0,-1) ~ if we do not have a good tag then check if we have a poor Will elseif (eachpick.tagcount[cWill.Poor] <> 0) then c5Will = round(Class5/3,0,-1) ~ if we do not have a good or poor Will tag we may be a race or template and have already gathered the bonus above else c5Will = 0 endif nexteach endif ~ hopefully, if we have done everything correct so far we can calculate our total pre-epic base attack and saves bBAB = bBAB + c0BAB + c1BAB + c2BAB + c3BAB + c4BAB + c5BAB bFort = bFort + c0Fort + c1Fort + c2Fort + c3Fort + c4Fort + c5Fort bRef = bRef + c0Ref + c1Ref + c2Ref + c3Ref + c4Ref + c5Ref bWill = bWill + c0Will + c1Will + c2Will + c3Will + c4Will + c5Will ~ now the easy part epcLev = herofield[tTotLevel].value - 20 epcAtk = round(epcLev/2,0,1) epcSave = round(epcLev/2,0,-1) ~ ok, we have our pre epic bonuses and our post epic bonuses, now to put them in the right places hero.child[Attack].field[tAtkBase].value = bBAB hero.child[Attack].field[tAtkEpic].value = epcAtk hero.child[vFort].field[vBase].value = bFort + epcSave hero.child[vRef].field[vBase].value = bRef + epcSave hero.child[vWill].field[vBase].value = bWill + epcSave |
#14 |
Senior Member
Join Date: Jul 2010
Posts: 3,144
|
Quote:
|
|
#15 |
Senior Member
Join Date: Dec 2011
Posts: 100
|
Quote:
Apparently the HL total level count macro counts racial HD and LA along with class levels, but does not appear to count templates at all. This presents the problem of templates that add HD such as afflicted were<Pick Your Animal>. It might be easier to create a radio button section in the hero configuration for selecting Epic Progress (Default-none, Class Only, HD Only, Full ECL), and set the code up for each of these with source tags. Is there a way to pull a pick based on an index value without using foreach, cause that would simplify the code a lot. Actually, I should probably just ask that in a new thread so if there is an a way, we can find it again later. |
|
#16 |
Senior Member
Join Date: Feb 2013
Posts: 357
|
Quote:
I could be wrong, but I think total Hit Die count (class + racial) should be the only factor. |
|
#17 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Quote:
Code:
foreach pick on hero where (field[cIndex].value < 20) Limit the foreach scope like this: Code:
foreach pick in hero from BaseClHelp where "TagGroup.Tag" or foreach pick in hero from BaseClHelp Please note I can't remember if BaseClHelp is correct for d20 as I am not near HL. You can see which "Components" make up a Pick by looking at its tags and the 'component.?' group section. Hero Lab Resources: Pathfinder - d20pfsrd and Pathfinder Pack Setup 3.5 D&D (d20) - Community Server Setup 5E D&D - Community Server Setup Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources. Created by the community for the community - Realm Works kickstarter backer (Alpha Wolf) and Beta tester.- d20 HL package volunteer editor. |
|
#18 |
Senior Member
Join Date: Dec 2011
Posts: 100
|
Quote:
Quote:
Again, I'm not familiar enough with the structure of foreach, and how they are handled in the system. For my initial endeavor on this project I wanted to limit the scope to only the first 20 "class" entries. The likely components would be BaseClass, BaseRace, or BaseTemp. If there are others I have not noticed them yet. My concern is that if I set it up for those components it would run through all the class levels (out to theoretically 100), pulling information that it should not. The other question is what order do foreach loops approach data? I would assume following an index somewhere, but then the question goes, could classes end up on the search index in a different order then their class index on the hero? For example, could a hero's 30th class level end up being searched before their 3rd class level. I suppose I could restructure it as: Code:
foreach pick in hero from BaseClHelp if (eachpick.field[cIndex].value = 1) then .... elseif (eachpick.field[cIndex].value = 2) then etc... By the way, if the first foreach bothers you, the next 6 all have a duplicate structure to each other. More then the first, I feel that those should be able to be replaced since the class helpers are part of an array, but again, I've only dealt with array values in script by using the copy/paste approach. |
||
#19 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
A class is made up of "TWO" pieces or Things. The Class Helper and the Class. The Class Helper only exists "ONE" time no matter the level of the character. Where a Class Pick exists each time you select the class on the Basics tab. So a 5th level wizard has ONE Pick named cHelpWiz and 5 picks named cWizard (so 6 total picks on the hero).
When I get home I can get you the correct component name for class helpers. But to find it yourself add 1 level of wizard to your a blank character. Go to the develop menu and look at the "tags" and look for "cHelpWiz". If you look at the "tags" you can see the components and one is named "Class Helper". Its BaseClHelp in Pathfinder/5e and I thought that naming convention came from d20. My next question in all this is do you need to run super early in script timing? Otherwise class level and racial hit dice are all tags on the "hero" you can simply count. Code:
var classlevel as number classlevel = hero.tagcount[Classes.?] If you are needing to run "super" early like First/10000 or earlier then and only then would you need to do a foreach loop to try and count classes. This is because the "Classes.?" tags have not yet been forwarded to the hero. Even then I am thinking that the Class Helpers have the total class level already done and you only need to total the couple class helper Picks not the "Class" components on the character. In example the character has 5 levels of Wizard and 1 of Rogue. Your foreach loop and find cHelpWiz with a class level of 5 and cHelpRog has a class level of 1. Boom now you know you have 6 total levels. Quote:
Code:
foreach pick in hero from LETTERS Hero Lab Resources: Pathfinder - d20pfsrd and Pathfinder Pack Setup 3.5 D&D (d20) - Community Server Setup 5E D&D - Community Server Setup Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources. Created by the community for the community - Realm Works kickstarter backer (Alpha Wolf) and Beta tester.- d20 HL package volunteer editor. |
|
#20 |
Thread Tools | |
Display Modes | |
|
|