Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Authoring Kit


Thread Tools Display Modes
Senior Member
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,216

Old August 8th, 2018, 01:33 PM

So many games involve die rolls, I thought that I would share this procedure.

  <!-- Procedure DieRoll
        Determine the total of a dice roll.

        Outbound parameter: total
        Inbound parameter: NumOfDice  : for 3d6 would be 3, 1d20+2 would be 1, etc.
        Inbound parameter: SizeOfDice : for 3d6 would be 6, 1d20+2 would be 20, etc.
  <procedure id="DieRoll" scripttype="none"><![CDATA[
    ~declare variables that are used to communicate with our caller
    var NumOfDice as number
    var SizeOfDice as number
    var total as number

	var i as number
	total = 0
    for i = 0 to NumOfDice
	  total += random(SizeOfDice)

Working on -
  • (SWADE) WIP Savage Rifts
  • Savage Rifts (Deluxe): Update link in This post
  • Star Trek Adventures: Update link in This post
TCArknight is online now   #1 Reply With Quote
Senior Member
Join Date: Jun 2007
Posts: 255

Old August 8th, 2018, 02:57 PM
Thank you.
tkarn is offline   #2 Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -8. The time now is 09:53 PM.

Powered by vBulletin® - Copyright ©2000 - 2020, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.