Starfinder Playlist
Page 1 of 2 1 2 Last
  1. #1

    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.

  2. #2
    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.

    Code:
    	<script name="XCoreDataOptions" file="scripts/XCoreDataOptions.lua" />
    Then in that file you need to add to onInit() ad the following:

    Code:
    function onInit()
    	OptionsManager.registerOption2("XCORE_CT5", false, "option_header_combat", "option_label_CT5", "option_entry_number", {});
    end
    "XCORE_CT5" is the unique identifier that will be used to access the value that is in the option.

    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

    Code:
    	<string name="option_label_CT5">Combat Tracker: Change Initiative by</string>
    to retrieve the value for the option you need to do the following:

    Code:
    	local nChangeInitBy = OptionsManager.getOption("XCORE_CT5");
    Last edited by rmilmine; March 8th, 2026 at 16:59.

  3. #3
    LordEntrails's Avatar
    Join Date
    May 2015
    Location
    -7 UTC
    Posts
    18,975
    Blog Entries
    9
    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.

  4. #4
    Quote Originally Posted by LordEntrails View Post
    So this is over in the options button/menu on the right side?
    This is how it looks in the options window:

    Screenshot 2026-03-08 120806.png
    Last edited by rmilmine; March 8th, 2026 at 17:13.

  5. #5
    Sorry yes it's the options in Tools section on the right.

  6. #6
    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.

  7. #7
    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

  8. #8
    LordEntrails's Avatar
    Join Date
    May 2015
    Location
    -7 UTC
    Posts
    18,975
    Blog Entries
    9
    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.

  9. #9
    Kelrugem's extendes automation and overlays extension for 3.5 and pathfinder has several. There sre several others for pathfinder that do as well.

  10. #10
    Here's a recent example for adding a numerical option:

    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), },
    	});
    For a campaign specific option, it would look more like:

    Code:
    	OptionsManager.registerOptionData({ sKey = "XCORE_CT5", sGroupRes = "option_header_combat", sType = "option_entry_number", }, });
    Regards,
    JPG

Page 1 of 2 1 2 Last

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
DICE PACKS BUNDLE

Log in

Log in