-
April 4th, 2020, 04:52 #1
Party Sheet, Add all to Combat Tracker
Valeriangamer came up with (I thought) a great idea of adding a button to add all the entries in the Party Sheet to the combat tracker. It's a simple thing so I did it for the AD&D ruleset. Diablobob then asked if he could get the same code for his project... so I'm placing it here for him and anyone else that wants to use it. This wouldn't be a bad thing to add to the CoreRPG version tho it'd need some tweaks.
This is the XML entry, for the 2E and 5E ruleset that is in ps_main.xml.
The anchor/position will need to be tweaked depending on your locations. For me this is the lower left corner on the main page of the party sheet.
Code:<buttoncontrol name="addtocombattracker"> <script> function onButtonPress() PartyManager2.addPartyToCombatTracker(); end </script> <anchored to="leftanchor" height="30" width="35"> <top /> <left anchor="right" relation="relative" offset="15" /> </anchored> <frame name="fielddark" offset="10,2,10,3" /> <icon normal="button_ct" pressed="button_ct_down" /> <tooltip textres="ps_label_addtocombattracker_tooltip" /> <gmvisibleonly /> </buttoncontrol>
This is the code that does the work. For 2E and 5E ruleset this goes into manager_ps2.lua (I put it at the bottom).
Code:-- return array of all party sheet member nodes function getPartySheetMembers() local aParty = {}; for _,v in pairs(DB.getChildren("partysheet.partyinformation")) do local sClass, sRecord = DB.getValue(v, "link"); if sClass == "charsheet" and sRecord then local nodePC = DB.findNode(sRecord); if nodePC then table.insert(aParty, nodePC ); end end end return aParty; end -- add all party sheet members to combat tracker if they are not there already. function addPartyToCombatTracker() local bAdded = false; for _, nodePS in pairs(getPartySheetMembers()) do if not CombatManager.getCTFromNode(nodePS) then CombatManager.addPC(nodePS); bAdded = true; end end if bAdded then Interface.openWindow("combattracker_host", "combattracker"); end end
In 2E it looks like this.
Last edited by celestian; April 4th, 2020 at 05:03.
---
Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
Documentation for AD&D 2E ruleset.
Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.
-
April 4th, 2020, 05:14 #2
A 21 dex?!
"I am a Canadian, free to speak without fear, free to worship in my own way, free to stand for what I think right, free to oppose what I believe wrong, or free to choose those who shall govern my country. This heritage of freedom I pledge to uphold for myself and all mankind."
- John Diefenbaker
RIP Canada, February 21, 2022
-
April 4th, 2020, 05:28 #3
-
April 4th, 2020, 05:31 #4
I think it's an excellent idea.
DM/GM Since 1985. Unity and Classic Ultimate License.
-
April 4th, 2020, 05:40 #5---
Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
Documentation for AD&D 2E ruleset.
Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks