-
January 4th, 2025, 21:00 #1
- Join Date
- Nov 2024
- Posts
- 14
Duplicating the Type field in the NPC sheet and in the search of the NPC module
Hello fellow roleplayers!
I would like to know if there is an easier way to duplicate the "Type" field of the NPC sheet and also make it searchable in the NPC module like the "Type" field.
I want to make a "Location" field and if possibly others.
I believe there are at least two ways of doing that ?
By modifying the existing master data or by using an extension ?
What do you suggest and do you have any insight on how I might do that ?
Thank you for your help!
LordDante123
-
January 4th, 2025, 23:08 #2
You will need to crack open the ruleset and look at the code and then write an extension.
-
January 5th, 2025, 08:05 #3
- Join Date
- Sep 2020
- Location
- Ballston Lake, NY
- Posts
- 832
Are you looking for something like in this image? It's highlighted in green boxes and it's called region rather than location.
region.jpgAdd feature suggestions for Savage Worlds to Fantasy Grounds Feature Request.
-
January 5th, 2025, 18:53 #4
- Join Date
- Nov 2024
- Posts
- 14
-
January 11th, 2025, 08:50 #5
Not all modules will have data there, until Savage Pathfinder came along (and I got Ikael to update the SWD/SWADE/SWPF Base code) that field was hidden and used to contain NPC I think it was used by the combat tracker, that said being able to search that field (assuming it has been filled out) is a brilliant idea, +1 from me!
My players just defeated an army, had a dogfight with aliens, machine-gunned the zombies, stormed the tower, became Legendary and died heroically
Yours are still on combat round 6
Get Savage
First GM to post a game for the original FG Con!
-
January 12th, 2025, 12:57 #6
- Join Date
- Nov 2024
- Posts
- 14
Hey there,
After some search in the ruleset, I think I've found most of the stuff if not all.
So I guess I now need to make :
- an extension to add another field
- a script based on the one I found
- and register them in some lua file or something
Thank you for your help.
Here is the file and code I've found :
SavageWorlds.pak\campaign\record_npc_xml
Code:<!-- Please see the license.html file included with this distribution for attribution and copyright information. --> <root> <windowclass name="npc" copy="record_window_tabbed"> <sizelimits> <minimum width="365" height="440"/> </sizelimits> <minimize>minimized_npc</minimize> <gmexport>npc</gmexport> <tab> <name>main</name> <resource>tab_main</resource> <class>npc_main</class> <embed/> </tab> <tab merge="add"> <name>traits</name> <resource>tab_traits</resource> <class>npc_traits</class> <embed/> <activate/> </tab> <tab merge="add"> <name>combat</name> <resource>tab_combat</resource> <class>npc_combat</class> <embed/> </tab> <tab merge="add"> <name>pictures</name> <resource>tab_pictures</resource> <class>record_content_pictures</class> <embed/> </tab> <script> function onInit() super.onInit(); if Session.IsHost then NPCManagerSW.initializeAttackTypes(getDatabaseNode()); NPCManagerSW.initializePowers(getDatabaseNode()); end self.onIDChanged(); end function onIDChanged() self.onLockChanged(); if not Session.IsHost then local bID = LibraryData.getIDState("npc", getDatabaseNode(), true); tabs.setVisible(bID); end end </script> </windowclass> <windowclass name="npc_header" merge="join"> <script> function update() super.update(); local nodeRecord = getDatabaseNode(); local bReadOnly = WindowManager.getReadOnlyState(nodeRecord); wildcardtool.update(bReadOnly); if not Session.IsHost then local bID = LibraryData.getIDState("npc", nodeRecord); wildcardtool.setVisible(bID); end end </script> <sheetdata> <hs name="wilddie"/> <hn name="wildcard"/> <record_wildcardtool name="wildcardtool" insertbefore="name"/> </sheetdata> </windowclass> <windowclass name="npc_main"> <script file="campaign/scripts/npc_main.lua"/> <sheetdata> <anchor_column name="columnanchor"/> <label_column name="type_label"> <static textres="npc_label_type"/> </label_column> <string_columnh name="type"> <delaykeyupdate/> </string_columnh> <label_column name="conviction_label"> <static textres="npc_label_conviction"/> <tooltip textres="npc_toolip_conviction"/> </label_column> <npc_conviction name="conviction"/> <line_column name="divider"/> <ft_columnh name="text"> <empty textres="ft_empty"/> </ft_columnh> <header_column_sw name="gear_header"> <static textres="npc_gear"/> </header_column_sw> <npc_gear name="gear"/> </sheetdata> </windowclass>
SavageWorlds.pak\campaign\scripts\main_npc.lua
Code:-- -- Please see the license.html file included with this distribution for -- attribution and copyright information. -- function onInit() OptionsManager.registerCallback("CONV", update) self.update() end function onClose() OptionsManager.unregisterCallback("CONV", update) end function VisDataCleared() self.update() end function InvisDataAdded() self.update() end function update() local nodeRecord = getDatabaseNode() local bReadOnly = WindowManager.getReadOnlyState(nodeRecord) local bID = LibraryData.getIDState("npc", nodeRecord) local bHideConviction = not OptionsManager.isOption("CONV", "on") local bSection1 = false if type.update(bReadOnly) then bSection1 = true end if conviction.update(bReadOnly, bHideConviction) then bSection1 = true end divider.setVisible(bSection1) text.update(bReadOnly) gear.update(bReadOnly) end function onDrop(x, y, draginfo) if draginfo.isType("shortcut") then local sClass = draginfo.getShortcutData() if ItemManager2.getItemType(sClass) then gear.onDrop(x, y, draginfo) end end end
-
January 12th, 2025, 17:17 #7
- Join Date
- Sep 2020
- Location
- Ballston Lake, NY
- Posts
- 832
Give me a day or two and I'll put an extension on the Forge for this.
Add feature suggestions for Savage Worlds to Fantasy Grounds Feature Request.
-
January 13th, 2025, 14:00 #8
- Join Date
- Nov 2024
- Posts
- 14
That would be awesome!
My guess is to add only one new field like the "Type" in the NPC sheet and the search like "Type" in the NPC module.
Would be amazing to know if we need to duplicate the code and adapt it if we want more fields.
For my need I will be using it to add several fields so I guess it would be to duplicate the code and not make several extension in terms of performance.
Sincerely,
LordDante123
-
January 16th, 2025, 00:49 #9
- Join Date
- Sep 2020
- Location
- Ballston Lake, NY
- Posts
- 832
I created the extension. It's pending approval in the Forge. I'll update the thread with the store link when it's available.
[Extension] NPC RegionAdd feature suggestions for Savage Worlds to Fantasy Grounds Feature Request.
-
January 17th, 2025, 13:09 #10
- Join Date
- Nov 2024
- Posts
- 14
Thread Information
Users Browsing this Thread
There are currently 8 users browsing this thread. (0 members and 8 guests)
Bookmarks