STAR TREK 2d20
Page 2 of 2 First 12
  1. #11
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,408
    Like I mentioned - put some debug code into the script to see *exactly* where node CT is pointing to. Savage Worlds has the additional <combatants> structure within the Combat Tracker which other rulesets don't have, so that might be causing an issue for ActorManager.getCTNode returning the actual actor node.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  2. #12
    oh god.. how do I put the debug code into the script? I assume I cut and paste this:

    Debug.console("nodeCT = ", nodeCT);

    into this:

    function customizeRoll(rRoll)
    local nodeCT = ActorManager.getCTNode(rRoll.actor);
    if nodeCT then
    local nWildcard = DB.getValue(nodeCT, "reach", 0);
    if nWildcard == 7 then
    rRoll.custom.maxacing = 0;
    end
    end
    end


    So... it should look like this?

    function customizeRoll(rRoll)
    local nodeCT = ActorManager.getCTNode(rRoll.actor);
    Debug.console("nodeCT = ", nodeCT);
    if nodeCT then
    local nWildcard = DB.getValue(nodeCT, "reach", 0);
    if nWildcard == 7 then
    rRoll.custom.maxacing = 0;
    end
    end
    end

    And then, I open FG, type /console and then try a roll to see if it aces?

    Also, here is another picture to show how far into db the reach (and wildcard) variable are.

    CropperCapture[2].jpg

  3. #13
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,408
    Quote Originally Posted by chillybilly View Post
    So... it should look like this?

    function customizeRoll(rRoll)
    local nodeCT = ActorManager.getCTNode(rRoll.actor);
    Debug.console("nodeCT = ", nodeCT);
    if nodeCT then
    local nWildcard = DB.getValue(nodeCT, "reach", 0);
    if nWildcard == 7 then
    rRoll.custom.maxacing = 0;
    end
    end
    end

    And then, I open FG, type /console and then try a roll to see if it aces?
    Yep.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  4. #14
    I tried the above, rolled three times (one of them aced) and got this

    CropperCapture[4].jpg

    And by the way, I am totally cool if you want to throw up your hands and tell me to take a coding class at my local college! You've helped me many, many times in the past and I kind of gotta believe it's getting old for you.

  5. #15
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,408
    Quote Originally Posted by chillybilly View Post
    I tried the above, rolled three times (one of them aced) and got this

    CropperCapture[4].jpg
    That was what I feared - it doesn't work for the Savage Worlds ruleset.

    Quote Originally Posted by chillybilly View Post
    And by the way, I am totally cool if you want to throw up your hands and tell me to take a coding class at my local college! You've helped me many, many times in the past and I kind of gotta believe it's getting old for you.
    I'll look at it a bit more before I throw my hands in the air!
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  6. #16
    I really do appreciate your help in this.

    Is there a way I can have that extension work only when the left alt key is pressed or something? It did work when I did the user.ishost thing and I'm not picky. It'd just be nice to be able to have something where I can make extras not ace and wildcards ace even if I have to press a button or change a setting for something.

    Anyway, thanks for the help and Curse You, Savage Worlds Ruleset!

  7. #17
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,408
    Try this:

    Code:
    function customizeRoll(rRoll)
    	local sActorType, nodeCT = CharacterManager.asCharActor(rRoll.actor);
    	Debug.console("rRoll.actor, sActorType, nodeCT = ", rRoll.actor, sActorType, nodeCT);
    	if nodeCT then
    		local nWildcard = DB.getValue(nodeCT, "wildcard", 0);
    		if nWildcard == 0 then
    			rRoll.custom.maxacing = 0;
    		end
    	end
    end
    Last edited by Trenloe; November 11th, 2020 at 21:22.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  8. #18
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,408
    Quote Originally Posted by chillybilly View Post
    Is there a way I can have that extension work only when the left alt key is pressed or something? It did work when I did the user.ishost thing and I'm not picky. It'd just be nice to be able to have something where I can make extras not ace and wildcards ace even if I have to press a button or change a setting for something.
    You can use if Input.isAltPressed() then... but I wouldn't recommend that as the Savage Worlds ruleset already uses ALT a lot to change functionality.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  9. #19
    I really hope your sitting on your own private island drinking margaritas somewhere.

    Your coding worked perfectly. Extras don't ace and wildcards do.

    THANKS SO MUCH! I've given you rep (that you hardly need) but I wish there was something more I could do. You should consider a patreon or something! You'd be able to afford a second island.

  10. #20
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,408
    Haha - glad that worked.

    I'm quite happy with this island thanks. Although the margartia goblins have slowed recently, I'll have to crack the whip a bit...
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

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

Log in

Log in