Suggested Wealth for Level [Help]
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. https://i.imgur.com/7dMZnyH.png https://i.imgur.com/j5BnPgI.png |
1 Attachment(s)
I've attached the file I'm working on (the one that goes in ProgramData).
|
I can see that the Wealth by Level mechanic (mechWealth) references some arrays that have been labeled as such:
Code:
mechGrGear Any help would be appreciated. |
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. |
I'm able to alter some numbers that are used for levels using these bits of code:
Code:
field[cLevelAdj].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. |
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. |
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. |
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. |
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.
|
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:
I assume there are ways to push pulled variables from other scripts or am I overcomplicating this? |
Pulling tags copies them to the current pick (the one running the script) from whatever other pick/container you've have navigated to as part of the pull command.
Pushing tags copies them from the current pick to whatever other pick/container you've navigated to as part of the push command. We don't actually need the foreach to pull tags from all the picks on the hero, since they have all already been added to the hero container at the timing we are interested in. One minor issue is that the class helper will already have one class tag for your Gestalt class on it already, so that has to be taken into account to make sure the number of tags doesn't get screwed up. This code assumes (pretty safely, I hope?) that there will always be at least one Classes.S2Gestalt tag on the hero, because I'm assuming the helper wouldn't be loaded if there are no levels of its class. Pre-levels:4999 Code:
Code:
|
That code works great. I made a couple of tiny changes for what I wanted but yeah, thanks heaps! :) It's kinda frustrating how close it looked like I was to solving this myself and just not knowing what I was doing wrong.
Pre-levels, 4999 Code:
Code:
Thanks for the help everyone. I really do appreciate it. |
All times are GMT -8. The time now is 09:07 PM. |
Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.