DICE PACKS BUNDLE
Page 2 of 3 First 123 Last
  1. #11
    I sent you a pm where you can download my version of the GURPS ruleset.

  2. #12

    Join Date
    Apr 2010
    Location
    Australia
    Posts
    898
    You should try and co ordinate with spyke so that we do not have divergent rulesets for GURPS. These additions are pretty cool.
    Timezone: Australian EST (GMT +10).
    Systems/Rulesets: GURPS 4th Edition.
    Campaigns (Ultimate License Holder)
    GURPS Traveller - The Empty Peace
    GURPS Shadowrun - Power Plays
    GURPS Banestorm - Dark Clouds Rising

  3. #13
    this was something I built off of Kuralds awesome work.
    added his 3d6 function to the weapon level also showing the weapon level in the output any modifier in the modstack gets applied to that number and the modified target number is shown with the results as such "swings Flail(10-4=6):" then the result.

    Code:
    function onDrag(button, x, y, draginfo)
    	print("Entering function");
           
    	local name = "";
                   name = window.handweapon_name.getValue();
            local method = window.handweapon_mode.getValue();
    	local level = window.handweapon_skilllevel.getValue();
            local des= ModifierStack.getDescription(true);
            local modifier = ModifierStack.getSum();
            local equal ="=";
                if modifier > 0 then
                    des ="+";
                end
            
       
                if des == "+" then
                   nulevel = level + modifier;
                elseif des == "" then
                   nulevel = level + modifier;
                end 
    
            if ModifierStack.isEmpty() then
               modifier="";
               equal = "";
               nulevel="";
       
            end
                   
    	
    	local dielist = {} --declare dielist
    	for i=1,3 do --fill dielist according to the expression
    		dielist[i]="d6";
    	end
            
    	draginfo.setType("dice");
    	draginfo.setDieList(dielist);
    	draginfo.setDescription(method.."s "..name.."("..level..des..modifier..equal..nulevel.."):");
            ModifierStack.reset()
    	return true;
    end
    it is sloppy I know.
    latter maybe I can add a parsing function to the dice land in the chat lua to state weather the roll is a possible success of failure.

  4. #14
    ok i added a parser tothe chat_chat lua ondiceland function it reads the target number to roll and compares it to the result and tells you possible hit if the result is lower than the target. it also detects critical hit or miss on 3 or 18.
    Code:
    local entry = {};
    	          entry.font = "systemfont";
    	          entry.text = draginfo.getDescription();
    	          entry.dice = draginfo.getDieList();
    	
    	          applyModifierStackToRoll(draginfo);
    	
    	          entry.diemodifier = draginfo.getNumberData();
    	
    	-- never hide rolls (for secret rolls use your desktop as it isn't for players anyway)
    	          -- entry.dicesecret = false;
    	
    	-- highest roll
    	local bestresult = 0;
    	for k, d in ipairs(entry.dice) do
    		--if d.result > bestresult then
    			bestresult = bestresult + d.result;
    		--end
    	end	
    	
    	local target =string.match(entry.text,"%b()");
    	 if target == nil then
    		  bestresult="";
         else
    	      target = string.match(target, "%d+");
    		  
    	      bestresult = string.match(bestresult, "%d+");
    		if target == "" then
    		  --do nothing
    		else
    		 if tonumber(bestresult)== "3" then
    		     bestresult="[Critical Hit!]";
    		 elseif tonumber(bestresult)== "18" then
    		     bestresult = "[Critical Miss!]";
    			 
    		 else
    		
    		  if tonumber(bestresult) <= tonumber(target) then
    		     bestresult = "[ Possible Hit! ]";
    			 else
    			 bestresult = "";
    		  end
    		 end
    		end
    	 end  
    	
    	entry.text = entry.text.. bestresult;
    	if User.isHost() then
    		entry.sender = GmIdentityManager.getCurrent();
    	else
    		entry.sender = User.getIdentityLabel();
    	end
    	
    	if User.isHost() then
    		entry.icon = "portrait_gm_token";
    	else
    		entry.icon = "portrait_" .. User.getCurrentIdentity() .. "_miniportrait";
    	end
    	
    	-- Deliver the chat entry
    	deliverMessage(entry);
    	return true;
    the other part was minor altered to make it work.
    made "onDragWeaonsSkill.lua"
    Code:
    function onDrag(button, x, y, draginfo)
    	print("Entering function");
           
    	local name = "";
                   name = window.handweapon_name.getValue();
            local method = window.handweapon_mode.getValue();
    	local level = window.handweapon_skilllevel.getValue();
            local des= ModifierStack.getDescription(true);
            local modifier = ModifierStack.getSum();
            local equal ="=";
                if modifier > 0 then
                    des ="+";
                end
            
       
                if des == "+" then
                   nulevel = level + modifier;
                elseif des == "" then
                   nulevel = level + modifier;
                end 
         nulevel = "("..nulevel..")";
            if ModifierStack.isEmpty() then
               modifier="";
               equal = "";
               nulevel="";
    		   if nulevel == "" then
    		      level = "("..level..")";
    		    end
       
            end
                   
    	
    	local dielist = {} --declare dielist
    	for i=1,3 do --fill dielist according to the expression
    		dielist[i]="d6";
    	end
            
    	draginfo.setType("dice");
    	draginfo.setDieList(dielist);
    	draginfo.setDescription(method.."s "..name.." "..level..des..modifier..equal.." "..nulevel..":");
            ModifierStack.reset()
    	return true;
    end
    added the call for it on the weapon_skills section of the weapons xml.
    again this is sloppy I'm no lua programmer I figure since you have to still manually enter any modifiers into the stack and manually adjust figures etc. this should still come within the SJgames online policy.

    again thanks goes to spyke, Kurald and tarostar.

  5. #15
    you just have to remember that gurps works the other way round. The modifier modify the target number and not the die roll (like most other rpgs and fantasy ground does).

    But thank you for sharing your code. I think I'll put it in my ruleset as well.

  6. #16
    already thought of that,it is set to when you grab the die ondrag the modifier from the stack in called and reset and then applied to the target number instead of the roll.

  7. #17
    found two bugs in the code I submitted.

    first where the code finds looks for the unmodified target pattern.

    local target =string.match(entry.text,"%b()");

    change the "%b()" to "%(%d+%)"

    found this bug when using Kuralds ranged weapon damage, since I use spyke's GCA import/export to insert my characters into FG the ranged weapons in the weapon field sometimes look like such: Large Knife (thrown)
    causing a conflicting instance of the %b() patern.

    next where it looks for critical hits or misses:
    tonumber(bestresult)== "3"
    and
    tonumber(bestresult)== "18"

    change the "3" to tonumber('3')
    change the 18 to tonumber('18')

    these two I have no excuse other than I do not know what I'm doing and getting clueless in my old age.

  8. #18
    Spyke's Avatar
    Join Date
    Jun 2005
    Location
    Yorkshire, UK
    Posts
    886
    Sorry I've been out the loop for a while, guys. Been very busy. I will get round at some point before too long to reviewing the various code contributions and figuring out what I'm comfortable with building into the main ruleset.

    Spyke
    Free GURPS tools for Fantasy Grounds at www.spyke.me.

  9. #19
    finally figured out how to get kuralds script to the skills tab. took a while of hacking about.
    I discovered that the charsheet_templates.xml was over riding the ondrag function.

    so i edited the section for the textlistitemvalue template. by first removing the nodrag tag.
    then below the onlosefocus() function, I added the onDrag function.
    Code:
    function onDrag(button, x, y, draginfo)
         
    	 local checker = "";
    	 
    	 
    	 if not editmode then
    		if hoverontext then
    			draginfo.setType("shortcut");
    			draginfo.setShortcutData(window[linktarget[1]].getValue());
    			draginfo.setIcon(window[linktarget[1]].icon[1].normal[1])
    			return true;
    		else
    		 
    		  checker = getDatabaseNode().getName();
    		  if checker == "skill_level" then
    		        local level = window.getDatabaseNode().getChild("skill_level").getValue();
    		        local name = window.getDatabaseNode().getChild("skill_name").getValue();
    		        local des= ModifierStack.getDescription(true);
    				local modifier = ModifierStack.getSum();
    				
    				                 local equal ="=";
                                      if modifier > 0 then
                                           des ="+";
                                      end
    								  
    								  if des == "+" then
                                         nulevel = level + modifier;
                                      elseif des == "" then
                                         nulevel = level + modifier;
                                      end 
    								  
    								  nulevel = "("..nulevel..")";
                                      if ModifierStack.isEmpty() then
                                              modifier="";
                                              equal = "";
                                              nulevel="";
    		                               if nulevel == "" then
    		                                  level = "("..level..")";
    		                               end
       
                                      end
    								  
    								  
    								  local dielist = {}; 
    	                                 for i=1,3 do  
    		                                      dielist[i]="d6";
    	                                 end
    									 
    									 
    									 draginfo.setType("dice");
    	                                 draginfo.setDieList(dielist);
    	                                 draginfo.setDescription("#"..name.." "..level..des..modifier..equal.." "..nulevel..":");
                                         ModifierStack.reset();
    	 	
    		   end		
    		
    		
             return true;	
    		
    		end
    	 end	
    		
    	
    end
    after that I thought it should give a different message than the weapons tab.
    note the # in the line:
    draginfo.setDescription("#"..name.." "..level..des..modifier..equal.." "..nulevel..":");
    so it can be found by the parser in the chat_chat.lua which ws modified to handle messages starting with #.

    Code:
    local entry = {};
    	          entry.font = "systemfont";
    	          entry.text = draginfo.getDescription();
    	          entry.dice = draginfo.getDieList();
    	
    	          applyModifierStackToRoll(draginfo);
    	
    	          entry.diemodifier = draginfo.getNumberData();
    	
    	-- never hide rolls (for secret rolls use your desktop as it isn't for players anyway)
    	          -- entry.dicesecret = false;
    	
    	-- highest roll
    	local bestresult = 0;
    	for k, d in ipairs(entry.dice) do
    		--if d.result > bestresult then
    			bestresult = bestresult + d.result;
    		--end
    	end	
    	
    	local target =string.match(entry.text,"%(%d+%)");
    	 if target == nil then
    		  bestresult="";
         else
    	        target = string.match(target, "%d+");
    		  
    	        bestresult = string.match(bestresult, "%d+");
    		      if target == "" then
    		        --do nothing
    		      else
    		         if tonumber(bestresult)== tonumber('3') then
    		            bestresult="[Critical Hit!]";
    		         elseif tonumber(bestresult)== tonumber('18') then
    		       bestresult = "[Critical Miss!]";
    			 
    		     else
    		
    		        if tonumber(bestresult) <= tonumber(target) then
    		           bestresult = "[ Possible Hit! ]";
    			    else
    			       bestresult = "";
    		        end
    		     end
    	 end
    	 
    	 if string.match(entry.text, "%#") and bestresult == "[ Possible Hit! ]" then
    	      bestresult = "[Success!]";
    		  entry.text = string.gsub(entry.text, "%#", "");
    	 end
    	 
    	 if string.match(entry.text, "%#") and bestresult == "" then
    	      bestresult = "[Failure!]";
    		  entry.text = string.gsub(entry.text, "%#", "");
    	 end
    	 
    	 if string.match(entry.text, "%#") and bestresult == "[Critical Hit!]" then
    	      bestresult = "[Crtical Success!]";
    		  entry.text = string.gsub(entry.text, "%#", "");
    	 end
    	 
    	 if string.match(entry.text, "%#") and bestresult == "[Critical Miss!]" then
    	      bestresult = "[Crtical Failure!]";
    		  entry.text = string.gsub(entry.text, "%#", "");
    	 end
    	 
    	end  
    	
    	entry.text = entry.text.. bestresult;
    	if User.isHost() then
    		entry.sender = GmIdentityManager.getCurrent();
    	else
    		entry.sender = User.getIdentityLabel();
    	end
    	
    	if User.isHost() then
    		entry.icon = "portrait_gm_token";
    	else
    		entry.icon = "portrait_" .. User.getCurrentIdentity() .. "_miniportrait";
    	end
    	
    	-- Deliver the chat entry
    	deliverMessage(entry);
    	return true;
    		
    	end
    as before the modifier is intercepted to apply it to the skill instead of the roll.

    these are all modifications to Kuralds helper script.

  10. #20

    Damage Modifiers

    I wonder if there is some way and if there is how do I make adjustments to damage rolls for different types of attack (cut, pierce, impale).
    And I wonder if you can build something that reduces the damage before modifiers.
    Example: I have a character with ST 15 and a spear.
    He 1d6 + 3 damage, say he attack an NPC with leather armor (DR 2 *). And the damage roll has rolled 6. The damage will be 9 -2 (DR) = 7 +100% = 14
    In FG he says I got attacked successfully, roll the damage when he shows the amount and type but in doing the calculations.
    I just believe that this would facilitate more life for all, since getting the exact result can already drag for HP (player or NPC) and decrement.
    I also believe that it would be no problem, at least in my view.

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