FG Spreadshirt Swag
Page 28 of 30 First ... 182627282930 Last
  1. #271
    Yes, this would be best as an extension.
    Dominic Morta
    Ruleset Developer
    Smiteworks

    How to zip up your campaign if the Developers ask for it-How to zip up your campaign if the Developers ask for it

    How to provide an Unity Connection issue?-Connection Issues and What to Provide

    Unity Updater issue?-Updater Issues

    Classic and Unity Port Forwarding?-Fantasy Grounds Connections Explained

    Comcast or Cox ISP User?-Comcast XFinity and Cox Users

    Have a suggestion?-Feature Request

  2. #272

    Join Date
    Mar 2009
    Location
    Lidingö, Sweden, Europe
    Posts
    374

    Strike rank code is not working

    While testing my own strike rank handling code I noticed that the existing code doesn't really work as expected.

    The SR value is never updated. That's probably because
    Code:
    local nodeActor = link.getTargetDatabaseNode();
    in onUptionUpdate() in ct/scripts/ct_entry.lua returns nil.

    This code in getStrikeRank() in scripts/manager_gameline.lua
    Code:
    local DEX = DB.getValue(node, "abilities.dexterity", 11);
    local SIZ = DB.getValue(node, "abilities.size", 11);
    returns values even if the node is nil.

  3. #273

    Join Date
    Mar 2009
    Location
    Lidingö, Sweden, Europe
    Posts
    374
    Following up on the previous post.

    You can verify the problem by:
    a) create a new campaign
    b) turn on the strike ranks option
    c) reload the ruleset
    d) create character
    e) Drag it to the CT. The SR will be 5.
    f) Change the characters SIZ and DEX to 21. This should set the SR to 1. But it doesn't, it remains at 5.
    g) Change SIZ and DEX to 3. This should set the SR to 7. But it doesn't, it remains at 5.

  4. #274

    Join Date
    Mar 2009
    Location
    Lidingö, Sweden, Europe
    Posts
    374
    Further investigation.

    Debugging
    Code:
    local nodeActor = link.getTargetDatabaseNode();
    with
    Code:
    Debug.console("Node Actor 1", nodeActor)
    I get
    s'Node Actor 1' | databasenode = { combattracker.list.id-00001 }
    which I'm pretty sure is not what's needed. I know that the code is old so this maybe is some code that needs to be refactored?

  5. #275

    Join Date
    Mar 2009
    Location
    Lidingö, Sweden, Europe
    Posts
    374
    Digging into this a bit more.

    In ct/scripts/ct_entry.lua the following code, from onOPtionsUpdate()
    Code:
    function onOptionUpdate()
    	...
    	local nodeChar = link.getTargetDatabaseNode();
    results in a different database node then this code from linkPCFields()
    Code:
    function linkPCFields()
    	super.linkPCFields();
    
    	local nodeChar = link.getTargetDatabaseNode();
    The code in linkPCFields returns the characters db node (which is what you want), while onOptionUpdate don't. Since onOptionUpdate calls getStrikeRank with no db node the SR update fails.

  6. #276
    I can get it to factor the Siz and Dex mods, but it won't factor weapon or power mods into the Strike Rank. That would require more factoring to have the players/GM to pick their action and add them to the box. Which as you can see is a bit of an undertaking.
    Dominic Morta
    Ruleset Developer
    Smiteworks

    How to zip up your campaign if the Developers ask for it-How to zip up your campaign if the Developers ask for it

    How to provide an Unity Connection issue?-Connection Issues and What to Provide

    Unity Updater issue?-Updater Issues

    Classic and Unity Port Forwarding?-Fantasy Grounds Connections Explained

    Comcast or Cox ISP User?-Comcast XFinity and Cox Users

    Have a suggestion?-Feature Request

  7. #277

    Join Date
    Mar 2009
    Location
    Lidingö, Sweden, Europe
    Posts
    374
    Quote Originally Posted by superteddy57 View Post
    I can get it to factor the Siz and Dex mods, but it won't factor weapon or power mods into the Strike Rank. That would require more factoring to have the players/GM to pick their action and add them to the box. Which as you can see is a bit of an undertaking.
    Yes, I understand that. But, as I explained in my posts above, the existing code doesn't work. The SR is never updated because the getStrikerank funktion gets a nil value instead of a character node.

    Just to avoid any misunderstandings, I'm not asking you to factor weapons or power into strike ranks, I'm going to fix that part myself. I'm just letting you know that there's a problem with the existing code, and (incidentally) that create problems down the line for my code.
    Last edited by peterb; April 1st, 2024 at 22:06.

  8. #278
    Yes, I understand your request. I just wanted to be sure there was no misunderstanding with power and weapon mods to the strike rank.
    Dominic Morta
    Ruleset Developer
    Smiteworks

    How to zip up your campaign if the Developers ask for it-How to zip up your campaign if the Developers ask for it

    How to provide an Unity Connection issue?-Connection Issues and What to Provide

    Unity Updater issue?-Updater Issues

    Classic and Unity Port Forwarding?-Fantasy Grounds Connections Explained

    Comcast or Cox ISP User?-Comcast XFinity and Cox Users

    Have a suggestion?-Feature Request

  9. #279

    Join Date
    Mar 2009
    Location
    Lidingö, Sweden, Europe
    Posts
    374
    Well, I got it working.

    In ct/scripts/ct_entry.lua I modified onOptionUpdate() so that the DB.setValue used the database node of the CT windowlist.
    Code:
    function onOptionUpdate()
        local sOptHRSR = OptionsManager.getOption("HRSR");
        strikerank.setVisible(sOptHRSR == "on");
        local nodeChar = link.getTargetDatabaseNode();
        local ctNode = getDatabaseNode();
        local nStrikeRank = LineManager.getLine().GetStrikeRank(nodeChar);
        DB.setValue(ctNode, "strikerank", "number", nStrikeRank);
    end
    I also modified linkPCFields() and added a link to a aggregated SR value that is re-calculated when the underlying data is changed.
    Code:
    function linkPCFields()
    	super.linkPCFields();
    
    	local nodeChar = link.getTargetDatabaseNode();
    	if nodeChar then
    		pp.setLink(DB.createChild(nodeChar, "pp.current", "number"), true);
    		wounds.setLink(DB.createChild(nodeChar, "wounds", "number"));
    		hp.setLink(DB.createChild(nodeChar, "hp.max", "number"), true);
    
    		initresult.setLink(DB.createChild(nodeChar, "abilities.dexterity", "number"), true);
    		strikerank.setLink(DB.createChild(nodeChar, "sr.activeSR", "string"), true);
    	end
    end
    As an added bonus the ordering of entries worked out by itself since high DEX = low SR.
    Last edited by peterb; April 2nd, 2024 at 13:26.

  10. #280
    I pushed a hotfix for the strike rank issue. I would look over the code for my implementation as it is somewhat different than the approach you have made.
    Dominic Morta
    Ruleset Developer
    Smiteworks

    How to zip up your campaign if the Developers ask for it-How to zip up your campaign if the Developers ask for it

    How to provide an Unity Connection issue?-Connection Issues and What to Provide

    Unity Updater issue?-Updater Issues

    Classic and Unity Port Forwarding?-Fantasy Grounds Connections Explained

    Comcast or Cox ISP User?-Comcast XFinity and Cox Users

    Have a suggestion?-Feature Request

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