-
February 15th, 2025, 19:58 #1
Story Templates not Generating Unique Values
So I've got a Story template that is trying to make multiple calls to a table, but each time FG returns the same result from the table. The key is that I'm using a callout to an internal reference https://fantasygroundsunity.atlassia...-%5B%3Ca%3E%5D
i.e. the template calls out a table (Primary Star Class). One of the columns of the first table has a letter in column one (star class). Then there are additional tables (Zone Population x) with the various star class values for x. The intent is that the story should call upon the same zone population table multiple times to get unique values off that table. But, it doesn't do that, each value is the same. And this is repeatable with multiple stories being generated and multiple story templates being used.
Example;
Screenshot 2025-02-15 125734.pngLast edited by LordEntrails; February 15th, 2025 at 20:20.
Problems? See; How to Report Issues, Bugs & Problems
On Licensing & Distributing Community Content
Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets, Balance Disturbed, Dungeon Room Descriptions
Note, I am not a SmiteWorks employee or representative, I'm just a user like you.
-
February 16th, 2025, 01:59 #2
I'm able to reproduce using the CoreRPG Story Template engine: CoreRPG_Repro.PNG
Shameless Plug: My Story Template Enhanced (extension) works as expected: StoryTemplateEnhanced.PNG
I know why too - the CoreRPG template evaluation performs a global substitution on all matches of the expression under evaluation, so when it evaluates the first [Zone Population #Primary Star Class|1#] table callout, it replaces all of the same expression with the same value. Not an easy fix without rewriting the parser like I've already done.
A potential work-around is to do something like [2x][Zone Population #Primary Start Class|1#] which tells the story template to roll twice against the table.
However, CoreRPG doesn't honor the [2x] in this case (didn't investigate why) while my extension does with the results appearing concatenated all on one line: NoWorkAround.PNG
With my extension, you can modify the story template or table data so that [2x][...] works as expected and the output is on separate lines - more than one way to to solve the problem.
Here's a potential work-around, but as you can see, CoreRPG still does the unexpected while my extension produces expected results: WorkAround.PNG
I put the [Zone Population #Primary Star Class|1#] in a new table named Formatted Population and use the [2x] multiple roll directive in the template to call it twice. I've embedded the line item HTML tags surrounding the table callout <li>...</li>, hence the bullet points in the resulting output. We see in the CoreRPG evaluation of the template, it honors the [2x] directive but repeats the same value while my extension once again produces expected results.
An unsavory work around that works for CoreRPG would be to replicate the [Zone Population X] tables by giving them unique names like [Zone Population X 2], [Zone Population X 3] and then for each time you want to get different results in the story template, you add a line that calls a different version of the same table like so:
[Zone Population #Primary Star Class|1#]
[Zone Population #Primary Star Class|1# 2]
[Zone Population #Primary Star Class|2# 3]
etc.
Since the template expressions are different, they won't get replaced with the same values (unless they coincidentally roll the same values).Last edited by tjlee; February 16th, 2025 at 22:14.
TJ Lee
My Fantasy Grounds Creations:
Story Templates Enhanced (extension)
Story Templates Enhanced - Examples
Table Edit (extension) (Demo Video)
-
February 16th, 2025, 03:22 #3
Thanks TJ
I appreciate you looking at this and diving in so deep. Since these tables will be for an official conversion I'm trying to use core functions to get as close as I can. I was wondering if the custom name callouts (:a:b) or the internal callout internal rolling [:[a] [b]:c] might provide a work around. But since I don't understand those yet, (lol) I haven't gotten there yet.
Doug, Moon or Carl, any thoughts if this is some behavior you might look to change/update/fix?
Problems? See; How to Report Issues, Bugs & Problems
On Licensing & Distributing Community Content
Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets, Balance Disturbed, Dungeon Room Descriptions
Note, I am not a SmiteWorks employee or representative, I'm just a user like you.
-
February 16th, 2025, 11:15 #4
Much as I would love to use your extension tjlee I am using Story Templates in products for the Store, so I can't use an extension. If your system is less of a mind bender (Lord Entrails seems to think it is) than the current implementation (which is very powerful but requires a lot of though to get your head into) maybe Smiteworks should incorporate your extension into FG and make our lives easier.
Savage Rifts© on Fantasy Grounds Store
Ultimate Edition Fantasy Grounds - ONLY ON Linux
Twitch Channel
-
February 16th, 2025, 14:42 #5
I got this way to work...is this what you are looking for?
For your "ST Test" template:
Code:[Primary Star Class] [:Zone Population #Primary Star Class|1#:Object1] [:Zone Population #Primary Star Class|1#:Object2]
Table LordEntrails.jpg
"Object1" and "Object2" can be any unique name you want.
EDIT:
To add to the above, using the : commands also holds the rolled value to that name for use on the generated story.
For example:
Code:[Primary Star Class] Roll 1 - [:Zone Population #Primary Star Class|1#:Object1] Roll 2 - [:Zone Population #Primary Star Class|1#:Object2] This will also hold the value rolled so that you can use it elsewhere in the Generated Story, as any times as you want. Roll 1 result again = <Object1> Roll 2 result again = <Object2> <Object1> <Object1> <Object2> <Object2>
Table LordEntrails2.jpgLast edited by Marmus; February 16th, 2025 at 16:53.
Marmus / Marmusman
Team Twohy Member
Team Twohy Discord
My Module Conversions on DMsGuild
My Module Conversions on The Forge:
My Youtube Channel - Solo-On-The-Fly
-
February 16th, 2025, 18:15 #6
Yes, that’s the work around LordEntrails is looking for.
The assignment to store into Object1 and Object2 makes the expressions different so they get evaluated separately.TJ Lee
My Fantasy Grounds Creations:
Story Templates Enhanced (extension)
Story Templates Enhanced - Examples
Table Edit (extension) (Demo Video)
-
February 16th, 2025, 19:12 #7
Thank you Marmus! Really appreciate you figuring this out for me. Will post the final once I get it updated
Problems? See; How to Report Issues, Bugs & Problems
On Licensing & Distributing Community Content
Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets, Balance Disturbed, Dungeon Room Descriptions
Note, I am not a SmiteWorks employee or representative, I'm just a user like you.
-
February 16th, 2025, 19:59 #8
Here's what it looks like for those who want to see what I was hoping to get to.
Now to see if I can get FG to multiply two numbers together to populate the Stellar mass value. And after that to see how I want to handle generating the orbital distances from a range of AU's based upon the Star's Stellar Mass.
Screenshot 2025-02-16 125548.png
Problems? See; How to Report Issues, Bugs & Problems
On Licensing & Distributing Community Content
Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets, Balance Disturbed, Dungeon Room Descriptions
Note, I am not a SmiteWorks employee or representative, I'm just a user like you.
-
February 17th, 2025, 01:03 #9
Well, this is as far as I got. I think I will be happy with it unless someone has some more ideas.
Screenshot 2025-02-16 175542.png
The part I don't think can be done with core is to use the results from one of the columns of the first table and use it to populate the call of the second table and return just a specific column from that second table. I can get the column call from the first table to define the name of the second table, but as soon as you try to call a column from the second table which is defined with the previous colum result, FG doesn't return anything. See the couple of example/tries below.
Screenshot 2025-02-16 180009.png
If anyone has an idea on that, much appreciated, othersie I will just do some manual reformatting once the results from the first image are done.
Problems? See; How to Report Issues, Bugs & Problems
On Licensing & Distributing Community Content
Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets, Balance Disturbed, Dungeon Room Descriptions
Note, I am not a SmiteWorks employee or representative, I'm just a user like you.
-
February 17th, 2025, 10:24 #10Savage Rifts© on Fantasy Grounds Store
Ultimate Edition Fantasy Grounds - ONLY ON Linux
Twitch Channel
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks