5E Character Create Playlist
  1. #1

    Math in Multi-Column tables in Story Templates

    Hello all,

    I am attempting to automate some math using Story Templates. I'm using the 5e ruleset but attempting to replicate some tables from the 3e Races of Faerūn. I want to take a base number in one column and do math to it using another column. Examples from the RoF: Col1+Col2 = Height (HeightResultCol2xCol4)+Col3=Weight

    Table Name: ShieldDwarfMalePhysical

    Col1 BaseHt: 50
    Col2 Mod: [2d4]
    Col3 BaseWt: 145
    Col4 Mod: [2d6]

    I am testing
    [ShieldDwarfMalePhysical]
    Calc Height: [#ShieldDwarfMalePhysical|1#+#ShieldDwarfMalePhysic al|2#]
    Calc Weight: [#ShieldDwarfMalePhysical|3#+#ShieldDwarfMalePhysic al|2#*#ShieldDwarfMalePhysical|4#]
    Sanity Test: [2+2]=4

    Output is
    50 5 145 5
    Calc Height: 50+5
    Calc Weight: 145+5*5
    Sanity Test: 4=4

    That doesn't perform the calculations, but it's close! Is there a way to do that with the column layout I have or is there a better approach?

    I can as a workaround just add another column that does the math like [50+2d4] and call that using #|x# in the Story Template as an extra step.

  2. #2
    Zacchaeus's Avatar
    Join Date
    Dec 2014
    Location
    Scotland
    Posts
    20,840
    Someone asked a fairly similar question the other day and I referred them here https://www.fantasygrounds.com/forum...r-Unity)/page8 since I've not been able to get my head around most of the stuff in the updated story templates. The guy that did the code answered the query with a possible solution but I don't know if it worked or not.
    If there is something that you would like to see in Fantasy Grounds that isn't currently part of the software or if there is something you think would improve a ruleset then add your idea here https://www.fantasygrounds.com/featu...rerequests.php

  3. #3
    Hi Zacchaeus, thanks for pointing out that other thread. I echo that the documentation could use an update. I'm still not clear on when one would want to use {} instead of or in addition to []. Here are the results of my test.

    {:ShieldDwarfMalePhysical:Test}
    Calc Height: [{#Test|1#}+{#Test|2#}]
    Calc Weight: [{#Test|3#}+{#Test|2#}*{#Test|4#}]

    Output
    50 5 145 9
    Calc Height: 55
    Calc Weight: 190

    This is exactly what I wanted without having separate columns that perform the calculations! Hopefully this will help others out too.

  4. #4
    Documentation, the bane of all programmers.

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
  •  
DICE PACKS BUNDLE

Log in

Log in