Starfinder Playlist
  1. #1

    Join Date
    Apr 2009
    Fullerton, CA.

    Help with Local versus Host scripting


    I am working in some new territory here so any help is appreciated. I have been reading through the "User" portion of the developer guide and have only managed to get myself lost. I am trying to create an option that will modify a portion of the character sheet with an option players can set. It works, but if the GM has the same option set to a different setting the GM's display will be different.

    Sample. The option can set a label to read X, Y, or Z. The player sets the label to X. The GM has the same option set to Y. The player's charsheet displays X, the GM opens the player's charsheet and will see Y. How can I set this so the GM is forced to see the option the player has chosen, i.e. X?

    Code I have so far:

    function onInit()
        OptionsManager.registerCallback("CGS", updateDisplayGear);
    function onClose()
        OptionsManager.unregisterCallback("CGS", updateDisplayGear);
    function updateDisplayGear() 
        local sOp = OptionsManager.getOption("CGS");
        local bDH1 = sOp == "dh1";
        local bRT = sOp == "rt";
        local bDW = sOp == "dw";
        local bBC = sOp == "bc";
        local bOW = sOp == "ow";
        local bDH2 = sOp == "dh2";
        influence_label.setVisible(bDH1 or bRT or bDW or bOW or bDH2);
        influence.setVisible(bDH1 or bRT or bDW or bOW or bDH2);
            --Changes to fields
            if bDH1 or bDH2 then
            elseif bRT then
                influence_label.setValue("PROFIT FACTOR:");
            elseif bDW then
            elseif bOW then

  2. #2
    If you want the player to be able to make changes on the PC sheet that stay with the PC sheet, then you should not use the options system, since the options system is for global settings. That's why the current user's option setting always controls the display.

    Instead, you should create another button or field on the PC sheet which allows either the GM or player to toggle whether the extra fields will display. In that way, the data for whether the extra fields are displayed is stored with the PC.

    This is similar to the way the Mode field on the PC sheet Actions tab is handled for 5E and 3.5E D&D. The mode is saved with the character data.


  3. #3

    Join Date
    Apr 2009
    Fullerton, CA.
    OK, I can do that. Thank you.

Thread Information

Users Browsing this Thread

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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
FG Spreadshirt Swag

Log in

Log in