DICE PACKS BUNDLE
Page 84 of 109 First ... 3474828384858694 ... Last
  1. #831
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,685
    Blog Entries
    1
    {self} is pulling from the current field, the field you are clicking on to roll - it might be Strength or Athletics for example.
    {modstack} is pulling from the modifier stack bottom left of the screen.

    You can use something like:
    ModifierStack.addSlot(sName, nValue);
    to add data to the Modifier Stack - eg on Cyberware or Masterwork Sword

  2. #832

  3. #833
    Hi,

    Thanks for making this software. It is a real timesaver, and it also makes the work alot more fun.

    My question is regarding the string cycler.
    It is possible to add a default label, but is it also possible to add a default value?

  4. #834
    Hello,

    i'm having a problem with the rswcombobox. In a campaign i get the following error:

    [3/27/2022 11:32:52 AM] [ERROR] Script execution error: [string "rulesetwizard/rswcombobox.lua"]:101: attempt to index a nil value

    What does the combobox in the onInit function with this?

    valueFieldNode = window.getDatabaseNode().createChild(valueFieldNam e, "string");

    Where is this string created? DB.xml?

    Many thanks for the ruleset wizard. It's a great tool!

    Ingo

  5. #835
    Quote Originally Posted by ShakyLuigi View Post
    Hi,

    Thanks for making this software. It is a real timesaver, and it also makes the work alot more fun.

    My question is regarding the string cycler.
    It is possible to add a default label, but is it also possible to add a default value?
    Hi ShakyLuigi,

    No, it's not possible. To achieve this you should create a default item in the items collection, and force it by lua to be selected by default.
    Ruleset Wizard
    The Ruleset Development Environment
    www.rulesetwizard.com
    Ruleset Wizard Tutorials
    Damned's Ruleset Wizard Tutorials

  6. #836
    Quote Originally Posted by ikschroeder View Post
    Hello,

    i'm having a problem with the rswcombobox. In a campaign i get the following error:

    [3/27/2022 11:32:52 AM] [ERROR] Script execution error: [string "rulesetwizard/rswcombobox.lua"]:101: attempt to index a nil value

    What does the combobox in the onInit function with this?

    valueFieldNode = window.getDatabaseNode().createChild(valueFieldNam e, "string");

    Where is this string created? DB.xml?

    Many thanks for the ruleset wizard. It's a great tool!

    Ingo

    since a few updates ago RSW uses its own improved version of the combobox template, named rswcombobox. The files of this template are located in the rulesetwizard folder of the .pak or .ext file. Check if this folder exists. You may have the option to exclude RSW scripts from compilation selected in the options window.

    if you don't want to use the standard CoreRPG template you have to set the Advanced Template property of your combobox control to: combobox
    Ruleset Wizard
    The Ruleset Development Environment
    www.rulesetwizard.com
    Ruleset Wizard Tutorials
    Damned's Ruleset Wizard Tutorials

  7. #837
    Quote Originally Posted by Brotherkelly View Post
    Hi Psicodelix,

    I am starting to work on the Battletech A Time of War rules using the ruleset wizard and was wondering if there is dice string for exploding a die die only when both roll the maximum. The rules use 2d6 for all actions and if both dice are a 6 then another d6 is rolled.

    I know how to set the standard exploding dice - 2d6e, but is there a command that will explode only if both are 6?

    I suspect not, in whcih case I will look to do this in the code (as I have done with my original extension).
    I have been looking into this a bit more and come up with a partial solution as shown in the code below:

    function AttributeCheck(rSource, rTarget, rRoll)

    local rMessage = ActionsManager.createActionMessage(rSource, rRoll);
    -- Debug.chat(rRoll,rRoll.total);
    local nDiceRoll = ActionsManager.total(rRoll);
    local nTotal = nDiceRoll + rRoll.nBonuses;
    -- get the Dice Roll + Modifiers total
    -- Debug.chat(nTotal);
    local nCriticalSuccess = 0;
    local nBonusRoll = 0;

    if nDiceRoll == 12 then
    -- Test if BOTH DICE are a 6
    repeat
    nBonusRoll = math.random(6);
    -- Generate a random nunber between 1 and 6
    nCriticalSuccess = nCriticalSuccess + nBonusRoll;
    until nBonusRoll < 6
    sSaveResult = "\n[CRITICAL SUCCESS] (12 + " .. nCriticalSuccess .. ")";
    -- Append a Critical Success Message
    nTotal = nTotal + nCriticalSuccess;
    -- update the roll result for a Critical Success (result - d6)
    sMargin = "\nMargin of Success = " .. tostring(nTotal-12);
    elseif nDiceRoll == 2 then
    sSaveResult = "\n[FUMBLE]";
    sMargin = "\nAutomatic Failure";
    elseif nTotal >= 12 and nCriticalSuccess == 0 then
    sSaveResult = "\n[SUCCESS]";
    sMargin = "\nMargin of Success = " .. tostring(nTotal-12);
    else
    sSaveResult = "\n[FAILURE]";
    sMargin = "\nMargin of Failure = " .. tostring(12-nTotal);
    end

    rMessage.text = rMessage.text .. sSaveResult .. sMargin;
    Comm.deliverChatMessage(rMessage);

    end


    I have used a repeat until loop to add the exploding dice result to the score. I report this in the Chat window as shown in the attached file (last roll shown has an additional d6 value generated resulting in +5 being added to the Margin of success shown). However, what I would really like is to have the extra dice 'rolled' on the screen as with a standard exploding dice roll.

    Do you have any suggestions on how I get get the additional dice rolled? Failing that how can I add the bonus number generated by the repeat until loop into the chat window dice result shown?
    Attached Images Attached Images

  8. #838

  9. #839
    Thanks Damned, a quick scan through this post fills me with hope I can sort my issue out.

    I will let you know how I get on.

    EDIT: Have applied the code and it does the trick, with only a minor issue. I have posted in the above thread about the issue I have seen.
    Last edited by Brotherkelly; March 30th, 2022 at 08:20.

  10. #840
    Hi again,

    Is it possible to center the text in the "Formatted Text"?

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