Please help with this code!!!

I'm not sure how to make this work correctly... and maybe I'm on the wrong track. What I'm trying to do is to get the DmgMod (damage modifer) value to be used as the the lookup value on the DmgModDice table. I don't need the die amount rolled I just need the actual die option to show up.

Any tips would be MUCH appreciated.
Header: Gnome Stats

prompt: Size {} 3 
table: Stats
set:StrBonus={!{$prompt1}*6}
set:HPBonus={!{$prompt1}*6}
set:Str={{$prompt1}D6+{$StrBonus}}
set:Con=-
set:Siz={$prompt1}
set:Int={$prompt1}
set:Pow={{$prompt1}D6}
set:Dex={{$prompt1}D6}
set:Cha=-
set:DmgMod={!{$Str}*2}

<TABLE WIDTH=35% BORDER=1><TR><TD><B>STR:</B> {$Str} </TD><TD><B>CON:</B> {$Con} </TD> &
<TD><B>SIZ:</B> {$Siz}m³ </TD><TD><B>INT:</B> {$Int} </TD><TD><B>POW:</B> {$Pow} </TD> &
<TD><B>DEX:</B> {$Dex} </TD><TD><B>CHA:</B> {$Cha} </TD></TR></TABLE>\n\n &

<b>Hit Locations:</b> 1–20     <b>Body:</b>(AP: –) / (HP: {{$prompt1}D6+{$HPBonus}})\n &
<b>Damage Modifer</b> - {$DmgMod} \n\n &
<b>Damage Modifer</b> - [#DmgModDice] 
#{$DmgMod}
endtable:

Table: DmgModDice
Type: Lookup
roll:{!{$DmgMod}*1}
#roll:{$DmgMod}
1–5:–1D8
6–10:–1D6
11–15:–1D4
16–20:–1D2
21–25:+0
26–30:+1D2
31–35:+1D4
36–40:+1D6
41–45:+1D8
46–50:+1D10
51–60:+1D12
61–70:+2D6
71–80:+2D8
81–90:+2D10
91–100:+2D12
Endtable:

Comments

  • If I understand what you're looking for, you can call the table like this:

    [#{$DmgMod} DmgModDice]

    That will return the item that matches {$DmgMod] in the DmgModDice table.

    ie, [#42 DmgModDice] would return "+1d8"
  • Thanks!!! That seems to have done it!

Leave a Comment