STAR TREK 2d20
  1. #1971
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,685
    Blog Entries
    1
    Please work with me here - you know the rules - I do not.
    I spend many, many hours making these things work and its not much fun doing them over and over.
    I need to know all the details.
    Things like can X and Y be negatives?
    Again - you know the answer - I dont. I need all the info with examples. Verbose examples please.

  2. #1972
    Phystus's Avatar
    Join Date
    Aug 2008
    Location
    Central Indiana
    Posts
    451
    Blog Entries
    20
    X, Y and Z are positive integers, range 1-99 (99 would be absurdly high, but probably easier to not assign a lower valid range. Low two-digit numbers are definitely possible). Modifiers can be positive or negative, probably range -99 to 99 but no need to constrain since we're just doing math with those.

    Valid examples:
    /ubiquity 3 --> rolls 3 dice, evaluates for success
    /ubiquity 3 /mod 2 --> rolls 5 dice, evaluates for success
    /ubiquity 3+2 --> rolls 5 dice, evaluates for success
    /ubiquity 20+7+3 /mod -27 --> rolls 3 dice, evaluates for success
    /ubiquity 90+90+90 /mod -267 --> rolls 3 dice, evaluates for success
    /ubiquity 1+1+1 /mod 10 --> rolls 13 dice, evaluates for success

    Is that helpful? What else do you need?

    I'm also working on this myself, hopefully one of us will get somewhere. Right now I've been able to construct an array of individual substrings of the roll (i.e. 1,1,1 in the last example), just need to figure out how to iterate over the array to add them up. I'm new to Lua (lots of programming experience, but not Lua or C). Any help there?

    ~P

  3. #1973
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,685
    Blog Entries
    1
    please test this

    Code:
    function createRoll(sParams)
      local rRoll = {};
      rRoll.sType = sCmd;
      rRoll.nMod = 0;
      rRoll.aDice = {};
      
       if sParams:match("([^%s+]+)+([^%s+]+)+([^%s+]+)%s(.*)") then
    -- 	Debug.chat("three");
    	sCount1, sCount2, sCount3, sDesc = sParams:match("([^%s+]+)+([^%s+]+)+([^%s+]+)%s(.*)");
    	nCount1 = tonumber(sCount1);
    	nCount2 = tonumber(sCount2);
    	nCount3 = tonumber(sCount3);
    --	Debug.chat("three: ", nCount1, nCount2, nCount3, sDesc);
       elseif sParams:match("([^%s+]+)+([^%s+]+)%s(.*)") then
    --	Debug.chat("two");
    	sCount1, sCount2, sDesc = sParams:match("([^%s+]+)+([^%s+]+)%s(.*)");
    	nCount1 = tonumber(sCount1);
    	nCount2 = tonumber(sCount2);
    	nCount3 = 0;
    --	Debug.chat("two: ", nCount1, nCount2, nCount3, sDesc);
       elseif sParams:match("([^%s+]+)%s(.*)") then
    --	Debug.chat("one");
    	sCount1, sDesc = sParams:match("([^%s+]+)%s(.*)");
    	nCount1 = tonumber(sCount1);
    	nCount2 = 0;
    	nCount3 = 0;
    --	Debug.chat("one: ", nCount1, nCount2, nCount3, sDesc);
       end
     
    	nCount = nCount1+nCount2+nCount3;
    --	Debug.chat("nCount", nCount);
    
    	local sDesc1, nMod = ModifierStack.getStack(true);
    	nDice = nCount+nMod;
    	sDice = nDice.. "d6";
    	local aDice = StringManager.convertStringToDice(sDice);
    
    	rRoll.sDesc = sDesc .. " " .. sDesc1;
    
    	rRoll.aDice = aDice;
      return rRoll;
    end

  4. #1974
    Phystus's Avatar
    Join Date
    Aug 2008
    Location
    Central Indiana
    Posts
    451
    Blog Entries
    20
    This seems to work too...
    Code:
    function createRoll(sParams)
    --	Debug.chat("28");
      local rRoll = {};
      rRoll.sType = sCmd;
      rRoll.nMod = 0;
      -- Removed to allow ChatManager.createBaseMessage function to create the right name - active character or player name if no characters are active.
      --rRoll.sUser = User.getUsername();
      rRoll.aDice = {};
    
        
      
      -- Now we check that we have a properly formatted parameter, or we set the sDesc for the roll with a message.
    if not sParams:match("(%d+)%s(.*)") then
        rRoll.sDesc = "Parameters not in correct format. Should be in the format of \"/ubiquity # <desc>\"";
       return rRoll;
    end
     -- if not sParams:match("(%d+)d([%dF]*)%s(.*)") then
    --    rRoll.sDesc = "Parameters not in correct format. Should be in the format of \"#d# <desc>\"";
     --   return rRoll;
    --  end
      
    --	local sDice, sDesc = sParams:match("([^%s]+)%s*(.*)");
    	local sDice, sDesc = sParams:match("([^%s]+)%s*(.*)");
    
    	local sDesc1, nMod = ModifierStack.getStack(true);
    	local sDelim = "+"
    	local aDielist = StringManager.split(sDice, sDelim, 1);
    
    	local nDice = 0;
    	local i = 1;
    	for i =1, #aDielist do
    	    local nDie = tonumber(aDielist[i]);
    		nDice = nDice+nDie;
    	end;
    
    	nDice = nDice + nMod;
    	sDice = nDice .. "d6";
    
    	local aDice = StringManager.convertStringToDice(sDice);
    
    	rRoll.sDesc = sDesc .. " " .. sDesc1;
    	rRoll.aDice = aDice;
      return rRoll;
    end
    Finally figured out how to index an array.

    Much thanks for your help!

    ~P

  5. #1975
    Quote Originally Posted by LordEntrails View Post
    I'm curious, what game is it you are looking to play with FG?
    We use d20/D&D/Pathfinder as a baseline, but with a lot of content that is either homebrew or converted content from other sources.

    I do understand that the basic SRD package can't include everything, but there is a certain minimum threshold that should be met- which I'm just not seeing. (I'd want the character form to be at /least/ as functional as what WoTC had in the form of MasterTools back in the day, which was at least intuitive enough for most people to make it work out of the box, and had the capability of updating variables based on feats/equipment/etc.) We didn't pick up licenses to have an excuse to learn advanced LUA/XML scripting. We picked them up in order to play the actual game.

    I'm not adverse to learning XML and LUA and I am currently attempting to chew through the tutorials. I just don't think it should be a requirement to gain baseline functions that should already be present.

    I do realize that there is an officially licensed ruleset available for purchase, but as far as I'm aware it's nothing more than a reformatted version of the physical books that we already own. It wouldn't be worth the purchase, unless it actually solved the database referencing issue. There's no point of entering homebrew content to the computerized form, if the computerized form can't update the math.

  6. #1976
    wndrngdru's Avatar
    Join Date
    Jun 2015
    Location
    US, Central (UTC -6 or -5)
    Posts
    446
    Quote Originally Posted by damned View Post
    Confirmed bug.
    It seems no one uses Ability libraries. This looks like it has been broken for over 2 years due to changes in CoreRPG.
    Use Rolls without a formula.
    @qdwag & @damned
    Weird. The drag and drop from the Abilities library to the Abilities tab is still working for me under FGC with the current MoreCore under a brand new install. I put the spells under the Abilities library in the Dungeon World modules mostly because there isn't a Spells library.
    To be clear, the entries themselves have no mechanical function and are only there as easy "spellbook" entries which include the text from the manual. The text also includes a roll (for those spells that use them) that can be dragged and dropped into the character sheet spells window or wherever the player wants to put it.

    What I do see is that in the theme update in MoreCore, we lost the group pulldown in the Abilities library. I had all the spell entries grouped by class and level.

    I know I'm going to have to go in and rework some stuff with the new functions in MoreCore and whatever is coming down the pipe with FGU. It would be nice to have some sort of library for spells, whatever that looks like. Otherwise, that's a bunch more stuff to clutter the Rolls library with.

    EDIT: It looks like the drag 'n' drop issue is FGU only. It still works fine in FGC (missing group menu notwithstanding).
    Last edited by wndrngdru; March 25th, 2020 at 00:44.
    --
    I'm so bassic

  7. #1977
    LordEntrails's Avatar
    Join Date
    May 2015
    Location
    -7 UTC
    Posts
    17,277
    Blog Entries
    9
    Quote Originally Posted by OSdirk View Post
    I do understand that the basic SRD package can't include everything, but there is a certain minimum threshold that should be met- which I'm just not seeing.
    Well, this really isn't the right thread to discuss this in. And I won't judge or comment on if your expectations are reasonable or not (as it really doesn't matter, everyone is entitled to their own expectations). I will say that in the almost 5 years I've been here no one else I can remember has expressed such expectations. And there are currently over 192k forum members (about 10k of them this week alone). So I will say that your expectations are not common.

    What's important is how to help you either meet your expectations, or modify your expectations.

    Problems? See; How to Report Issues, Bugs & Problems
    On Licensing & Distributing Community Content
    Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets, Balance Disturbed, Dungeon Room Descriptions
    Note, I am not a SmiteWorks employee or representative, I'm just a user like you.

  8. #1978
    wndrngdru's Avatar
    Join Date
    Jun 2015
    Location
    US, Central (UTC -6 or -5)
    Posts
    446
    Okay, I think I could maybe fix this with an extension (and an opportunity to dig further into adding/editing stuff I'd like to see). @damned: Would there be any issues with essentially duplicating the Rolls library and just calling it something different? Is that somewhere in one of your informative videos?

    Whatever happens, it's going to take a while as I lost my source files a couple of weeks ago in a catastrophic hard drive crash.
    --
    I'm so bassic

  9. #1979
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,685
    Blog Entries
    1
    Quote Originally Posted by wndrngdru View Post
    Okay, I think I could maybe fix this with an extension (and an opportunity to dig further into adding/editing stuff I'd like to see). @damned: Would there be any issues with essentially duplicating the Rolls library and just calling it something different? Is that somewhere in one of your informative videos?

    Whatever happens, it's going to take a while as I lost my source files a couple of weeks ago in a catastrophic hard drive crash.
    Thanks for investigating the FGU v FGC thing with Abilities. I admit I did only look at FGu as the OP is only using FGU
    I will fix the Categories and try and resolve the drag and drop.

    Please can you give more info on the Rolls duplication?

  10. #1980
    wndrngdru's Avatar
    Join Date
    Jun 2015
    Location
    US, Central (UTC -6 or -5)
    Posts
    446
    Quote Originally Posted by damned View Post
    Thanks for investigating the FGU v FGC thing with Abilities. I admit I did only look at FGu as the OP is only using FGU
    I will fix the Categories and try and resolve the drag and drop.
    Excellent. Thank you. Although... see below.

    Please can you give more info on the Rolls duplication?
    I was trying to remember why I set up the spells under the Abilities the way I did. The main reason was to separate them from the rest of the rolls, basically having a Spells library like 5e does.
    The Abilities library currently won't hold MC Rolls. I figured if the Abilities library worked the way the Rolls library did, all would be right with the (dungeon) world. That's what I meant by duplicating, just duplicating the function but have it as it's own "bucket o' stuff".

    If you'd rather not do that as part of MC, I'm sure I could pound out an extension that would do it. I was just wondering if you knew of any pitfalls going in.
    --
    I'm so bassic

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 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