View Full Version : Legend of Ghost Mountain - Haunt token tracking
RickSaada
February 5th, 2025, 19:31
So LoGM has the emotion setting feature where your characters can spend what are effectively Chi points on various effects. That's nicely tracked on the player's sheet. However an encounter has "Haunt Pools," which are a pool of emotion points that the enemies share, similar to GM bennies but on a per encounter basis. I'm not seeing a way to track that in FGU. Is that just not implemented or am I missing it somewhere? Obviously I can just scribble on a notepad, but I figured I should check if I'm blind first.
Thanks,
Rick
Weeg
February 6th, 2025, 03:12
There is an extension in The Forge called Resource Counter by Lonewolf... That might help you out
RickSaada
February 6th, 2025, 06:16
Hmmm. Maybe I'm missing something, but that sets up a Derived Stat with a base of 0 that you can't just type into. Instead you have to go into Info and add an entry like Delta set to the count you want, and then every time you want to change it you have to go into the Info dialog and edit Delta.
For that matter the Emotion counter shows up as a Derived Stat as well, which I also can't edit as it gets spent. Really these should be set up like Bennies where you can reset them and then spend them.
RickSaada
February 6th, 2025, 18:13
OK, I decided to fix the Emotion problem myself. I put together a quick extension that puts an editable field for Emotion next to Conviction on the character sheet. This is my first extension, but it seems to work fine. I'll see if I can figure out how to make a Haunt Pool when I have some time.
https://forge.fantasygrounds.com/shop/items/2072/view
Mike Serfass
February 6th, 2025, 19:01
A handful of settings track tokens for a scene, encounter, or session. More than one setting tracks tokens of some kind per character aside from bennies and conviction.
I've started a discussion with Ikael on how to approach this. I'm hoping we can come up with some way of an extension requesting a token pool for GM and/or characters that will be dynamically added. Similar to how derived stats are done.
We'll come up with something. We need a bit of time, since we're pretty busy with CoreRPG changes and other products.
RickSaada
February 6th, 2025, 23:44
Yeah, it does seem like something that would be generally useful. I make poke around in the interim, but it's nice you're thinking about a more integrated solution.
Thanks!
Lonewolf
February 7th, 2025, 09:39
Hmmm. Maybe I'm missing something, but that sets up a Derived Stat with a base of 0 that you can't just type into. Instead you have to go into Info and add an entry like Delta set to the count you want, and then every time you want to change it you have to go into the Info dialog and edit Delta.
So in other words the number can be edited. Plus it is plugged into the effects system as well to accept modifiers. The catch is you just can't edit it fast enough. It is a solution but the one I would have least preferred to use as well.
Extra resource managment is a growing trend. It first started to become an issue in Pathfinder. The currect quick and dirty solution was to put up a template extention like Resource Counter on forge. Longer term come up with something better. Long term might be very long term as the current work load is pretty crushing.
If you come up something better you will be a hero.
Lonewolf
February 7th, 2025, 09:58
Hero points adaptaion was another direction that was considered in a future version https://forge.fantasygrounds.com/shop/items/708/view
Mike Serfass
February 7th, 2025, 17:13
@RickSaada: By all means poke around. Learning how to write extensions isn't a bad thing. And it gives you a work around while you're waiting for an integrated solution. And maybe you'll come up with something really good.
@Lonewolf: I'm feeling a bit crushed currently too. But that could be all the snow we're getting.
RickSaada
February 7th, 2025, 17:34
Oof. I feel like I'm dipping a toe in a very stormy sea, and I'm not sure I want to swim! The Savage Worlds/CoreRPG pak files are a massive pile of "how the #*@$ does this work?" right now :D Ah well, I'll check out the hero points link as well. More examples will certainly help.
Mike Serfass
February 7th, 2025, 18:50
Many extensions are not vaulted, so you can unzip them and look at them. You can learn much doing that. My extensions are not vaulted, and I put notes in them. I also name things to make it obvious what they do. There's also a development wiki page and forum posts.
RickSaada
February 9th, 2025, 08:26
OK, I beat my head against this for a day and a half and I think I've forced FGU into submission. Here's what I've done:
I added a new field to battles for keeping track of emotion (or whatever other per encounter number you need).
I made it editable in the Encounter dialog.
I added a button on the encounter to copy the encounter's Emotion to the GM's Emotion (GM.Emotion).
I added a control down by GM Bennies to show the GM.Emotion value, which is editable.
I gave it right click menus for +1, -1, set to 0, and "roll 2d4 and use that" which is the Ghost Mountain random haunt emotion value.
Things I'm doing that I'm not sure are kosher, that I'd love someone more knowledgeable to check:
data_library_sw.lua has overrides for the battle already. I had to copy these into mine, because if I just did my override it seemed to remove the SW ones. So I've got:
aRecordOverrides = {
["battle"] = {
aDataMap = { "combat", "reference.battles" },
aCustom = { ["npclist"] = "actorlist", ["acceptdrop"] = { "npc", "vehicle" } },
emotionCount = 2,
}
}
function onInit()
RecordDataManager.overrideRecordData(aRecordOverri des);
end
And that seems to work. But this seems like a problem if any *other* extension also needs to do this, so I'm wondering what the right way is?
I had to replace the "battle_header" class from record_battle.xml to add my new control. I couldn't figure out a way to merge in another control without the Encounter Title field overwriting it, since it's anchored to the right edge.
63401 63402 63403
Jiminimonka
February 9th, 2025, 10:11
https://www.fantasygrounds.com/forums/showthread.php?23291-How-to-add-new-Derived-Stat-tutorial&highlight=
This is how to make a Derived Stat on the character sheets - you can have them appear on NPCs ONLY if you look at it.
Look for Ikael's misc tutorials on the forums, lots of nuggets there.
https://www.fantasygrounds.com/forums/showthread.php?38569-Ikael-s-miscellaneous-extensions
Jiminimonka
February 9th, 2025, 10:12
OK, I beat my head against this for a day and a half and I think I've forced FGU into submission. Here's what I've done:
I added a new field to battles for keeping track of emotion (or whatever other per encounter number you need).
I made it editable in the Encounter dialog.
I added a button on the encounter to copy the encounter's Emotion to the GM's Emotion (GM.Emotion).
I added a control down by GM Bennies to show the GM.Emotion value, which is editable.
I gave it right click menus for +1, -1, set to 0, and "roll 2d4 and use that" which is the Ghost Mountain random haunt emotion value.
Things I'm doing that I'm not sure are kosher, that I'd love someone more knowledgeable to check:
data_library_sw.lua has overrides for the battle already. I had to copy these into mine, because if I just did my override it seemed to remove the SW ones. So I've got:
aRecordOverrides = {
["battle"] = {
aDataMap = { "combat", "reference.battles" },
aCustom = { ["npclist"] = "actorlist", ["acceptdrop"] = { "npc", "vehicle" } },
emotionCount = 2,
}
}
function onInit()
RecordDataManager.overrideRecordData(aRecordOverri des);
end
And that seems to work. But this seems like a problem if any *other* extension also needs to do this, so I'm wondering what the right way is?
I had to replace the "battle_header" class from record_battle.xml to add my new control. I couldn't figure out a way to merge in another control without the Encounter Title field overwriting it, since it's anchored to the right edge.
63401 63402 63403
Make an extension and share this please (not vaulted on the Forge)
Mike Serfass
February 9th, 2025, 16:23
You're close. You earned a benny!
You're correct in that your approach will trip up other extensions. Or another extension could overwrite yours. It's also overriding things CoreRPG does with battles.
Adding to the Library
First, you want to put this in onTabletopInit rather than onInit. onTabletopInit is evoked at a better time in the sequence of events for what you're doing.
You add to an array / table using table.insert. Here's the code:
function onTabletopInit()
local aRecordOverride = RecordDataManager.getRecordTypeData("battle")
table.insert(aRecordOverride, "emotionCount")
aRecordOverride.emotionCount = 2
end
Important Notes
Always declare variables as local unless they're going to be used everywhere. Avoid duplicating names of global (not local) variables because one will overwrite the other, and you can't control which one wins. Notice my local variables is names aRecordOverride (no s on the end).
Avoid overwriting and replacing. If you're doing that, you're probably using the wrong approach. (It raised a red flag for you, so another benny!)
NEVER directly change anything in CoreRPG! Code in RPG should never be touched directly!
Altering Windows
Windows are designed to be very adjustable.
They work by creating a clone file then declaring the alterations in that file.
Rather than write all this out, get my NPC Region (https://forge.fantasygrounds.com/shop/items/2036/view) extension. That adds a widget to the NPC window. It's pretty straight forward and easier to figure out than the library.
Debug
In case you missed it, Debug is your friend.
You can check your work using code similar to this:
local aRecordOverride = RecordDataManager.getRecordTypeData("battle")
Debug.chat("battle", aRecordOverride)
Put that somewhere you know it will run, like a button click or window onInit.
I'll answer any questions you have (within reason).
If you zip up your code and post it, I'll look it over.
For daring to plunge into the world of FG code, you get to select any single card from the adventure deck.
RickSaada
February 9th, 2025, 16:51
Jiminimonka - Yeah, I'll update my extension later today, I wanted to make sure I wasn't breaking anything before I released it into the wild.
Mike Serfass - It looks like I may have stomped the SW aRecordOverrides with mine when I declared it with only my addition, and that's why it broke things. I'll fix that up. I've been programming since the 80's, so it didn't really pass my sniff test. Honestly, I've never done web dev, though, so fighting the XML layout was the worst part. This would all have been so much easier in C# writing for Unity directly, but we work with what we've got :D . I'll check out your extension and see if there's a way to clean up my dialog stuff. I also want to add a button to the party sheet to set all the player's emotion for the session (like resetting bennies).
RickSaada
February 9th, 2025, 22:53
OK, It's live on the store now. I fixed up the overrides with Mike's guidance, and even got the "reset emotion" button in on the Party Sheet.
https://forge.fantasygrounds.com/shop/items/2072/view
I'm not sure what other settings use extra player/ encounter resources like this, but I expect this can be string tweaked pretty easily for other uses.
Thanks for the help getting this working!
Rick
P.S. I've added an [extension] thread for this over at:
https://www.fantasygrounds.com/forums/showthread.php?84172-Extension-Emotion-Field-for-Legend-of-Gho
Powered by vBulletin® Version 4.2.1 Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.