![]() |
|
Junior Member
Join Date: Mar 2021
Location: New Zealand
Posts: 18
|
Does anyone know the name / priority of the script that calculates the player's level and determines how much wealth the player should have for it?
From what I can tell without finding it, the script calculates a PCs/NPCs level by looking at the number of class tags they have, but without knowing the name of the script or the variable it saves the number to, I'm kinda stuck. For context, I'm using an edited version of the gestalt addon. I have 9 "classes" added (3 gestalt, 3 of class 1, 3 of class 2) in the correct order, but since only the gestalt classes should calculate towards the wealth limit I need to edit the calculated number. What I've done is commented out a part of the code that "clears all the class tags and then adds an equivalent number of gestalt class tags". When you select a class using the gestalt class picker, another part has been commented out that pulls the class tags from the picker. The result is a hero calculated to have the same number of levels as the original gestalt addon, that correctly calculates level for all fields such as pre-requisites, skills, ability score increases, feats, etc., and works for characters above level 20. The downside is that it incorrectly calculates the amount of levels they have for the purposes of calculating wealth as shown in both picture below. ![]() ![]() Last edited by Arkadious; July 30th, 2022 at 04:03 PM. Reason: Clarification |
![]() |
![]() |
Junior Member
Join Date: Mar 2021
Location: New Zealand
Posts: 18
|
I've attached the file I'm working on (the one that goes in ProgramData).
Last edited by Arkadious; July 30th, 2022 at 04:12 PM. |
![]() |
![]() |
Junior Member
Join Date: Mar 2021
Location: New Zealand
Posts: 18
|
I can see that the Wealth by Level mechanic (mechWealth) references some arrays that have been labeled as such:
Code:
mechGrGear mechGrLim mechGrMagi mechGrNPC mechGrPC mechGrProt mechGrWeap Any help would be appreciated. |
![]() |
![]() |
Member
Join Date: May 2021
Posts: 79
|
If you have some time to poke around, I would suggest using the editor to go through the code of any procedures that seem relevant. (Basically you make a new copy of the procedure, and then can read through the code on the new copy.)
There is quite a bit of code exposed there, and even though you can't change those procedures directly, you can sometimes figure out what changes or tags you can use to get the effect you want. At a quick glance, the ClassList procedure seems to have some stuff relevant to level adjustments and whether or not classes are counted. edit: There is also a filterable Task List available from the Debug:FloatingInfoWindows: menu... Filtering with "total level" which seems to indicate a calculate script on the hero's tTotLevel field happens at Post-levels 10000. Last edited by ploturo; July 30th, 2022 at 08:31 PM. |
![]() |
![]() |
Junior Member
Join Date: Mar 2021
Location: New Zealand
Posts: 18
|
I'm able to alter some numbers that are used for levels using these bits of code:
Code:
field[cLevelAdj].value += -2 herofield[tPlanLvl].value += -2 herofield[tLastLevel].value += -2 herofield[tLevel].value += -2 herofield[tEqvGrLev].value += -2 By altering tLevel, I am also altering tTotLevel and I've got these values in a script in Class Level Id cS2Gestalt so every time you add a Gestalt level, it reduces those values by 2. Looking the values using the debug tools, the values are correctly set, and the final values are what they are supposed to be, but the Suggested Wealth is still calculating (Gestalt * 2) levels too high. I checked the ClassList procedure, but it was responsible for the numbering and ordering of the classes in the classes tab for a character. It did do some calculations for cLevelAdj, tPlanLvl, and tLastLevel, but nothing in there that references the Wealth by Level mechanic. |
![]() |
![]() |
Junior Member
Join Date: Mar 2021
Location: New Zealand
Posts: 18
|
I think I might've found a lead involving the gear item gMoney, but if I try to find gMoney in the editor, while I can find the id using a search item function I can't actually find an entry for it.
Is it too fundamental or something, so Hero Lab doesn't let you edit it? I think I'm going around in circles at this point. Last edited by Arkadious; August 2nd, 2022 at 02:53 AM. |
![]() |
![]() |
Member
Join Date: May 2021
Posts: 79
|
Things like gMoney, or the Totals "Hero (Totals)" thing, can be accessed in the editor if you create an editthing entry for the compset they are created from (Purse and Actor, respectively). You would need to create/edit a datafile as a text/xml file to add an editthing.
Unfortunately, there is rarely any useful info that can be found in those kind of entries, since basically all of the relevant scripts and information were added at the component level that make up the compset the things are derived from, and not as part of each thing. For example, Acrobatics and Bluff are things that can be edited in the Skill tab of the editor, but most of the scripts that are run for each skill are actually part of the BaseSkill component in the Skill compset and aren't visible in the editor. Only scripts that are specific to a certain skill, like the bonus to fighting defensively granted by Acrobatics, would be visible in the editor for each thing. Last edited by ploturo; August 3rd, 2022 at 10:47 AM. |
![]() |
![]() |
Member
Join Date: May 2021
Posts: 79
|
It looks like the level and amount of starting gold are being calculated based on the number of Classes.? tags present at Pre-levels:5000, in a script on the Totals component called "Component Totals: Eval Script #40".
They are stored in herofield[tEqvGrLev].value and herofield[tSCROver].value, if you want to calculate them yourself and set them at Pre-levels:5001. Or you can bootstrap another helper to the Gestalt cHelp thing, with an eval script at Pre-levels:4999 to pull all the Classes.? tags and then delete them from the hero and replace them with the correct number of Classes.? tags, and then a second script at Pre-levels:5001 to delete the temporary Classes.? tags and push the previous tags back to the hero. The mouseinfo for the total gear value also uses the count of the Classes.? tags to determine the character level and wealth, but unfortunately it does it outside of the normal evaluation loop and doesn't have a stored value anywhere to change. Technically, you could fix that by deleting all the Classes.? tags and replacing them with the correct number of tags again at Render:9999999... But theoretically it would also break any code that counts class tags to evaluate pre-reqs when a user is adding new feats/etc, since that happens outside the normal evaluation loop too. Last edited by ploturo; August 3rd, 2022 at 08:10 PM. |
![]() |
![]() |
Junior Member
Join Date: Mar 2021
Location: New Zealand
Posts: 18
|
I think your way of deleting tags, inserting some temporary tags before wealth calculations, and then reinserting the correct tags afterwards is probably the best method.
I don't have much experience with bootscraps, foreach picks and helpers, so is this follow below what you mean? The idea with this script to use the foreach pick to grab every class tag, pull them, delete our current class tags, and then assign an equal number of temporary Gestalt class tags to determine our level. Code:
~ If we are under level 3 don't do anything as we will cause errors ~ Once we have three classes then we can modify it down to two. doneif (hero.tagcount[Classes.?] < 3) ~ Test to see if this does anything useful var nClasses as number var nGestalt as number var iX as number nClasses = hero.tagcount[Classes.?] nGestalt = hero.tagcount[Classes.S2Gestalt] nClasses = nClasses - (nGestalt * 2) foreach pick in hero perform eachpick.pulltags[Classes.?] nexteach ~perform hero.pulltags[Classes.?] perform hero.delete[Classes.?] iX = 0 while (iX < nClasses) iX += 1 perform hero.assign[Classes.S2Gestalt] loop I assume there are ways to push pulled variables from other scripts or am I overcomplicating this? |
![]() |
![]() |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,105
|
In the editor, on the Mechanics tab, make a copy of "Wealth by Level Mechanics". Then, in "Overrides...", select "Wealth by Level Mechanics". Unfortunately, there's not an editor control set up for the relevant array yet, and the editor doesn't give you access to arrays, except through editor controls, but you should be able to edit the XML on the item you've created, and edit the relevant arrays.
|
![]() |
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|