-
March 1st, 2018, 18:58 #11
-
March 1st, 2018, 20:51 #12Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
March 1st, 2018, 21:18 #13
EDIT: I had to use a full path to save the file.
Last edited by Oso Buho; March 1st, 2018 at 21:24.
-
March 1st, 2018, 21:22 #14"Alright, you primitive screwheads, listen up: THIS... is my BOOMSTICK!" -- Ash Williams, Army of Darkness
Post your SavageWorlds ruleset feature requests and issue reports here!
-
March 1st, 2018, 23:32 #15
You probably want to tie it to the Damage rolls rather than the Attack rolls.
-
March 2nd, 2018, 00:08 #16
A consideration, how are you going to handle healing effects and manual corrections to HPs done either in the CT or on the character sheet? Might need a manual "refresh" command/button.
Problems? See; How to Report Issues, Bugs & Problems
On Licensing & Distributing Community Content
Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets, Balance Disturbed, Dungeon Room Descriptions
Note, I am not a SmiteWorks employee or representative, I'm just a user like you.
-
March 2nd, 2018, 00:43 #17
Archangel
- Join Date
- Apr 2008
- Location
- Virginia Beach
- Posts
- 3,096
What I would do is install an onUpdate handler on the current hit points of any character. Then, it doesn't matter how the hit points change. Your handler will get called and you can re-export whatever you need to export. That db name will vary based on the ruleset, but you would install it like this (do it in the onInit of your extension):
Code:DB.addHandler(sNodeName.. ".*@*","onUpdate",onThingChange);
and uninstall it like this: (do it in the onClose of your extension):
Code:DB.removeHandler(sNodeName.. ".*@*","onUpdate",onThingChange);
Last edited by Bidmaron; March 2nd, 2018 at 00:48.
-
March 2nd, 2018, 08:12 #18
Actually, I'm considering on creating a whole extension that will pick up any update to the health now. I still have one problem though... maybe someone can help.
It truly BOTHERS me that I need to hardcode the whole path where to export the file. Is there no global variable of sorts that I can use to pick up the folder of the Campaign that is currently playing?
Like: DB.export(campaignFolder/PCs.xml, "charsheet", "character", true);
I've seen there a openDataFolder or openCampaignFolder within the Interface Package... but I want to get the Path so I can use it in my export, not to open it.
Thanks.Last edited by Oso Buho; March 2nd, 2018 at 08:40.
-
March 2nd, 2018, 13:53 #19
UPDATE:
Did it the way I mentioned and it works... or it does 50% of the times.
I'm using the following in different situations (onInit, and every time a players HP updates):
local AppDataFolder = os.getenv('APPDATA');
local PCsFolder = AppDataFolder + '/Roaming/Fantasy Grounds/PCs.xml';
DB.export(PCsFolder, "charsheet", "character", true);
Unfortunately, I get an error on os.getenv being null every now and then, it's random (I would say about 75% of the times.
Any idea on what could be causing this?
-
March 2nd, 2018, 16:21 #20
os.getenv shouldn't be available. I'm surprised it works at all.
More info here: https://www.fantasygrounds.com/wiki/...ua_ProgrammingPrivate Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks