DICE PACKS BUNDLE
Page 311 of 331 First ... 211 261 301 309 310 311 312 313 321 ... Last
  1. #3101
    Quote Originally Posted by damned View Post
    Do a merge of the window class but include the whole script section from the original and update with your code.

    What are you making?
    Code:
    <windowclass name="cas_stats" mergerule="merge">
    	<script>
    		previous code here
    	</scripts
    	<sheetdata>
    		<string_column name="clichatcommand">
    			<script>
    				function onLoseFocus( )
    				end
    			</script>
    		</string_column>
    	</sheetdata>
    </windowclass>
    So something like that?

    I was looking at the way that the srun4 roll was done and noticed it did things differently for exploding than I had done for the Shadowrun 5e extension. I've been trying to get back to working on it, but time is limited.
    I wanted to make an extension that just has the roll code for Shadowrun 5e, and saw another post that said what was needed to be added for a new roll. I figured I'd do it as an extension to remind myself how the heck this is all done.

    Btw the srun4 is not rolling the way shadowrun 4e rolls.
    sr4 doesn't compound the die rolls when it explodes, and it also doesn't explode on every roll.
    I think sr1 and 2 did it that way, not sure about 3.
    sr4 doesn't have limits, sr5 does.
    sr4 only explodes when you spend edge. The exploding adds dice to the total dice instead of like previous editions that added the exploded rolls to the die it was exploding.
    Last edited by rmilmine; June 8th, 2022 at 06:42.

  2. #3102

  3. #3103
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    24,754
    Blog Entries
    1
    Quote Originally Posted by rmilmine View Post
    Code:
    <windowclass name="cas_stats" mergerule="merge">
    	<script>
    		previous code here
    	</scripts
    	<sheetdata>
    		<string_column name="clichatcommand">
    			<script>
    				function onLoseFocus( )
    				end
    			</script>
    		</string_column>
    	</sheetdata>
    </windowclass>
    So something like that?

    I was looking at the way that the srun4 roll was done and noticed it did things differently for exploding than I had done for the Shadowrun 5e extension. I've been trying to get back to working on it, but time is limited.
    I wanted to make an extension that just has the roll code for Shadowrun 5e, and saw another post that said what was needed to be added for a new roll. I figured I'd do it as an extension to remind myself how the heck this is all done.

    Btw the srun4 is not rolling the way shadowrun 4e rolls.
    sr4 doesn't compound the die rolls when it explodes, and it also doesn't explode on every roll.
    I think sr1 and 2 did it that way, not sure about 3.
    sr4 doesn't have limits, sr5 does.
    sr4 only explodes when you spend edge. The exploding adds dice to the total dice instead of like previous editions that added the exploded rolls to the die it was exploding.
    Include all the existing stuff and then add your own...


    Code:
    	<windowclass name="cas_stats" merge="join">
    		<script>
    			function onInit()
    				update();
    			end
    			function update()
    				local bReadOnly = WindowManager.getReadOnlyState(getDatabaseNode());
    				description.setReadOnly(bReadOnly);
    				clichatcommand.setReadOnly(bReadOnly);
    				tracker_enabled.setReadOnly(bReadOnly);
    				tracker_reverse.setReadOnly(bReadOnly);
    				number_trackers.setReadOnly(bReadOnly);
    				number_min.setReadOnly(bReadOnly);
    				trackers_icon.setReadOnly(bReadOnly);
    				parameter_formula.setReadOnly(bReadOnly);
    				p1_hidden.setReadOnly(bReadOnly);
    				p1_tooltip.setReadOnly(bReadOnly);
    				p2_hidden.setReadOnly(bReadOnly);
    				p2_tooltip.setReadOnly(bReadOnly);
    				p3_hidden.setReadOnly(bReadOnly);
    				p3_tooltip.setReadOnly(bReadOnly);
    				refa.setReadOnly(bReadOnly);
    				refb.setReadOnly(bReadOnly);
    				refc.setReadOnly(bReadOnly);
    			end
    			function onLoseFocus()
    			end
    
    		</script>
    	</windowclass>

  4. #3104

  5. #3105
    The function onLoseFocus is a function in a string_column control in the sheetdata section of the windowclass. It's not part of the windowclass's script section.

  6. #3106
    Quote Originally Posted by damned View Post
    That doesnt work.
    Its something in the rMessage.expr

    but you could just turn it off?
    Code:
    	rMessage.diceskipexpr = true;
    That does work, it removes the heading all together, but at least it looks better than it did.

  7. #3107
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    24,754
    Blog Entries
    1
    try below - adding your code in.
    are you just adding another icon to the cycler or something else?

    Code:
    	<windowclass name="cas_stats" merge="join">
    
    		<sheetdata>
    
    			<string_column name="clichatcommand">
    					<script>
    					function onLoseFocus( )
    
    						local nameWindowDBNode = window.getDatabaseNode();
    						local nodeWin = nameWindowDBNode;
    						local sName = nodeWin.getChild("name").getValue();
    						local sCommand = nodeWin.getChild("clichatcommand").getValue();
    						local sRollstype = nodeWin.getChild("rollstype").getValue();
    
    
    						local nStart,nEnd,sCommand,sParams = string.find(sCommand, '^/([^%s]+)%s*(.*)');
    						if sCommand == "rollon" then
    							nodeWin.getChild("rollstype").setValue("table");
    						elseif sCommand == "mod" then
    							nodeWin.getChild("rollstype").setValue("modifier");
    
    etc
    						elseif sCommand == "spellpoints" then
    							nodeWin.getChild("rollstype").setValue("spellpoints");
    						elseif sCommand == "c1mod" then
    							nodeWin.getChild("rollstype").setValue("c1mod");
    						elseif sCommand == "c2mod" then
    							nodeWin.getChild("rollstype").setValue("c2mod");
    						elseif sCommand == "c3mod" then
    							nodeWin.getChild("rollstype").setValue("c3mod");
    						elseif sCommand == "c4mod" then
    							nodeWin.getChild("rollstype").setValue("c4mod");
    						elseif sCommand == "c5mod" then
    							nodeWin.getChild("rollstype").setValue("c5mod");
    						elseif sCommand == "tmod" then
    							nodeWin.getChild("rollstype").setValue("table");
    						elseif sCommand == "dbdamage" then
    							nodeWin.getChild("rollstype").setValue("dbdamage");
    						elseif sCommand == "damageme" then
    							nodeWin.getChild("rollstype").setValue("damageme");
    						elseif sCommand == "healme" then
    							nodeWin.getChild("rollstype").setValue("healme");
    						elseif sCommand == "damageroll" then
    							nodeWin.getChild("rollstype").setValue("dbdamage");
    						elseif sCommand == "damagedr" then
    							nodeWin.getChild("rollstype").setValue("damagedr");
    						elseif sCommand == "damagel5r" then
    							nodeWin.getChild("rollstype").setValue("legenddmg");
    						elseif sCommand == "damagedr4" then
    							nodeWin.getChild("rollstype").setValue("damagedr");
    						elseif sCommand == "unidamage" then
    							nodeWin.getChild("rollstype").setValue("unidamage");
    						elseif sCommand == "gsdamage" then
    							nodeWin.getChild("rollstype").setValue("gsdamage");
    						elseif sCommand == "attackac" then
    							nodeWin.getChild("rollstype").setValue("attack");
    						elseif sCommand == "drwho" then
    							nodeWin.getChild("rollstype").setValue("drwho");
    						elseif sCommand == "mythras" then
    							nodeWin.getChild("rollstype").setValue("mythras");
    						elseif sCommand == "chatimage" then
    							nodeWin.getChild("rollstype").setValue("chatimage");
    						elseif sCommand == "silcore" then
    							nodeWin.getChild("rollstype").setValue("silcore");
    						elseif sCommand == "battled6" then
    							nodeWin.getChild("rollstype").setValue("battled6");
    						elseif sCommand == "dragon" then
    							nodeWin.getChild("rollstype").setValue("dragon");
    						elseif sCommand == "afmbedmg" then
    							nodeWin.getChild("rollstype").setValue("dbdamage");
    						elseif sCommand == "vermine" then
    							nodeWin.getChild("rollstype").setValue("vermine");
    						elseif sCommand == "vaesen" then
    							nodeWin.getChild("rollstype").setValue("vaesen");
    						elseif sCommand == "mother1" then
    							nodeWin.getChild("rollstype").setValue("mother1");
    						elseif sCommand == "mother2" then
    							nodeWin.getChild("rollstype").setValue("mother2");
    						elseif sCommand == "vda" then
    							nodeWin.getChild("rollstype").setValue("vda");
    						elseif sCommand == "rpexa" then
    							nodeWin.getChild("rollstype").setValue("rpexa");
    						elseif sCommand == "rk" then
    							nodeWin.getChild("rollstype").setValue("rk");
    						elseif sCommand == "topsecret" then
    							nodeWin.getChild("rollstype").setValue("topsecret");
    						elseif sCommand == "rngroll" then
    							nodeWin.getChild("rollstype").setValue("rngroll");
    						elseif sCommand == "tsprimary" then
    							nodeWin.getChild("rollstype").setValue("tsprimary");
    						elseif sCommand == "tstertiary" then
    							nodeWin.getChild("rollstype").setValue("tstertiary");
    						elseif sCommand == "tsmove" then
    							nodeWin.getChild("rollstype").setValue("tsmove");
    						elseif sCommand == "tslife" then
    							nodeWin.getChild("rollstype").setValue("tslife");
    						elseif sCommand == "tsdamage" then
    							nodeWin.getChild("rollstype").setValue("tsdamage");
    						elseif sCommand == "atkatow" then
    							nodeWin.getChild("rollstype").setValue("atkatow");
    						elseif sCommand == "mcds1" then
    							nodeWin.getChild("rollstype").setValue("mcds1");
    						elseif sCommand == "mcds2" then
    							nodeWin.getChild("rollstype").setValue("mcds2");
    						elseif sCommand == "btdamage" then
    							nodeWin.getChild("rollstype").setValue("btdamage");
    						elseif sCommand == "blades" then
    							nodeWin.getChild("rollstype").setValue("blades");
    						elseif sCommand == nil then
    							nodeWin.getChild("rollstype").setValue("chat");
    						else nodeWin.getChild("rollstype").setValue("rolls");
    
    						end
    						end
    
    			</script>
    			</string_column>
    		</sheetdata>
    	</windowclass>

  8. #3108
    Quote Originally Posted by damned View Post
    try below - adding your code in.
    are you just adding another icon to the cycler or something else?

    Code:
    	<windowclass name="cas_stats" merge="join">
    
    		<sheetdata>
    
    			<string_column name="clichatcommand">
    					<script>
    					function onLoseFocus( )
    
    						local nameWindowDBNode = window.getDatabaseNode();
    						local nodeWin = nameWindowDBNode;
    						local sName = nodeWin.getChild("name").getValue();
    						local sCommand = nodeWin.getChild("clichatcommand").getValue();
    						local sRollstype = nodeWin.getChild("rollstype").getValue();
    
    
    						local nStart,nEnd,sCommand,sParams = string.find(sCommand, '^/([^%s]+)%s*(.*)');
    						if sCommand == "rollon" then
    							nodeWin.getChild("rollstype").setValue("table");
    						elseif sCommand == "mod" then
    							nodeWin.getChild("rollstype").setValue("modifier");
    
    etc
    						elseif sCommand == "spellpoints" then
    							nodeWin.getChild("rollstype").setValue("spellpoints");
    						elseif sCommand == "c1mod" then
    							nodeWin.getChild("rollstype").setValue("c1mod");
    						elseif sCommand == "c2mod" then
    							nodeWin.getChild("rollstype").setValue("c2mod");
    						elseif sCommand == "c3mod" then
    							nodeWin.getChild("rollstype").setValue("c3mod");
    						elseif sCommand == "c4mod" then
    							nodeWin.getChild("rollstype").setValue("c4mod");
    						elseif sCommand == "c5mod" then
    							nodeWin.getChild("rollstype").setValue("c5mod");
    						elseif sCommand == "tmod" then
    							nodeWin.getChild("rollstype").setValue("table");
    						elseif sCommand == "dbdamage" then
    							nodeWin.getChild("rollstype").setValue("dbdamage");
    						elseif sCommand == "damageme" then
    							nodeWin.getChild("rollstype").setValue("damageme");
    						elseif sCommand == "healme" then
    							nodeWin.getChild("rollstype").setValue("healme");
    						elseif sCommand == "damageroll" then
    							nodeWin.getChild("rollstype").setValue("dbdamage");
    						elseif sCommand == "damagedr" then
    							nodeWin.getChild("rollstype").setValue("damagedr");
    						elseif sCommand == "damagel5r" then
    							nodeWin.getChild("rollstype").setValue("legenddmg");
    						elseif sCommand == "damagedr4" then
    							nodeWin.getChild("rollstype").setValue("damagedr");
    						elseif sCommand == "unidamage" then
    							nodeWin.getChild("rollstype").setValue("unidamage");
    						elseif sCommand == "gsdamage" then
    							nodeWin.getChild("rollstype").setValue("gsdamage");
    						elseif sCommand == "attackac" then
    							nodeWin.getChild("rollstype").setValue("attack");
    						elseif sCommand == "drwho" then
    							nodeWin.getChild("rollstype").setValue("drwho");
    						elseif sCommand == "mythras" then
    							nodeWin.getChild("rollstype").setValue("mythras");
    						elseif sCommand == "chatimage" then
    							nodeWin.getChild("rollstype").setValue("chatimage");
    						elseif sCommand == "silcore" then
    							nodeWin.getChild("rollstype").setValue("silcore");
    						elseif sCommand == "battled6" then
    							nodeWin.getChild("rollstype").setValue("battled6");
    						elseif sCommand == "dragon" then
    							nodeWin.getChild("rollstype").setValue("dragon");
    						elseif sCommand == "afmbedmg" then
    							nodeWin.getChild("rollstype").setValue("dbdamage");
    						elseif sCommand == "vermine" then
    							nodeWin.getChild("rollstype").setValue("vermine");
    						elseif sCommand == "vaesen" then
    							nodeWin.getChild("rollstype").setValue("vaesen");
    						elseif sCommand == "mother1" then
    							nodeWin.getChild("rollstype").setValue("mother1");
    						elseif sCommand == "mother2" then
    							nodeWin.getChild("rollstype").setValue("mother2");
    						elseif sCommand == "vda" then
    							nodeWin.getChild("rollstype").setValue("vda");
    						elseif sCommand == "rpexa" then
    							nodeWin.getChild("rollstype").setValue("rpexa");
    						elseif sCommand == "rk" then
    							nodeWin.getChild("rollstype").setValue("rk");
    						elseif sCommand == "topsecret" then
    							nodeWin.getChild("rollstype").setValue("topsecret");
    						elseif sCommand == "rngroll" then
    							nodeWin.getChild("rollstype").setValue("rngroll");
    						elseif sCommand == "tsprimary" then
    							nodeWin.getChild("rollstype").setValue("tsprimary");
    						elseif sCommand == "tstertiary" then
    							nodeWin.getChild("rollstype").setValue("tstertiary");
    						elseif sCommand == "tsmove" then
    							nodeWin.getChild("rollstype").setValue("tsmove");
    						elseif sCommand == "tslife" then
    							nodeWin.getChild("rollstype").setValue("tslife");
    						elseif sCommand == "tsdamage" then
    							nodeWin.getChild("rollstype").setValue("tsdamage");
    						elseif sCommand == "atkatow" then
    							nodeWin.getChild("rollstype").setValue("atkatow");
    						elseif sCommand == "mcds1" then
    							nodeWin.getChild("rollstype").setValue("mcds1");
    						elseif sCommand == "mcds2" then
    							nodeWin.getChild("rollstype").setValue("mcds2");
    						elseif sCommand == "btdamage" then
    							nodeWin.getChild("rollstype").setValue("btdamage");
    						elseif sCommand == "blades" then
    							nodeWin.getChild("rollstype").setValue("blades");
    						elseif sCommand == nil then
    							nodeWin.getChild("rollstype").setValue("chat");
    						else nodeWin.getChild("rollstype").setValue("rolls");
    
    						end
    						end
    
    			</script>
    			</string_column>
    		</sheetdata>
    	</windowclass>
    What I was missing was the merge="join"
    I was using the wrong syntax.
    Thanks for the help. Going to make sure it's all working now, but I think it is.

  9. #3109

  10. #3110
    Shadowrun 5e.ext
    I've attached what I have done.
    Includes the graphics, etc. At least I think I included what was needed.
    If I missed anything please let me know.
    Last edited by rmilmine; June 8th, 2022 at 09:22.

Page 311 of 331 First ... 211 261 301 309 310 311 312 313 321 ... Last

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
  •  
Refer a Friend

Log in

Log in