DICE PACKS BUNDLE
Page 75 of 109 First ... 2565737475767785 ... Last
  1. #741

  2. #742

  3. #743
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,685
    Blog Entries
    1
    The issue is not with this line:
    for k,v in pairs (nodeInventory.getChildren())

    it is with this line:
    do if v.getChild("equipped").getValue() == 1 then

    the field is carried not equipped

    the next issue is that these fields do not exist on the charsheet

    nodeChar.getChild("bskull").setValue(nbskull);
    nodeChar.getChild("eskull").setValue(neskull);
    nodeChar.getChild("pskull").setValue(npskull);
    nodeChar.getChild("fskull").setValue(nfskull);

    nodeChar.getChild("bface").setValue(nbface);
    nodeChar.getChild("eface").setValue(neface);
    nodeChar.getChild("pface").setValue(npface);
    nodeChar.getChild("fface").setValue(nfface);

    they occur in the weapon but not on the charsheet where you are setting them.

  4. #744
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,685
    Blog Entries
    1
    Also if you want to check if equipped then its carried == 2
    you need to look in the db.xml and see the data that is being captured.

  5. #745

    Join Date
    Nov 2017
    Location
    North Carolina, USA
    Posts
    266
    Quote Originally Posted by damned View Post
    The issue is not with this line:
    for k,v in pairs (nodeInventory.getChildren())

    it is with this line:
    do if v.getChild("equipped").getValue() == 1 then

    the field is carried not equipped

    the next issue is that these fields do not exist on the charsheet

    nodeChar.getChild("bskull").setValue(nbskull);
    nodeChar.getChild("eskull").setValue(neskull);
    nodeChar.getChild("pskull").setValue(npskull);
    nodeChar.getChild("fskull").setValue(nfskull);

    nodeChar.getChild("bface").setValue(nbface);
    nodeChar.getChild("eface").setValue(neface);
    nodeChar.getChild("pface").setValue(npface);
    nodeChar.getChild("fface").setValue(nfface);

    they occur in the weapon but not on the charsheet where you are setting them.
    That was the problem. Works well now. Still a few issues with some fields not being populated but I can troubleshoot those. The fields you mentioned are on the Notes tab. See image.

    It Works!.png

  6. #746

    Join Date
    Nov 2017
    Location
    North Carolina, USA
    Posts
    266
    Back to nodeWin and nodeChar. Is nodeWin restricted to the window the control is on? In other words, I can't reference a value on another window in the CS using nodeWin, I need to use nodeChar? For example, I want the Initiative EML (roll) on the Notes tab, but the skill data is on the Abilities tab. The script wouldn't work until I moved the Initiative EML roll to the Abilities tab.

    Disregard, sometimes I forget I have to change a number or two to get the onValueChanged scripts to work correctly.
    Last edited by greybeardgunner70; January 4th, 2022 at 17:33.

  7. #747

    Join Date
    Nov 2017
    Location
    North Carolina, USA
    Posts
    266
    I really appreciate all the help Ive gotten with this project, its been a learning experience. I am about 99% done with the CS, I'll move on to some of the other elements (mostly theme and graphics) next. However, I do have one more Q re the CS. Below is the script I have in managerRolls. When I apply modifiers through the modifiers box, it doesnt change the nResult. See image. Is it possible to script that in?

    rolls.png

    function Skill(rSource, rTarget, rRoll)

    local nSkillScore = tonumber(rRoll.SkillScore);

    local nResult = rRoll.aDice[1].result;

    local sResult = '';

    if nResult > nSkillScore then

    if nResult % 5 == 0 then
    sResult = ' (' .. nResult .. " vs EML " .. nSkillScore .. ") = Critical Failure ";
    else
    sResult = ' (' .. nResult .. " vs EML " .. nSkillScore .. ") = Marginal Failure ";
    end
    else
    if nResult % 5 == 0 then
    sResult = ' (' .. nResult .. " vs EML " .. nSkillScore .. ") = Critical Success ";
    else
    sResult = ' (' .. nResult .. " vs EML " .. nSkillScore .. ") = Marginal Success ";
    end
    end

    local rMessage = ActionsManager.createActionMessage(rSource, rRoll);

    rMessage.text = rMessage.text .. sResult;
    Comm.deliverChatMessage(rMessage);

    return true
    end
    Last edited by greybeardgunner70; January 4th, 2022 at 20:02.

  8. #748
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,685
    Blog Entries
    1
    Quote Originally Posted by greybeardgunner70 View Post
    Back to nodeWin and nodeChar. Is nodeWin restricted to the window the control is on? In other words, I can't reference a value on another window in the CS using nodeWin, I need to use nodeChar? For example, I want the Initiative EML (roll) on the Notes tab, but the skill data is on the Abilities tab. The script wouldn't work until I moved the Initiative EML roll to the Abilities tab.

    Disregard, sometimes I forget I have to change a number or two to get the onValueChanged scripts to work correctly.
    nodeChar is referencing the database.
    providing that the data you want to access is in the database then so long as you have nodeChar you can get to the data.

  9. #749
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,685
    Blog Entries
    1
    Quote Originally Posted by greybeardgunner70 View Post
    I really appreciate all the help Ive gotten with this project, its been a learning experience. I am about 99% done with the CS, I'll move on to some of the other elements (mostly theme and graphics) next. However, I do have one more Q re the CS. Below is the script I have in managerRolls. When I apply modifiers through the modifiers box, it doesnt change the nResult. See image. Is it possible to script that in?

    rolls.png

    function Skill(rSource, rTarget, rRoll)

    local nSkillScore = tonumber(rRoll.SkillScore);

    local nResult = rRoll.aDice[1].result;

    local sResult = '';

    if nResult > nSkillScore then

    if nResult % 5 == 0 then
    sResult = ' (' .. nResult .. " vs EML " .. nSkillScore .. ") = Critical Failure ";
    else
    sResult = ' (' .. nResult .. " vs EML " .. nSkillScore .. ") = Marginal Failure ";
    end
    else
    if nResult % 5 == 0 then
    sResult = ' (' .. nResult .. " vs EML " .. nSkillScore .. ") = Critical Success ";
    else
    sResult = ' (' .. nResult .. " vs EML " .. nSkillScore .. ") = Marginal Success ";
    end
    end

    local rMessage = ActionsManager.createActionMessage(rSource, rRoll);

    rMessage.text = rMessage.text .. sResult;
    Comm.deliverChatMessage(rMessage);

    return true
    end
    right under
    function Skill(rSource, rTarget, rRoll)
    do
    Debug.chat("rRoll: ", rRoll);

    do several rolls with and without modifiers
    see where the modifiers appear in the rRoll and then capture them.

  10. #750

    Join Date
    Nov 2017
    Location
    North Carolina, USA
    Posts
    266
    What do you mean by "capture them"?

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
  •  
FG Spreadshirt Swag

Log in

Log in