Junior Member
Join Date: Sep 2014
Posts: 14
|
Hi there,
I am a new to building files and I am working on a game system where fighters roll a number of d6 +/- x Is there a way to have a stat show 2d6 and then add the +1 or +3 based on the weapon they select, or are the stat fields only able to show a single number? Thanks, CmB |
#1 |
Junior Member
Join Date: Sep 2014
Posts: 14
|
Thought I would post an update. I found this script in the user guide; however for some reason it is not processing the / 100 line and I am getting 302d6+2 when I enter 302 for the stat. Any ideas???
if (@value >= 100) then var roll as number var adjust as number roll = @value / 100 adjust = @value % 100 @text = @value & "d6" endif if (adjust > 0) then @text = @text & "+" & adjust endif |
#2 |
Junior Member
Join Date: Sep 2014
Posts: 14
|
Update #2
Cleaned up script to this. if (@value >= 100) then var roll as number var adjust as number roll = @value / 100 adjust = @value % 100 @text = roll & "d6" endif if (adjust > 0) then @text = @text & "+" & adjust endif I am now getting decimal places before the "d6" as 201/100 is 2.01. I have trimmed decimals everywhere I can find it and still no luck. Does anyone have a suggestion? I would move this to the game system folder; however the game I am working on does not have a folder yet. Thanks, CmB |
#3 |
Junior Member
Join Date: Sep 2014
Posts: 14
|
After a bit more playing around I ended up here...
if (@value >= 100) then var roll as number var adjust as number var final as number roll = @value / 100 adjust = @value % 100 final = round(roll,0,0) @text = final & "d6" endif if (adjust > 0) then @text = @text & "+" & adjust endif This works like a dream. If anyone needs to show a stat as Xd6 feel free to use this Finalize script on their stat. When you enter your stat you do so as 302 for 3d6+2 |
#4 |
|
|