Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Another note about class and class helper. The Class Helper has 99% of the information anyone will want when dealing with the class (BAB, Saves, Skill Points, Feats, Languages, custom abilities, Spell per day, spells known). The only thing that is helpful on the Class pick is the hit points that where at taken each level.
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. |
#21 |
Senior Member
Join Date: Dec 2011
Posts: 100
|
The problem with using the cHelper pick is that it has the totals. What we need is a subset of that based on an arbitrary point in history that is only monitored (as far as I can tell) by the cClass picks.
for example, lets say we have a 40th level hero as follows: Fighter 20, Wizard 20. Based on the cHelp picks we would have a BAB of 30: Fighter: 20 Wizard: 10 However we want the total BAB this hero had at 20th level. Based on the cHelp we know how many total levels of the class we have, when we took our first level and when we took our last; but we do not know when we got those levels. That is why I was looking at the cClass instead of the cHelp to start with. As you mentioned, the hero above would have 1 cHelp for the fighter class, but 20 cFighter listings. Each of the cFighters indicate what level the character was at the point the cFighter level was added. I have not really looked at timing yet, but it has to run after BAB would be calculated, but before it is used in other calculations. We want to change the BAB [tAtkBase] to match the 20th level value we calculate and add an epic attack bonus [tAtkEpic] that would add to our to-hit, but not to our number of attacks. Therefore the total number of attacks the character would have would be stopped at 20th level. Back to our example above, HL would currently give the character 4 attacks on a full attack action (same in pathfinder). This is fine if the character had taken at least 12 levels of fighter before taking his 21st level (12 Ftr + 4 Wiz = 16 BAB). However if the hero did not take at least 2 levels of fighter he would only have 2 attacks a round (1 Ftr + 9 Wiz = 10 BAB) There is a change for the saves as well, but I do not think there are any timing issue with them. |
#22 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Well I do appreciate finally getting the 'problem' you are having. LOL it makes it much easier to try and find a solution!
My next step here is I would have to read up on Epic level rules to even figure out what the expected result is for a character that goes above level 20. Then with "both" of those I maybe able to tweak something in d20 to give an easier result that the "community" could implement then. Something that would prevent the need of 7 foreach loops. One quick thought would be just stopping HL from adding values to saves & BAB once it reaches level 21+. Then in "concept" all the community would need is some logic to "increment" the values once past level 20. Sorry "no" promises but at least I know what to look at. 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. |
#23 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Quote:
Quote:
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. |
||
#24 |
Senior Member
Join Date: Dec 2011
Posts: 100
|
Thanks Shadow. I was hoping to get something loose that could be made available to the community files, but soooooo many ugly foreach statements /__\. I just really wanted a way to avoid those first. Also, I'm sure many people either do not play epic tier or do not use the 3.0/3.5 epic rules so I wanted to make it something people could choose to use for their character, or choose not to.
Quote:
It still has the issue of whether hit dice added by a template, such as the lycanthropes would be counted as racial hit dice. I personally would think so, but again, I'm not sure. At this time though, HL does not appear to treat them that way. There is a listing in the SRD: Quote:
I had a thought while I was looking over the response on the other thread. I've seen some examples of code where, if I understood it correctly, when using a variable as a string you copy a portion of a tag in order to identify another relevant pick or tag. I can see a way of going from the cHelp to the cClass like that. Is there a way to go in the other direction? That might be a way of eliminating many of those foreach loops if we cannot get to the cHelp from the class array index. |
||
#25 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Quote:
Code:
linkage[helper].field[XXXXXX].value 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. |
|
#26 |
Senior Member
Join Date: Dec 2011
Posts: 100
|
Quote:
If we can, we may be able to get this down to a single foreach loop and use this cool new (to me) toy to pull the tags for the calculations. The sample above appears to start from within the pick. For example: Code:
if (eachpick.linkage[helper].tagcount[cAttack.Good] <> 0) then elseif (eachpick.linkage[helper.tagcount[cAttack.Medium] <> 0) then elseif (eachpick.linkage[helper.tagcount[cAttack.Poor] <> 0) then endif |
|
#27 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Quote:
And yes you can do tags or fields against a linkage and a linkage is very low CPU. 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. |
|
#28 |
Senior Member
Join Date: Dec 2011
Posts: 100
|
Realized I missed the brackets after I hit submit, but right now I'm too hyped with the thought of cleaning my code to go back and fix it.
Quote:
OK, I'll spend this evening retooling the code and see if I can cut it down and make it manageable. Hopefully I can have something to share (at least for testing) tomorrow. |
|
#29 |
Senior Member
Join Date: Dec 2011
Posts: 100
|
Help!!!
Ok, I've gotten the code down to one foreach loop, but as Shadow pointed out, the loop doesn't search in any particular order and we really do need the values in order for them to be meaningful. I wrote out the code in a text editor and tried to copy it into HL for testing, but only a small portion of the code would fit in the eval script. I've spent the last couple days trying to shrink it down, but even without information lines (~) it is still well less then half of what I want. I have two thoughts, but I'm not sure if either of them are viable. First: What is making the Foreach soooooo long is the level of redundancy. There is a block of code that is repeated at least 20 times with only a very slight variation based on a value in the eachpick. Code:
if (eachpick.field[cIndex].value = 1) then using values on the eachpick and linkage[helper] calculate values for what the increase to bab and saves as well as HD progression (typically 1 for classes, but may be more for race or template) and put these values into various value fields in special xClsCnt1 endif if (eachpick.field[cIndex].value = 2) then DO IT ALL AGAIN put values in special xClsCnt2 endif etc etc The last entry on the Mathias thread for using math is from Adoxon Quote:
Example: Code:
var index as number var id as string index = eachpick.field[cIndex].value id = "xClsCnt" & index blah blah code blah hero.childfound[id].field.... = data nexteach Second: While trying to find a solution to that id problem above I found lots of references for "findchild". I know foreach is bad for the cpu but what about findchild? If it is not as bad, then running a findchild in each of the specials might be a better way to go: Code:
hero.findchild[ClassList,fieldval:cIndex = X].setfocus One possible work around I was thinking was to use a foreach to search through all the ClassList and assign a user tag to everything. Code:
var index as string index = eachpick.field[cIndex].value index = "cIndex" & index perform eachpick.assign[User.(index)] |
|
#30 |
|
|