STAR TREK 2d20
  1. #1071
    I correct this, but I don't remember how

  2. #1072

    Damage Chat Display Error - Correction

    I think that description correct the error
    scripts\manager_action_damage.lua
    Code:
    -- 
    -- Please see the license.html file included with this distribution for 
    -- attribution and copyright information.
    --
    
    
    DICE_DEFAULT = 6;
    
    function onInit()
        ActionsManager.registerModHandler("damage", modRoll);
        ActionsManager.registerResultHandler("damage", onDamage);
    end
    
    function onDamage(rSource, rTarget, rRoll)
      local rMessage = ActionsManager.createActionMessage(rSource, rRoll);
      local nTotal = 0;
    
      local bAddMod = false;
      if GameSystem.actions[rRoll.sType] then
        bAddMod = GameSystem.actions[rRoll.sType].bAddMod;
      end
    
      -- Send the chat message
      local bShowMsg = true;
      if not rSource then
        bShowMsg = false;
      end
      
      if bShowMsg then
        local _, _, sOperator, nNum, xMult = parseDamage(rRoll.sDamage);    --MOD by Jaxilon
        
        rMessage.text = string.format("%s %s %s%s%s",
            (string.format("%s%s",(rTarget and string.format("Hit %s with ",rTarget.sName) or ""), rMessage.text)),
            (rRoll.sWeapon or ""), 
            ((rRoll.sWeapon and rRoll.sWeapon ~= '' and rRoll.sMode and rRoll.sMode ~= '') and "" or ""), 
            (rRoll.sMode or ""), 
            (string.format(" [%s]%s", (rRoll.sDamage or ""), (rRoll.nMod ~= 0 and string.format("(%s%d)",(rRoll.nMod > 0 and "+" or ""),rRoll.nMod) or "")) or "")
        );    
    
        rMessage.diemodifier = 0;
        
        -- Calculate Damage 
        for _,v in ipairs(rRoll.aDice) do
          nTotal = nTotal + v.result;
        end
    
        local nMod = (bAddMod and rRoll.nMod or 0);    
        if sOperator then 
          if (sOperator == "+") then
            nTotal = nTotal + (nNum or 0);        
            rMessage.diemodifier = (nNum or 0) + nMod;                
          elseif (sOperator == "-") then
            nTotal = nTotal - (nNum or 0);        
            rMessage.diemodifier = -(nNum or 0) + nMod;        
          elseif (sOperator == "x") then
            nTotal = nTotal * (nNum or 1);        
            rMessage.diemodifier = 0;        
          elseif (sOperator == "/") then
            nTotal = nTotal / (nNum or 1);        
            rMessage.diemodifier = 0;        
          end
        end
        if (sOperator ~= "x" and xMult) then    --MOD by Jaxilon
            nTotal = nTotal * xMult;            --MOD by Jaxilon
        end                                        --MOD by Jaxilon
        nTotal = nTotal + nMod;        
        Comm.deliverChatMessage(rMessage);
        
        -- Deliver Total Damage
        rMessage.type = "number";
        rMessage.icon = "action_damage";
        rMessage.text = string.format("Total [%s]%s", (rRoll.sDamage or ""), (rRoll.nMod ~= 0 and string.format("(%s%d)",(rRoll.nMod > 0 and "+" or ""),rRoll.nMod) or ""));
        rMessage.dice = {};
        rMessage.diemodifier = (nTotal > 0 and nTotal or 0);
     -- rMessage.dicedisplay = 0;
        Comm.deliverChatMessage(rMessage);
      end
    end
    
    function applyDamage(rSource, rTarget, bSecret, sDamage, nTotal)
      -- Get health fields
      local sTargetType, nodeTarget = ActorManager.getTypeAndNode(rTarget);
      if sTargetType ~= "pc" and sTargetType ~= "ct" then
        return;
      end
    
      local nHP, nInjury;
      if sTargetType == "pc" then
        nHP = DB.getValue(nodeTarget, "attributes.hitpoints", 0);
        nInjury = DB.getValue(nodeTarget, "attributes.injury", 0) + nTotal;
        DB.setValue(nodeTarget, "attributes.hps", "number", nHP - (nInjury < 0 and 0 or nInjury));
        DB.setValue(nodeTarget, "attributes.injury", "number", (nInjury < 0 and 0 or nInjury));
        DB.setValue(nodeTarget, "attributes.hpstatus", "string", ActorManager2.getHPStatus(sTargetType, nodeTarget));
      else
        nHP = DB.getValue(nodeTarget, "attributes.hitpoints", 0);
        nInjury = DB.getValue(nodeTarget, "injury", 0) + nTotal;
        DB.setValue(nodeTarget, "hps", "number", nHP - (nInjury < 0 and 0 or nInjury));
        DB.setValue(nodeTarget, "injury", "number", (nInjury < 0 and 0 or nInjury));
        DB.setValue(nodeTarget, "hpstatus", "string", ActorManager2.getHPStatus(sTargetType, nodeTarget));
      end
    end
    
    function updateDamage(rActor)
      -- Get health fields
      local sActorType, nodeActor = ActorManager.getTypeAndNode(rActor);
      if sActorType ~= "pc" and sActorType ~= "ct" then
        return;
      end
    
      local nHP, nInjury;
      if sActorType == "pc" then
        nHP = DB.getValue(nodeActor, "attributes.hitpoints", 0);
        nInjury = DB.getValue(nodeActor, "attributes.injury", 0);
        DB.setValue(nodeActor, "attributes.hps", "number", nHP - (nInjury < 0 and 0 or nInjury));
        DB.setValue(nodeActor, "attributes.hpstatus", "string", ActorManager2.getHPStatus(sActorType, nodeActor));
      else
        nHP = DB.getValue(nodeActor, "attributes.hitpoints", 0);
        nInjury = DB.getValue(nodeActor, "injury", 0);
        DB.setValue(nodeActor, "hps", "number", nHP - (nInjury < 0 and 0 or nInjury));
        DB.setValue(nodeActor, "hpstatus", "string", ActorManager2.getHPStatus(sActorType, nodeActor));
      end
    end
    
    function parseDamage(s)
      -- SETUP
      local aDice = {};
      local nMod = 0;
      
      local nDieCount = 0;
      local nDice = 0;
      local sOperator = "";
      local nNum = 0
      local xMult = 0;
      -- PARSING
      if s then
        xMultiply = s:match("x(%d+)");        --MOD by Jaxilon
        nDieCount, nDice, sOperator, nNum = s:match("^(%d*)[dD]([%dF]*)%s*([+-x]?)%s*([%dF]*)");
        if nDieCount then
          local sDie = string.format("d%d", (tonumber(nDice) or DICE_DEFAULT));
          for i = 1, nDieCount do
            table.insert(aDice, sDie);
          end
        end
        
        if sOperator and nNum then
          nNum = (tonumber(nNum) or 0);
        end
      end
    
      -- RESULTS
      return aDice, nMod, sOperator, nNum, xMultiply;    --MOD by Jaxilon
    end
    Last edited by YAKO SOMEDAKY; December 10th, 2020 at 19:31.

  3. #1073
    Quote Originally Posted by Gigermann View Post
    Screwed up image. I thought we fixed that already. Do you have the latest version of everything?
    That was it. I was mistaken on having thought my ruleset was up-to-date.
    DM/GM Since 1985. Unity and Classic Ultimate License.

  4. #1074
    Has anyone manged to get GCS exported characters and NPCs into Fantasy Ground to work?

    I get an import error "An error occurred while parsing EntityName. Line 929 position 76".

  5. #1075
    If you have an advantage/disadvantage skill etc with & in it, that's likely giving you the error (ie. Acute Taste & Smell) often do it; you can either go into the xml with notepad(++) or something like that and change it there OR just change it in the GCS character and re-export it
    Anybody want a peanut!

  6. #1076
    Quote Originally Posted by Fezzik Buttercup View Post
    If you have an advantage/disadvantage skill etc with & in it, that's likely giving you the error (ie. Acute Taste & Smell) often do it; you can either go into the xml with notepad(++) or something like that and change it there OR just change it in the GCS character and re-export it
    Yup. That was the issue. Thanks!

    There are still some minor issues like reaction modifiers not transfering, advantages containers getting point values, and characters with weights set to kg getting their equipment in pounds in Fantasy Grounds so everything ends up a bit over twice as heavy, but it is all stuff we can work around.

    ------

    Question unrelated to GCS. In Fantasy Grounds, where do the coins end up when distributing them from the party menu? As a GM I can't see the money and don't seem to be able to modify it either? Is it supposed to be in the character sheets somewhere? Is there a tab missing in the GURPS module for characters or something like that?

  7. #1077
    Quote Originally Posted by RedMattis View Post
    where do the coins end up when distributing them from the party menu?
    Inventory. At the bottom.
    It's hard to be religious when certain people are never incinerated by bolts of lightning.

  8. #1078
    Quote Originally Posted by Gigermann View Post
    Inventory. At the bottom.
    where.JPG

    I can't see it? Do I need to enable it somewhere?

  9. #1079
    Quote Originally Posted by RedMattis View Post
    where.JPG

    I can't see it? Do I need to enable it somewhere?
    New version of the sheet? That's not the one "we" currently use. I recall there were some revamps occurring, so I guess that was moved/removed
    It's hard to be religious when certain people are never incinerated by bolts of lightning.

  10. #1080

    Join Date
    May 2013
    Location
    East Coast USA.
    Posts
    945
    Quote Originally Posted by Gigermann View Post
    Nothing but fixing the font issues, and adding the assets button (which I need to make actually say "assets" :P )
    Just curious as to whether this is an issue with my monitor. How difficult is it for everyone else to read the HP and FP fields in the combat tracker, with the FGU Dark Theme?

Thread Information

Users Browsing this Thread

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