DICE PACKS BUNDLE
Page 31 of 109 First ... 2129303132334181 ... Last
  1. #301

    Join Date
    Mar 2020
    Location
    Sydney, Australia
    Posts
    247
    Great thanks.

    I run an Intel Mac so I also run parallels - however I always find native apps faster.

    Would love to help out if you ever decide to migrate to the Mac.
    Thanks In Advance,
    D

  2. #302
    Hello,
    the Ruleset Wizard is amazing. I like to use it.
    I have one question on using rolls. Is it possible to bring the name oder databasenode of the field to the ActionHandler? Maybe by using something like self.getName() in the Additional data? I would like to give more Information to the players: “John attacks using xy (= the Name of the weapon) … “. Writing the field name manually in the additional data works but I would like to use this for a List of weapons / a list of abilities. And there seems no way to transfer the information from list entries.

    Ingo

    P.S. Sorry for posting the question in your blog too. I found this thread later.

  3. #303
    No problem, I answer here too.

    You can use the AdditionalData struture to pass your own custom data to the action handler function from the onBeforeDiceRoll() function.


    You could do something like this:

    Code:
    function onBeforeDiceRoll()
        local nodeWin = window.getDatabaseNode();
        DiceRollAdditionalInfo[“attackname”] = DB.getValue(nodeWin, “attackname”);
    end
    and in the action handler function you can get the value with:


    Code:
    local attackname = rRoll[“attackname”];
    however the easiest way would be using the Roll Description Text property, here you can reference other fields with the {} operator, like this:

    Code:
    attacking with {attackname}
    Last edited by psicodelix; February 7th, 2021 at 21:00.
    Ruleset Wizard
    The Ruleset Development Environment
    www.rulesetwizard.com
    Ruleset Wizard Tutorials
    Damned's Ruleset Wizard Tutorials

  4. #304

  5. #305
    Thanks to both of you for the answers. The code from psicodelix works great for me! Haven't had the time to try the other way. Maybe in the nearer future i'll try to get that running for me!

    Ingo

  6. #306
    Hi,

    Just purchased yesterday and its working great.....

    A couple of minor thoughts:

    - How about a dark mode? (or even custom themes?)

    - When the contents of a object/tab has been amended, highlight this (small icon on the tab or maybe just bold the name on the tab). Obviously clear/unbold upon saving.

    - An option to disable CTL+G popping up a save dialog. Just save the .ext file.
    Ultimate License
    UK Time Zone (GMT/BST)
    DM'ing since 1977 (Basic D&D)

    Currently Playing:
    Empire of the Ghouls 5E Campaign
    Tales from the Yawning Portal 5E Campaign
    Rise of the Runelords Pathfinder 1e
    Amazing Adventures 5E Campaign
    "Some are born to move the world, to live their fantasies
    But most of us just dream about the things we'd like to be."
    Rush - Losing It


    Currently DM'ing
    Princes of the Apocalypse 5E Campaign
    Waterdeep: Mad Mage 5E Campaign
    The Blight 5E Campaign

  7. #307
    Hi Colin, and welcome.

    Dark mode is already on the wish list, I often miss it too. It's not at the top of the list, but it will come soon.


    Rright now I'm modifying the internal structure of the archive, to allow collaboration of different users on the same project, versioning and source code control, git integration, etc, which will take some time.


    About tracking changes in properties (including undo action) will come right after this.


    The option about ctrl+G is fine, I will add it in the next revision.
    Ruleset Wizard
    The Ruleset Development Environment
    www.rulesetwizard.com
    Ruleset Wizard Tutorials
    Damned's Ruleset Wizard Tutorials

  8. #308

    Error when using a script file

    Okay, I have some code I want to run that relies on two different inputs, a Dropdown List and a Number Field. I've tried two approaches with this:

    I created a scripts folder, and added the code to a script file, class_handler
    I added a Custom Property, as provided in earlier examples with a Property Name: script and Attributes: file="scripts/class_handler.lua". I also tried file="../scripts/class_handler.lua" just because it's not a subfolder of campaign.

    The second approach was that I copied the function into the Window itself, so that it would be available in the compiled file.

    Both approaches yielded an error of: Script execution error: [string "combo_class"]:28 attempt to call global 'onClassLevelChange' (a nil value)

    The function is as follows:


    function onClassLevelChange()
    local nodeWin = window.getDatabaseNode();
    local sClass = nodeWin.getChild("combo_class").getValue();
    Debug.chat("combo_class", sClass);
    end

    And the code I'm using in my DropDown List is:

    function onValueChanged()
    onClassLevelChange();
    end

    Any idea how to get this to work, as I do not want duplicated code if I can prevent it.

  9. #309
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,655
    Blog Entries
    1
    Do something like this on each element:

    Code:
    			<script>
    				function onValueChanged()
    						local nodeWin = window.getDatabaseNode();
    						CharacterUpdate.updateSomething(nodeWin);
    					end
    			</script>
    and this in ruleset.xml

    Code:
    		<script name="CharacterUpdate" file="scripts/manager_characterupdate.lua" />
    and this in manager_characterupdate.lua

    Code:
    function updateSomething(nodeWin)
    	local nPerception = nodeWin.getChild("abilities.perception.tempmodifier").getValue();
    	local nStealthMod = nodeWin.getChild("def.stealth.mod").getValue();
    	nodeWin.getChild("def.stealth.score").setValue(nDefenceStealth);
    end

  10. #310
    your first definition of the script is correct (script/class_handler.lua), however I've found a strange behaviour testing it that makes your approach not work.

    the final code for your control would be something like this:

    Code:
    <script>
      function onValueChanged()
        onClassLevelChange();
      end
    </script>
    <script file="scripts/class_handler.lua"></script>
    with this order of xml tags FG seems unable to find the functions in class_handler.lua.

    If you change the code to

    Code:
    <script file="scripts/class_handler.lua"></script>
    <script>
      function onValueChanged()
        onClassLevelChange();
      end
    </script>
    for some reason it works.

    This change is not possible with the wizard, only by editing the final code, but since it is quite requested I will add a script file property in the controls in the next update.

    meanwhile you can use a global script as Damned suggested.
    Ruleset Wizard
    The Ruleset Development Environment
    www.rulesetwizard.com
    Ruleset Wizard Tutorials
    Damned's Ruleset Wizard Tutorials

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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
  •  
STAR TREK 2d20

Log in

Log in