• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Adding Custom Money

I've got a script that tracks the custom money a hero has. However, due to the d20 files having static money in pp, gp, sp, and cp, I've tried to use the values of those coins as a way to track the current number of custom coins the hero has. Then I decided to get the weight to work out correctly, and I've run into a snag that I'm not sure how to fix. I replaced gMoney (the field that tracks the weight) with my own version of it (gDMoney), with the math needed to calculate the current cash as well as the weight. So I made each of my custom coins as helpers to the gDMoney, with each keeping track of the number of coins and allowing gDMoney to track the total weight. Everything was working fine, until I saved a hero and reloaded it. Now it tells me,

"Errors were encountered when loading the saved portfolio! A record of these errors can be found in the file "C:\Users\Owner\AppData\Local\Temp\hero_lab_load_issues.log". If you notice incorrect behaviors in your portfolio, please report it to the data file authors (you can contact them from the Help menu).

Chained pick 'gGGuilda' has been orphaned due to missing bootstrap in batch '22'
Chained pick 'gSRuba' has been orphaned due to missing bootstrap in batch '22'
Chained pick 'gCPenny' has been orphaned due to missing bootstrap in batch '22'
Chained pick 'gPCorona' has been orphaned due to missing bootstrap in batch '22'
Chained pick 'gBFier' has been orphaned due to missing bootstrap in batch '22' "

So there is a problem with batch 22 not seeing the coins I created. The custom coin gear I created is there, but the code isn't able to find it, even though it is bootstrapped to my gDMoney. Not sure why, not even sure which is batch 22 or where to find it. I can delete the picks of gGGuilda, gSRuba, etc. from the offended portfolio and things work find again... until I save it for any changes. The error shows up once again. Anyone have any ideas why this is happening? Could this be because HL doesn't like me replacing gMoney and is looking for the bootstrap on it?
 
You've replaced something that bootstrapped other picks with something that no longer bootstraps those picks.

So - what happens to a saved portfolio, where those bootstrapped picks had existed - as Hero Lab is reporting, they're now orphaned.

Once you've clicked through this error, and changed something about this portfolio (to dirty the file), then saved it, you should not see this error again when opening this portfolio.
 
The pick (gDMoney) is the one holding all the bootstraps indicated as being orphaned. Removing the offending code from the portfolio and re-saving it doesn't work, as the only way I could get this to work was to edit the XML file directly. If I edit the XML portfolio file directly, and save it, I don't get the error on the next load in HL of that portfolio. But, once I save that portfolio again while in HL, the orphaned items rear their ugly heads again. However...

I'm pretty sure I know what's happening. I'm trying to replace gMoney with my version gDMoney. Whenever I save gDMoney (which contains the bootstraps of gGGuilda, ... etc., which it claims are orphaned), I get a message that I can't replace something until it is deleted. So, in HL the default portfolio always has gMoney in its gear list, and so I can't delete it from the hero in order to replace it with my version. However, even though it says this, the bootstrapped items do appear on the gear list, but I still think it is linking and displaying gMoney (which doesn't have the bootstraps) instead of gDMoney (which does). Not sure how to solve that problem, since I can't delete the gMoney gear (which is weird, since the Money in gear is displaying all the correct data as if gDMoney was doing the calculations). I could be completely wrong as well, not 100% sure what's going haywire.
 
No worries, I'm going to try a completely different approach. It just doesn't like the bootstrapping onto anything related to gMoney (even the thing replacing it). So rather than the inside out approach, I'm going to try the outside in approach, with no bootstrapping. This means my money ends up being a purchasable items (for free), but not much I can do about that. I can't Helper it because then I can't add anything to the field, so its a tradeoff, but a minor one. I keep all the up to date files for the game I run anyhow (some players are horrible at keeping track of their character's skill points, damage, etc, include one player that keeps losing track of what his hit points are, never had that happen in years and years of DMing, lol).
 
If you are replacing a permanent thing, instead of using Test Now!, save the file you're editing, exit the editor, and use ctrl-r to reload the files.
 
If you are replacing a permanent thing, instead of using Test Now!, save the file you're editing, exit the editor, and use ctrl-r to reload the files.

That's what I was doing. I'm pretty sure the problem is that gMoney has some encapsulated functionality that keeps it, at least in a Zombie form, around for that purpose. I've already gotten part of the outside in solution working, at least in part, so I can replace gMoney now with gDMoney without the bootstraps and everything is working as expected without the orphan message popping up. This solution is actually working better for me, because I can add more than the static PP, GP, SP, CP system that HL incorporates by bypassing it altogether (except for the purposes of buying items, I'm still coding that part).

Like all coding, I learned something I didn't know before, you can't replace gMoney with a similar thing that has bootstraps, or they get orphaned. Lesson learned.
 
Well, the inside out method has run into an unresolvable snag. There is no way to track money outside in and also update it inside out with the 3.5 system. So back to the drawing board, trying to see if I can track things inside out but display them outside in. I should be able to do that, but that will take alot more coding than I had initially intended, and time is not something I have at the moment. I'll give it a few days thought and come back to it.
 
Anyone know how to have gear automatically added to a hero? I've set an item to gIsEquip to 1, but that doesn't work. I'm not even sure I can, but I want to auto add my money so I can make it a helper and not a selectable item in the gear list. Unfortunately, the ideal use would be able to bootstrap it to gMoney, but it orphans anything bootstrapped to it. Therefore, I'm trying to do what gMoney does (auto added to the hero gear list), but not having any success. Anyone have an idea?
 
Nope, no luck there.

Possible Workaround.
I can only find 2 types of things automatically added to all characters in HL, which are skills that do not need to be manually added and Conditions that are always on the in-play tab (like confused, or charging and whatnot). You could bootstrap your custom money gear thing to either of those. I'd recommend you make a Condition that comes up pretty regularly in your game (like Bless) and attach it there. Alternately, if you could figure out a way to hide a skill or condition (I can't see a way for skills after a few minutes of fiddling, but I am tired and ready for bed, so maybe you'll do better) you could just define one and then bootstrap it to that invisible thing.

Tell me how that idea strikes you and if it works out alright.
 
I might have it figured out. I found out last night, also late, by commenting everything out that the bootstraps work with the gMoney as long as I don't try to script anything in the bootstrapped thing. Once I script something (uncommenting a line), the bootstrap becomes orphaned. So, my idea is the script the entirety in gMoney. I'll keep you informed (be awhile, got no time today, but maybe this evening).
 
Finally, it works! As long as I remove any scripting from the bootstrapped things, they don't get orphaned. I just took all their scripting code and placed it in the gDMoney I replace gMoney with. It's calculated the weights properly, still working on the value of things (trying to get 5 types of coins to be reflected in HL's 4 types of coins is a bit of a math puzzle), and it auto adds the money to each sheet as a Helper.
 
Awesome. I want to see it when you're done because I have been wanting to make the dragonlance money system for a long time!
 
Getting the 5 coin system to work hand in hand with a 4 coin system is a bit of a nightmare. I've been trying to get it to work without getting into complex coding, but the end result is, I've got to draw up an algorithm and get the system right. Otherwise, all the other aspects work fine.

What I've done is to replace gMoney with a copy of it named to whatever you name your version to. Then make your coins as gear, with "Size never changes" checked and "Gear Type" as "Current Wealth" (do not add any scripts to the coins). Lastly, for each coin add the Helper.Helper tag to exclude it from gear list selection. Bootstrap each coin to the gMoney replacement thing.

For this, I have gDMoney replacing gMoney and coins of gPCorona, gGGuilda, gSRuba, gBFier, gCPenny bootstrapped on. The script in the gDMoney (no need to change the timing):

Code:
~ First, make sure our quantity is fixed at 1 - for some reason, some
~ old saved portfolios show it as 2
trustme
field[stackQty].value = 1

~ Calculate the weight of Daelund money.
var pc as number
var gg as number
var sr as number
var bf as number
var cp as number
pc = hero.child[gPCorona].field[stackQty].value / 30
gg = hero.child[gGGuilda].field[stackQty].value / 20
sr = hero.child[gSRuba].field[stackQty].value / 50
bf = hero.child[gBFier].field[stackQty].value / 50
cp = hero.child[gCPenny].field[stackQty].value / 50
field[gWeight].value = gg + pc + sr + bf + cp

~ Calculate the value of Daelund money.
~ Still working on this.
~ Get our platinum coronas based on platinum pieces (PP/20).
var remainder as number
remainder = herofield[tCurrPP].value % 20
herofield[tCurrPP].value -= remainder
hero.childfound[gPCorona].field[stackQty].value = herofield[tCurrPP].value / 20
remainder = remainder * 10
herofield[tCurrGP].value += remainder
if (herofield[tCurrPP].value <= 0) then
  hero.childfound[gPCorona].field[stackQty].value = 1
endif

~ Get our gold guildas based on gold pieces (GP/20).
remainder = herofield[tCurrGP].value % 20
herofield[tCurrGP].value -= remainder
hero.childfound[gGGuilda].field[stackQty].value = herofield[tCurrGP].value / 20
remainder = remainder * 10
herofield[tCurrSP].value += remainder
if (herofield[tCurrGP].value <= 0) then
  hero.childfound[gGGuilda].field[stackQty].value = 1
endif

~ Get our silver rubas based on silver pieces (SP/4).
remainder = herofield[tCurrSP].value % 4
~herofield[tCurrSP].value -= remainder
hero.childfound[gSRuba].field[stackQty].value = herofield[tCurrSP].value / 4
if (herofield[tCurrSP].value <= 0) then
  hero.childfound[gSRuba].field[stackQty].value = 1
endif

~ Get our bronze fiers based on silver pieces (SP/1).
~ Complex coding needed to split silver rubas and bronze fiers into sp value.

~ Get our copper pennies based on copper pieces (CP/1).
hero.childfound[gCPenny].field[stackQty].value = herofield[tCurrCP].value
if (herofield[tCurrCP].value <= 0) then
  hero.childfound[gCPenny].field[stackQty].value = 1
endif
 
Last edited:
Bah! Solve it for one thing, not solved for another. Essentially, animal companions, familiars, minions in general, as well as NPCs are orphaning the picks again. I'm not sure why either, probably some internal mechanism in the code. Sigh. I'll play around with adjusting the timing, maybe that will help, who knows, not going to spend anymore time working on it at this point. Yeesh, hero lab can designate gear as "Current Wealth", it would have easily incorporated a user money system with that mechanic. Oh well, was a flight of fancy anyhow.
 
Back
Top