Thread: New! Story Templates Enhanced
-
August 13th, 2024, 18:07 #11
I’m game - let me know what to expect and when.
Update: looks like the ball is in my court - I discussed this with Laerun and I'm to prep a Story Template scenario to demonstrate. I've been busy releasing the Table Edit extension as well as adding features to this extension. Perhaps the demonstration will make use of both extensions in a 2-fer.Last edited by tjlee; August 30th, 2024 at 07:29.
-
August 30th, 2024, 06:58 #12
New Release 2024.08.29
This release adds the following:
- Added logic to remove empty text blocks in Advanced Stories generated from Advanced Story Templates.
- Formalized support for use of Link IDs in place of Table names and Story Template names (see Story Template Enhanced - examples).
- Added a click action to the Toolbar Drag Record Link button (top left corner) to report the Link ID associated with the window to chat.
Additionally, the Story Template Enhanced - examples have been updated to clarify existing examples and add examples to illustrate the above.Last edited by tjlee; August 30th, 2024 at 14:01.
TJ Lee
Story Template Enhanced (extension): https://forge.fantasygrounds.com/shop/items/1870/view
Story Template Enhanced (examples module): https://forge.fantasygrounds.com/shop/items/1871/view
Table Edit Extension: https://forge.fantasygrounds.com/shop/items/1881/view
-
September 21st, 2024, 05:38 #13
I went ahead and re-tested the extension with the 2024 D&D Ruleset update to make sure everything works as expected.
If you do experience any issues, please reply to this thread with a description of the issue and I'll try to reproduce and address it in a timely manner.TJ Lee
Story Template Enhanced (extension): https://forge.fantasygrounds.com/shop/items/1870/view
Story Template Enhanced (examples module): https://forge.fantasygrounds.com/shop/items/1871/view
Table Edit Extension: https://forge.fantasygrounds.com/shop/items/1881/view
-
October 1st, 2024, 07:46 #14
New Release 2024.09.30
This release adds functions!
Story Template Enhanced extension now supports function invocations with a syntax of functionName(stringExpression). The six functions supported are:
- capitalize - the first letter of the string expression is made uppercase.
- date - the system date according to the [DATE:format] callout is evaluated. Ex. date(format)
- fgdate - the game date (based upon selected calendar) according to the [FGDate:format] callout is evaluated.
- lower - the string expression is made all lower case. Ex. LOWER(Hi) is substituted by hi.
- titlecase - the string expression is made title case. Ex. titlecase(hello there) is substituted by Hello There
- upper - the string expression is made all lower case. Ex. upper(hi) is substituted by Hi.
These functions can be nested and can be co-mingled with the other template syntax elements where it makes sense. The results of the function are substituted in place of the function callout.
Example:
- capitalize([NPC Name]) - capitalizes the result of calling the table named NPC Name (first letter is capitalized).
Note: if the results of the table callout is not a string expression (such as formatted text), the function may produce unexpected results.
2024.10.01 Update: Story Template Enhanced (examples module) has been updated to include examples for functions (Story Template 2.2).Last edited by tjlee; October 1st, 2024 at 16:38.
TJ Lee
Story Template Enhanced (extension): https://forge.fantasygrounds.com/shop/items/1870/view
Story Template Enhanced (examples module): https://forge.fantasygrounds.com/shop/items/1871/view
Table Edit Extension: https://forge.fantasygrounds.com/shop/items/1881/view
-
Today, 10:24 #15
Story Templates using Function Syntax
I'm excited to tease a more fully fleshed out function-based syntax for story templates that might be easier for folks to learn.
In total, there are 41 functions across 6 categories that include the 6 formatting functions already released (and soon to be enhanced with the next release).
The categories of Story Template Enhanced function syntax include:
- Control Functions (delim, get, set, setg, xget, xset, xsetg)
- String Functions (capitalize, cat, date, dcat, dice, fgdate, lower, pre, post, reverse, rsort, sort, titlecase, uniq, upper)
- Number Functions (avg, count, max, min, total)
- Formatting Functions (bold, bullets, italic, lines, underline, znum)
- Access Functions (head, pick, select, tail)
- Table and Template Functions (import, mult_import, mult_table, table)
Teaser: With the above, you can implement a counter to include in your template.
set(a,1) - iniitailze alias 'a' to 1
setg(a,total(get(a),1))
The above computes a + 1 (total of get(a) and 1) and assigns it back to 'a' (setg), then returns the new value 2 (setg). setg is short for "set get". The xset/xget/xsetg are the cross-template versions for values you want to persist across template evaluations.
set/xset happen quietly and are similar to the original template syntax: [:?1:a] (except that this doesn't work). ? means quiet (no value is returned)
setg is equivalent to [:1:a] (except that it doesn't work either - the value '1' has to come from a table in order for it to work).
get is equivalent to <a>.
Teaser: You can also format dates beyond what CoreRPG supports.
dcat(/,znum(2,date(mm),date(dd)),date(yyyy))
The above is broken down as:
- Concatenate (dcat) the values and delimit the results with /
- Zero left pad (znum) date(mm) and date(dd) to two places
- Include date(yyyy)
The result looks something like: 09/01/2024, depending on the system date of course. The CoreRPG [Date:mm/dd/yyyy] produces 9/1/2024 (without the leading zeros).
From the list of functions above, you can speculate how you might make use of them in your creative endeavors. These and the original plus enhanced story template syntax may be co-mingled in your story templates. Yes, they inter-operate. For example, you can store values in aliases using the original syntax and retrieve the values using the function syntax and vice versa!
If you have ideas for additional functions, feel free to message me or reply to this thread. The rewritten story template parser allows me to support these and future enhancements relatively easily (even though the code is densely complicated).
Everyone who has purchased this extension through the Forge - thank you! You will automatically get the new version once I release it along with the Story Template Enhanced Examples that will be updated with new documentation and examples to illustrate the above.Last edited by tjlee; Today at 11:55.
TJ Lee
Story Template Enhanced (extension): https://forge.fantasygrounds.com/shop/items/1870/view
Story Template Enhanced (examples module): https://forge.fantasygrounds.com/shop/items/1871/view
Table Edit Extension: https://forge.fantasygrounds.com/shop/items/1881/view
Thread Information
Users Browsing this Thread
There are currently 3 users browsing this thread. (0 members and 3 guests)
Bookmarks