FG Spreadshirt Swag
Page 1 of 2 12 Last
  1. #1

    Can Player Disable Campaign Extension

    Is it possible for a player to disable an extension that is enabled in a game they join?

    Specifics
    I, as the GM, have an extension that puts my dice in a very specific location. It works great for the size and resolution of my monitor.

    However, when players join my game this extension automatically loads for them. Because they have monitors with different sizes and resolutions it puts the dice in a 'weird' place for them.

    Can the players disable or not load this specific extension when they are joined to my game.

    Daniel

  2. #2
    LordEntrails's Avatar
    Join Date
    May 2015
    Location
    -7 UTC
    Posts
    17,271
    Blog Entries
    9
    Welcome to FG. No, players can not disable extensions.

    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.

  3. #3
    Players cannot unload or disable extensions, but perhaps the extension author can put in code that the code only gets executed for the GM.
    For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e

  4. #4
    Thank you for the replies. Unfortunate, but not unexpected. I'll look at different options.

  5. #5
    Quote Originally Posted by dllewell View Post
    Thank you for the replies. Unfortunate, but not unexpected. I'll look at different options.
    if you don't mind looking at a bit of code, you could open the extension, and it's likely editing the desktop_pannel.xml or desktop_classes.xml files. in there for the extension, you can likely set it so that it's only for host that the change is applied.

  6. #6

  7. #7
    Thank you for the responses. I did look at the code and started down the same path as indicated above. Specifically the User.isHost() command. I could not, however, find any way to use the User.isHost() command to then call xml commands. The extension I'm modifying is actually the Move Dice extension that you wrote Damned.

    Specifically, the gameelements.xml is modified. For each of the dice a <position> tag is added, see below -

    <die name="d4">
    <icon>d4icon</icon>
    <position>-3050,-68</position>
    </die>

    I can add a <script> tag to the <die> tag but I can't then call the <position> tag from inside the function in the <script> tag

    <die name="d4">
    <icon>d4icon</icon>
    <script>
    function changePos()
    if User.isHost() then
    <position>-3050,-68</position>
    end
    end
    </script>
    </die>

    I get this error when loading the extension - "Script Error: [string "d4"]:1: 'end' expected near '<eof>'". I did try the code with and without a semicolon at the end of the <position> tag line of code.

    So. Is there a different way to call the xml tag from within the <script> tag? Or is there a way to set the position using lua code in the function? Or is there a different way to do this?

    Sorry for the wall of text but I wanted to be clear on the code I was using.

  8. #8
    Quote Originally Posted by dllewell View Post
    Thank you for the responses. I did look at the code and started down the same path as indicated above. Specifically the User.isHost() command. I could not, however, find any way to use the User.isHost() command to then call xml commands. The extension I'm modifying is actually the Move Dice extension that you wrote Damned.

    Specifically, the gameelements.xml is modified. For each of the dice a <position> tag is added, see below -

    <die name="d4">
    <icon>d4icon</icon>
    <position>-3050,-68</position>
    </die>

    I can add a <script> tag to the <die> tag but I can't then call the <position> tag from inside the function in the <script> tag

    <die name="d4">
    <icon>d4icon</icon>
    <script>
    function changePos()
    if User.isHost() then
    <position>-3050,-68</position>
    end
    end
    </script>
    </die>

    I get this error when loading the extension - "Script Error: [string "d4"]:1: 'end' expected near '<eof>'". I did try the code with and without a semicolon at the end of the <position> tag line of code.

    So. Is there a different way to call the xml tag from within the <script> tag? Or is there a way to set the position using lua code in the function? Or is there a different way to do this?

    Sorry for the wall of text but I wanted to be clear on the code I was using.
    try replacing it with this and see if that works (you will need to set your coordinates yourself, my d4 is set at <position>470,-68</position>)
    Code:
    
    <!--GM's Dice -->
    <die name="d4">
    <icon>d4icon</icon>
    <position>distancefromleftinpixels,distancefromtopinpixels</position>
    <script>
    function onInit()
    if User.isHost() then
    setVisible(true);
    else
    setVisible(false);
    end
    </script>
    </die>
    
    
    <!--Player's Dice -->
    <die name="d4">
    <icon>d4icon</icon>
    <position>distancefromleftinpixels,distancefromtopinpixels</position>
    <script>
    function onInit()
    if not User.isHost() then
    setVisible(false);
    else
    setVisible(true);
    end
    </script>
    </die>
    Last edited by pr6i6e6st; May 13th, 2020 at 15:58.

  9. #9
    pr6i6e6st - Good idea. Unfortunately, that does not appear to work.

    Whatever <position> values are put in the second <die> tag are what are used.

    I added some Debug.chat calls and best I can tell the <script> is never called.

    Reviewing the Developer Ruleset API Reference for the <die> tag it does not look like the <script> tag is an option here. (https://www.fantasygrounds.com/refdoc/die.xcp)

    -----

    die
    This definition is used to define the properties of a built-in die resource.

    If a standard die type (d4,d6,d8,d10,d12,d20,dF) is defined, the 3D model of the die will be available on the desktop.

    Definition
    <die name="..." >
    <icon > ... </icon> The name of an icon resource used to represent the die results in the chat log
    <position > ... </position> The default placement of the die on the desktop in the form "x,y"
    </die>

  10. #10
    what about changing the first line <die name="d4" mode="host"> and a duplicate d4 control which has the mode "client"? scratch the script stuff.

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