-
March 7th, 2026, 20:04 #1Patriarch
- Join Date
- Nov 2019
- Posts
- 438
example of adding a number field to the options window in the combat section
Can someone give me a place to find an example of how to add an option to the options window in the combat section?
Something that shows how to access it would be great as well.
Thanks,
Robert.
-
March 8th, 2026, 16:51 #2Patriarch
- Join Date
- Nov 2019
- Posts
- 438
After giving up finding anything that works using a search as it all showed doing xml and lua code that didn't work.
So I went into an extension that I know has options and found the code that made them show up and how to access them.
So to make an options show up you need to create a lua file and use <script name="" file="" /> in the base.xml or extension.xml file.
Then in that file you need to add to onInit() ad the following:Code:<script name="XCoreDataOptions" file="scripts/XCoreDataOptions.lua" />
"XCORE_CT5" is the unique identifier that will be used to access the value that is in the option.Code:function onInit() OptionsManager.registerOption2("XCORE_CT5", false, "option_header_combat", "option_label_CT5", "option_entry_number", {}); end
false notes if it is to be displayed on the client and host or just host.
"option_header_combat" is the section in the options where the item willl be displayed.
"option_label_CT5" is a string name that is used to get the label.
"option_entry_number" is the name of what type of data it is, "option_entry_cycler" is also available and has lots of options.
{} is for any options related to the item. for number there is { min=#, max=# } with # being replaced by actual numbers.
"option_label_CT5" is defined in a strings.xml file
to retrieve the value for the option you need to do the following:Code:<string name="option_label_CT5">Combat Tracker: Change Initiative by</string>
Code:local nChangeInitBy = OptionsManager.getOption("XCORE_CT5");Last edited by rmilmine; March 8th, 2026 at 16:59.
-
March 8th, 2026, 17:01 #3
So this is over in the options button/menu on the right side?
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 8th, 2026, 17:10 #4Patriarch
- Join Date
- Nov 2019
- Posts
- 438
This is how it looks in the options window:
Screenshot 2026-03-08 120806.pngLast edited by rmilmine; March 8th, 2026 at 17:13.
-
March 8th, 2026, 17:13 #5Patriarch
- Join Date
- Nov 2019
- Posts
- 438
Sorry yes it's the options in Tools section on the right.
-
March 8th, 2026, 17:25 #6Patriarch
- Join Date
- Nov 2019
- Posts
- 438
After some testing, it appears the true/false parameter is not if it shows up in the client or host. I'm not sure what it does.
-
March 8th, 2026, 17:33 #7Patriarch
- Join Date
- Nov 2019
- Posts
- 438
what I did to make it only show up on the host and not on the client was the following:
Code:if User.isHost() then OptionsManager.registerOption2("XCORE_CT5", true, "option_header_combat", "option_label_CT5", "option_entry_number", {}); end
-
March 9th, 2026, 15:22 #8
Thanks, I get it now. Wasn't sure at first. I haven't touched the options menu at all. Trying to think of a free extension that is not in the vault that does. Maybe NPC Flavors, Player Agency, or Safety Toolkit?
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 9th, 2026, 15:35 #9Patriarch
- Join Date
- Nov 2019
- Posts
- 438
Kelrugem's extendes automation and overlays extension for 3.5 and pathfinder has several. There sre several others for pathfinder that do as well.
-
March 9th, 2026, 17:41 #10SmiteWorks
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 23,306
Here's a recent example for adding a numerical option:
For a campaign specific option, it would look more like:Code:OptionsManager.registerOptionData({ sKey = "TOKEN_SPEECH", bLocal = true, sGroupRes = "option_header_client_notify", sType = "option_entry_number", tCustom = { min = 0, default = tostring(OverlayManager.DEFAULT_SPEECH_NOTIFY_DURATION), }, });
Regards,Code:OptionsManager.registerOptionData({ sKey = "XCORE_CT5", sGroupRes = "option_header_combat", sType = "option_entry_number", }, });
JPG
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)

Reply With Quote


Bookmarks