PDA

View Full Version : Story Template PRO (Extension for Unity)



JimSocks
November 11th, 2020, 02:05
Story Template PRO
This has now been integrated directly into Fantasy Grounds- it is no longer an extension!

This GREATLY boosts the power of story templates within Fantasy Grounds Unity.
It provides the following new powers:

Table Callouts [a]

No longer contain annoying semicolons between column results


Increased table column limit to 30

Super helpful given the rest of these new powers, especially column referencing


Table Column Callouts [a|3]

Unchanged but still fully functional


References <a>

Now work with a multitude of different types of table callouts


Column Referencing #a|3#

Reference single columns of previously rolled table results


Callout Custom Naming [:a:b]

Create custom reference names for table results you generate


Callout Internal Rolling [:[a] [b]:c]

Roll on tables within tables


Callout Internal Referencing [<a>]

Use table references to determine which tables to roll on


Callout Internal Column Referencing [#a|3#]

Use internal column references to determine which table to roll on


Hidden rolls (using “?”)

Hide rolled table results in the generated story


Date Calls with formatting [Date:FORMAT] and [FGDate:FORMAT]

Insert dates into your stories based on either the computer clock or FGU calendar


Cross-Template Referencing!!! (aka "passing parameters in") {:a:b} to call/store, {b}, and {#b|3#} to reference/retrieve

Use rolled results from one template, within other templates!


Indefinite Article Processing: (A) or (a)

Tell your story template to use the appropriate article when generating (A/An or a/an)


Intelligent Auto-Capitalization: (f)irst letter of result within table

Tell your story template to capitalize rolled results, if they begin a new sentence.


Check out the youtube videos below, as seeing the features above helps to grasp how powerful they really are.
Basically I have taken the awesome Fantasy Grounds Unity tool of Story Templates, and blown the roof right off them. The power these new magic tricks give you for story generation is unprecedented, so use it wisely.

Video part 1: https://youtu.be/_OS5TyMzIvw *This is the NEW video tutorial made after integration into FG.
Video part 2: https://youtu.be/N3_Y7odDGZI *I am currently working on a replacement video for in-game demonstrations of usage. This video is still the old one until then.

And here is a smaller video touching on two features and how they can be used within FGU:
Cross-Template References and Column References
https://youtu.be/p122r1bSEkY

Here is a video explaining why the v1.1 extra recurse is so awesome:
https://youtu.be/Uq9iy3OOiR8

JimSocks
November 11th, 2020, 02:05
CHANGELOG:

v1.0: Release! (Nov 10 2020)

v1.1: Added recursive function for cross-template references. This means if you embed a cross-template reference WITHIN a table's results, Story Template PRO will take one last glance to see if one popped up last minute, and resolve it if so. This might seem like something small, but it adds some REALLY cool functionality to the system. With this in place we can now store values that are drilled WAY down into nested tables as well, and recall them within any story template, even the current one! Also, I tidied up the code a bit. (Nov 12 2020)

HERE's a video of why the extra recurse in v1.1 is so cool: https://youtu.be/Uq9iy3OOiR8

v1.1.1: No need to re-download this one, the code is the same solid version from v1.1 with the added recurse, I just spent some time tidying up the comments within the code.

Trenloe
November 11th, 2020, 08:30
Do you have permission from SmiteWorks to have this on DriveThruRPG? You need their permission to have anything specifically for Fantasy Grounds outside of DMs Guild. I know it's the same platform (One Bookshelf) but SmiteWorks have stated in the past that their permission is only for DMs Guild.

JimSocks
November 11th, 2020, 14:03
Oh NOW I understand what a DM from another forum member was trying to say! I thought they were synonymous. in fact, when I tried to put it on DMs Guild I was directed by the website to put it on DTrpg instead, and it made it sound like it needed to be that way because they were the parent company. I only realized something was afoot when I couldn’t locate it on DMs Guild after uploading it!

Bottom line: thanks for clearing this up for me! I have 0% issue with having it only on DMs Guild, as that’s what I was actually trying to do in the first place and got fooled into putting it on DTrpg first. It’s also good to know that they aren’t the same thing, as honestly that was a bit confusing! I’ll update all the links, posts, and uploads once I can get to my desktop computer this morning. Edit: done!

But I also want to know: what do you think of it!?

Dax Doomslayer
November 11th, 2020, 14:09
I'm assuming that the answer is 'no' but does this work with FGC?

JimSocks
November 11th, 2020, 14:44
I'm assuming that the answer is 'no' but does this work with FGC?

Not *yet*

I don’t think it’s too crazy to make it work for both, but off the top of my head there are definitely several lines of code that will not right now, as FGC and FGU need different values for < and > within the Lua so as not to interfere with their xml.

JimSocks
November 11th, 2020, 19:19
Here is another video of it in use, showing cross-template referencing and column referencing in action:

https://youtu.be/p122r1bSEkY

Alanrockid
November 12th, 2020, 01:17
Easy buy... The possibilities are endless!

fabiocm
November 12th, 2020, 01:21
The videos are broken on youtube. The error ID slyNDLZHZ4B8yGiR is shown in the screen.

viresanimi
November 12th, 2020, 03:14
That was very likely due to youtube being down at that time.

JimSocks
November 14th, 2020, 19:55
Updated to v1.1- and added an extra recurse of the cross-template reference function. Why is that a big deal? See the short video below!

https://youtu.be/Uq9iy3OOiR8

JimSocks
November 15th, 2020, 19:18
I'm assuming that the answer is 'no' but does this work with FGC?

In all honesty, it’s probably very easy for me to make this work in FGC as well (I just haven’t opened FGC in awhile!)

I’ll see if I can’t knock that out this week and I’ll let you know.

Dax Doomslayer
November 15th, 2020, 21:23
In all honesty, it’s probably very easy for me to make this work in FGC as well (I just haven’t opened FGC in awhile!)

I’ll see if I can’t knock that out this week and I’ll let you know.

Cool! This looks really cool but I still haven't transitioned over to FGU. I have it but I'm still waiting and it probably will be a bit until I do so.

Alanrockid
November 16th, 2020, 23:17
If only templates could output directly to a shop generated by the the shops extension. How cool would be take all the raw power of this buffed templates to generate and populate a shop with 1 click...

corum Rask
December 18th, 2020, 22:15
Where can I buy the Story Template Pro...the link says on DM Guild but it is not there.

Cory

Zacchaeus
December 18th, 2020, 22:30
Where can I buy the Story Template Pro...the link says on DM Guild but it is not there.

Cory

Extensions that were available via the DMsGuild have been withdraw by the DMsGuid at WotC’s request.

damned
December 19th, 2020, 02:06
It will be back...

JimSocks
December 19th, 2020, 02:42
Where can I buy the Story Template Pro...the link says on DM Guild but it is not there.

Cory

Ah. Yes, about that. It’s no longer for sale, and I am not sure I can (or even should?) talk about why yet.

You’ll see it again, but you won’t have to pay for it :)

So Stay tuned!

corum Rask
December 19th, 2020, 02:56
The Story Template Pro is exactly what I have been looking for...hopefully won't have to wait too long

Zacchaeus
December 19th, 2020, 09:14
Ah. Yes, about that. It’s no longer for sale, and I am not sure I can (or even should?) talk about why yet.

You’ll see it again, but you won’t have to pay for it :)

So Stay tuned!

It isn't a secret https://www.fantasygrounds.com/forums/showthread.php?64106-Just-got-a-mail-from-DMsG-telling-me-they-are-pulling-all-extensions-for-sale-out&p=561106&viewfull=1#post561106

JimSocks
December 23rd, 2020, 07:32
It isn't a secret https://www.fantasygrounds.com/forums/showthread.php?64106-Just-got-a-mail-from-DMsG-telling-me-they-are-pulling-all-extensions-for-sale-out&p=561106&viewfull=1#post561106

Oh, wow. I wasn't aware of that! Thanks for the link, it was 15 pages of very interesting reading!

If I am taking the good news out of it all- it's that I can talk about it :)

I have been adding even sweeter functionality to STP in the lead up to it's implementation into the base game, and I have been writing with it's abilities extensively. It's intensely powerful. I'm writing turn-key procedurally-generated adventures over here with levels of detail ranging from the history of lands 1,000s of years ago down to the excessive dirt under an NPC's fingernails in the backroom of a seedy tavern, and everything in between. I can have a merchant with a rich family history, have a city with a street named after his great grandfather, and a cousin in the next kingdom over using that famous lineage to try and secure an ambassador position. Their last names can all match, and even a defining characteristic of their family line like a strong facial bone structure, or a myriad of other details. These details can be shared between templates and used at will.

Oh, and I've added some grammatical filtering. Now your results can intelligently capitalize if they are the beginning of a sentence, and the story template can automatically fix indefinite articles for you if you wish, so the results flow as smooth as a David Attenborough narration.

It's all very exciting, and I can't wait to make the next video to show what I am doing with it!

Milmoor
February 16th, 2021, 20:09
Is there a roadmap for when this is incorporated in FG? Or is it there, but is it FGU only (I'm still on FGC)?

Moon Wizard
February 16th, 2021, 20:19
There is no roadmap that we share. Our current priority is vision/lighting and community forge. This project is one of many projects on our list to look at for our ongoing plans.

Regards,
JPG

Fracz
March 23rd, 2021, 16:12
When the extension will be added on a new release?
I really want the extension.

JimSocks
March 23rd, 2021, 16:29
When the extension will be added on a new release?
I really want the extension.

Like Moonwizard said above- they have other fish to fry 1st. Trust me, as much passion as I have for story templates and the power this extension gives them- I want them to finish up their vision/lighting initiatives 10x moreso!

I am SO STOKED for what they currently have their hands on. If they stopped that to implement this, I’d be upset.

That said, I poured hundreds upon hundreds of hours playtesting the extension code, tweaking it to make the most sense I could to the end user without issues. In the end, if they wanted to, they could just drop the code in and press play and it would have no effect on existing game mechanics or published modules. Of course they can’t do that due to the responsibility they have to make sure I’ve done a good job (always QC, we are only human!) Additionally along those lines, I commented the code overly excessively to paint as full a picture as I possibly could, and I made a video just for them (in addition to the functionality videos I had already published) exploring the functionality even further and the code behind the scenes to assist with ease of implementation. All that to say, I hope when they DO get the bandwidth to implement it, that I have made the endeavor quick and painless for them.

As always- they can always reach out to me if they have other questions, and when it goes live I will make a comprehensive tutorial for everyone :)

Fracz
March 24th, 2021, 21:31
I have a suggestion, for a feature to add on the tool for the new release. I think its really necesary to force dice rolls (results). Sometimes I want to search for a specific row in a table.

Regards!!

JimSocks
March 25th, 2021, 00:37
I have a suggestion, for a feature to add on the tool for the new release. I think its really necesary to force dice rolls (results). Sometimes I want to search for a specific row in a table.

Regards!!

Hmm. I suppose I don’t understand why you’d need to roll at all, if you were going to force a result? Couldn’t you just type (or copy/paste) what you wanted from the table into the text block of the template, instead of forcing an arbitrary roll?

OrionsArmpit
March 31st, 2021, 05:07
I'm writing turn-key procedurally-generated adventures over here with levels of detail ranging from the history of lands 1,000s of years ago down to the excessive dirt under an NPC's fingernails in the backroom of a seedy tavern, and everything in between. I can have a merchant with a rich family history, have a city with a street named after his great grandfather, and a cousin in the next kingdom over using that famous lineage to try and secure an ambassador position. Their last names can all match, and even a defining characteristic of their family line like a strong facial bone structure, or a myriad of other details. These details can be shared between templates and used at will.

This is *exactly* what I've been bashing my head trying to accomplish in FGU for 3 months to no success. I'm trying to build Ready Ref Sheets or huge random table tomes like necromancer games' classic Mother of All Encounter Tables to generate hex crawl features & encounters randomly and on the fly. It's a current mess of tables & story templates that at the best of times spit out results that are jumbled and need human-parsing.

Where can I learn this wizardry!?

JimSocks
April 2nd, 2021, 00:08
Where can I learn this wizardry!?

It’s coming! Once it makes it into the live code I’ll check to make sure my tutorial videos are still applicable, and then I’ll teach everyone the wizarding ways!

maobul
April 12th, 2021, 13:07
You have no idea how much I'm looking forward to this! :)

JimSocks
April 27th, 2021, 19:05
IT’S LIVE!!!

46144

I am at work right now, but when I get home I’ll be pouring over it to see if my tutorial videos are still applicable. If they are you’ll see them soon!

superteddy57
April 27th, 2021, 20:05
IT’S LIVE!!!

46144

I am at work right now, but when I get home I’ll be pouring over it to see if my tutorial videos are still applicable. If they are you’ll see them soon!

They should be as I used them to integrate the code. I also linked them on the wiki for a more in depth explanation than the examples I provided.

Milmoor
April 27th, 2021, 20:38
IT’S LIVE!!!

46144

I am at work right now, but when I get home I’ll be pouring over it to see if my tutorial videos are still applicable. If they are you’ll see them soon!
Congratulations. Will you still be improving this, or has your brainchild left the nest and will have to manage on its own? As in, SmiteWorks takes over development?

Moon Wizard
April 27th, 2021, 21:04
As long as the changes are well-localized, we're open to additional @JimSocks input.

Regards,
JPG

JimSocks
April 28th, 2021, 01:40
Superteddy57, MoonWizard, et al: You guys are rockstars.

I have tested the implementation and found that cross-template referencing is broken, but I have also dug into the code to try and figure out what changed to break it, and I found it!

Between the code I delivered and what ended up in FG there are only very slight differences I noticed, (besides the removal of my avalanche of comments as expected- sorry for over-commenting guys!) but one of the small changes is what breaks the cross-template goodness.
In the original code, I found and used a global table FG was already using elsewhere in order to store the cross template table results. The one I used was DataCommon, and though I know it's not best practice to do that, after examining what DataCommon was being used for in FG I determined my piggybacking off of it would cause zero issues, so I did it- worked like a charm :)

In the current iteration, DataCommon has been swapped for CommonStore. The name change alone would normally be inconsequential, but CommonStore isn't global like DataCommon is, it's local to Story_Template_Generate.lua, and thus is overwritten clean in between different story templates instead of being accessible by them all.

To test this, I took the current code in FG and swapped all CommonStore references back out for DataCommon, and removed the local definition on line 24 of Story_Template_Generate.lua. It worked flawlessly again!

As I mentioned, I know using globals is typically a no-no, BUUUUUT (hear me out here), DataCommon is already being used that way as far as Story_Template_Generate.lua is concerned anyway, and the way I use it doesn't have a chance at affecting current DataCommon usage within FG, AND the things written there are wiped clean every /reload. I suppose the more feelgood way to get this working again would be to create a new global just for this purpose and not double-task DataCommon, which hopefully is an easy kill to get it back 100% functional again?

JimSocks
April 28th, 2021, 15:16
**First, make sure you read my post above- it's about how the code needs to be repaired**

I have also made a NEW tutorial video, removing all references to the extension (no references of "PRO" and "Stock" anymore- it's ALL stock now!) and just showcasing it as a complete tutorial for Story Template command and usage functionality within FG. The new video also contains all the cool new functions within a single video now instead of having them scattered (which had to happen as I developed new commands/functions after the initial video went live before)

The second tutorial video "Story Templates: Practical Usage examples within Fantasy Grounds" will be a "Where the rubber meets the road" video actually showing these commands/functions in action. I am making that video from scratch right now, but when it's ready it will be a great companion video to this one.

Here is the new video's link:
Story Templates: Commands and usage tutorial for Fantasy Grounds (https://youtu.be/_OS5TyMzIvw)

LordEntrails
April 28th, 2021, 17:26
Congrats on having this incorporated into FG ;)

Note, you might want to update the first post so that folks know they will not longer need to download and install this as an extension.

JimSocks
April 28th, 2021, 18:52
you might want to update the first post

You are SO right! I am on it!

And THANKS! I am still pouring work into the new content generator that will make use of all these cool new tricks, so it makes me super stoked that the whole community can benefit from the same magic.

I believe it was you who suggested the date functionality (but I could be mistaken, that was a long time ago!). If it was you- that was a great idea. Really helps me keep track of my generated stories when I put the date right in the story's title!

Jiminimonka
April 28th, 2021, 19:58
Congrats on having this incorporated into FG ;)

Note, you might want to update the first post so that folks know they will not longer need to download and install this as an extension.

Congratulations and please show us how to access it now in FGU :)

superteddy57
April 28th, 2021, 20:04
Congratulations and please show us how to access it now in FGU :)

There is nothing to access. It would be the expanded markups used in the normal story template window.

JimSocks
April 28th, 2021, 20:48
Congratulations and please show us how to access it now in FGU :)

Make sure you have your FG updated, and BAM! You have access!

Open a story template, have a look at the brand new tutorial video I posted above, give the wiki a read, and give it a whirl!

Please note as detailed in my post above, that cross-template references are currently inoperable until hotfixed.

Moon Wizard
April 28th, 2021, 21:17
They have already been hot fixed this morning.

Regards,
JPG

JimSocks
April 29th, 2021, 04:30
They have already been hot fixed this morning.

Regards,
JPG

Are... are you guys robots? Do you not require sleep? I’m gonna need you to complete this captcha real quick... how many of the following pictures contain amazed customers? 😂

I’ll check it out tonight then! *high fives all around!*

Milmoor
April 29th, 2021, 09:17
Are your templates for Taverns etc. now part of FGU as well? If so, I can't find them. But I admit not having looked at your new video yet.

JimSocks
April 29th, 2021, 12:28
They aren’t.

I have been working on the next iteration of Content Generator for months now, as it uses ALL this new functionality and quite frankly, it’s insane.

It’s not finished. I’ve been wanting to do a Kickstarter for it, so it can be free for everyone at the end of the campaign instead of a for-purchase item. This one just is taking so long to create that to not get some compensation for the effort would be absolutely ridiculous.

In order to do a Kickstarter though, I’d need approval from Smiteworks, and I haven’t reached out to them again yet. ...I should probably do that again TBH. I’d really like for it to be a free download!

Trenloe
April 29th, 2021, 12:33
I have been working on the next iteration of Content Generator for months now, as it uses ALL this new functionality and quite frankly, it’s insane.
The previous version was nuts, so I can only imagine how doubly/triply insane it is now! :o


This one just is taking so long to create that to not get some compensation for the effort would be absolutely ridiculous.
I 100% agree.

JimSocks
April 29th, 2021, 17:53
we're open to additional @JimSocks input.

Oddly enough, now that it's live I have suddenly realized a couple other things that could be added to improve the overall experience, and bonus, they are super easy to implement and non-intrusive (well-localized). I'll keep a running list, and send them your way in the form of a commented script showing the proposed code additions once I have a few in the hopper so I don't send a bunch piecemeal.

By the way, the fix you did for the global DataCommon problem is crafty! Two thumbs up!

superteddy57
April 29th, 2021, 20:15
Oddly enough, now that it's live I have suddenly realized a couple other things that could be added to improve the overall experience, and bonus, they are super easy to implement and non-intrusive (well-localized). I'll keep a running list, and send them your way in the form of a commented script showing the proposed code additions once I have a few in the hopper so I don't send a bunch piecemeal.

By the way, the fix you did for the global DataCommon problem is crafty! Two thumbs up!

It would be best to reach out to us through email to discuss additions and any expansion. I have attempted to reach you a few times with no reply. The forum wouldn't be a great place for that. Please reach out to us anytime.

JimSocks
April 29th, 2021, 21:06
I have attempted to reach you a few times with no reply

Oh no! Via email? I’m so sorry! I saw emails from John and Doug but must’ve totally missed yours :(

I would have totally replied if I had caught them! I am thinking I don’t know which email address you are sending them from, so maybe that’s why they passed under my radar...

In any case, my apologies. Email is definitely what I had in mind

JimSocks
May 15th, 2021, 18:08
additional @JimSocks input.

...And I have it all together now!


reach out to us

Superteddy, I shot you a message so we can link up for code delivery. I packed some more horsepower under the hood :)

Stuggesjoerd
May 19th, 2021, 10:19
Awesome to see the work that is being done. I am looking forward aswell to the new content generator build upon story template pro.
Keep it rocking!

dbachen
June 2nd, 2021, 02:22
If we have a request, do we make it to you , or to SW directly in House of Healing?
I'd really like to the see the date formatting be a little more non-US centric so that you can swap around the m d y as needed like OS/programming languages handle it... while mm/dd/yyyy is nice, it would also be nice to be able to do yyyy/mm/dd (when you want to sort by year first) or dd/mm/yyyy as they do in the UK

johnecc
June 2nd, 2021, 13:54
Considering Story Template is now integrated into FG, and the extension is no longer required, I would suggest going direct to SW through House of Healing.

Trenloe
June 2nd, 2021, 13:55
Feature requests should be added to the FG wishlist here: https://fgapp.idea.informer.com/

Jiminimonka
June 2nd, 2021, 14:42
If we have a request, do we make it to you , or to SW directly in House of Healing?
I'd really like to the see the date formatting be a little more non-US centric so that you can swap around the m d y as needed like OS/programming languages handle it... while mm/dd/yyyy is nice, it would also be nice to be able to do yyyy/mm/dd (when you want to sort by year first) or dd/mm/yyyy as they do in the UK

I think those date formats are already supported. Not 100% but its in one of the videos or on the wiki

JimSocks
June 2nd, 2021, 18:58
If we have a request, do we make it to you , or to SW directly in House of Healing?
I'd really like to the see the date formatting be a little more non-US centric so that you can swap around the m d y as needed like OS/programming languages handle it... while mm/dd/yyyy is nice, it would also be nice to be able to do yyyy/mm/dd (when you want to sort by year first) or dd/mm/yyyy as they do in the UK

That’s easy enough, I can work it up when I return home in two weeks and submit an improvement to SW.

Though, if you purposely type in an incorrect format, FG will print all correct formats in the console! So type one incorrectly, then type /console in the chat, and have a look!

dbachen
June 7th, 2021, 22:07
That’s easy enough, I can work it up when I return home in two weeks and submit an improvement to SW.

Though, if you purposely type in an incorrect format, FG will print all correct formats in the console! So type one incorrectly, then type /console in the chat, and have a look!

Yeah, I tried alternate formats and got the message, which is why I was hoping to add it.. thanks for making the submission for me.

JimSocks
June 14th, 2021, 03:28
I'd really like to the see the date formatting be a little more non-US centric so that you can swap around the m d y as needed

Code improvements submitted to Smiteworks!
I have to admit, I THOUGHT it was going to be a quick operation, but then 15 versions later I finally got it where I was happy with it. I ended up doing WAY more than just implementing your requested formats!!!

I dug in and made date callouts REALLY user-friendly, as well as added support for any fantasy calendar you want to load in FG!

Now, the date callout format accepts anything you type into it (no matter the order, syntax, or extra words you put in), and will replace specific date strings if they are found within the callout brackets!

The user can enter the below strings in any way or order they wish within the callout, and it will work now- they are no longer tied to the list I thought up.
As a result, it's WAY easier to use now without error. A user can make up their own formats like [Date:The ddd of month, in the year yyyy] or [FGDate:dd/mm: yy] as examples.

The different strings and how they operate are listed below. If the Story Template sees any of them within the format section of the Date or FGDate callout, it will replace them with the appropriate value:

(For these examples, assume the date is November 2 1984)
"yyyy" = 1984
"yy" = 84
"month" = November
"mm" = 11
"mmm" = Nov (only works with Gregorian Calendar. Fantasy Calendars don't have abbreviations stored anywhere to use for this)
"day" = Friday
"dd" = 2
"ddd" = 2nd (adds a numerical suffix ie: 1st, 2nd, 3rd, 4th etc.)
"epoch" = AD
"oldschool" = Friday, the 2nd of November, in the year of our Lord: Nineteen Hundred and Eighty Four (Still only works with the system calendar/[Date:FORMAT], not a fantasy calendar/[FGDate:FORMAT].)

And as mentioned above, fantasy calendars are now supported for [FGDate:FORMAT] callouts!

Please be aware- the code is not yet live, and will have to pass through Smiteworks QC before it is. This could take time, so please be patient!

dbachen
June 14th, 2021, 04:34
Code improvements submitted to Smiteworks!
I have to admit, I THOUGHT it was going to be a quick operation, but then 15 versions later I finally got it where I was happy with it. I ended up doing WAY more than just implementing your requested formats!!!

I dug in and made date callouts REALLY user-friendly, as well as added support for any fantasy calendar you want to load in FG!


Thanks for the request and running with it.. That's what makes a great programmer/engineer! I think there is a lot of value to what you added, so I appreciate the hard work.

JimSocks
June 14th, 2021, 05:08
You are welcome, and thanks for the... well the thanks lol. Honestly the fact that I couldn't figure out the Fantasy Calendars really bugged me before when I had to cut my losses on it and move on, so when you mentioned adding better Date Callout functionality it got me thinking about taking another swing at the Fantasy Calendars again at the same time. ...Then I realized instead of just adding the specific formats you requested, there was a MUCH better way to handle the formatting for ALL users, and then I just fell into a rabbit hole...

Additionally, for anyone else following this thread, here is what I am working on next for Story Templates:

Cross-Template & Regular Callout Column Referencing With Link Records (https://www.fantasygrounds.com/forums/showthread.php?69058-Story-Template-Cross-Template-Referencing-Bug&p=606876&viewfull=1#post606876)

If that thread is a bit too technical, what it all means is you could store links to items, encounters, parcels, NPCs, notes, story entries, images, or even other story templates, and then pull them via column referencing or even cross-template referencing whenever and wherever you need them. If I can pull it off, it will actually be a pretty big thing for Story Templates as a whole- so wish me luck!

UrsaTeddy
July 4th, 2021, 04:18
I have just started exploring Story Templates after this massive improvement!

I am not sure if this is possible (would be a great feature if not) - I would like to back reference results to ensure that I have not generated a duplicate.

For example I would like some Personality descriptors for an NPC but I do not want them to be described as Helpful, Tidy, Tidy, Shy. One Tidy is enough.

Can this be done? Is it something that is interesting for others?

D

JimSocks
July 4th, 2021, 05:26
The best way to do this currently is to reference several tables that don’t have overlapping results. So go online, find a list of every human personality trait, let’s say you get 100. Break them up into 5 separate tables of 20 traits without repeats, and you’ll get a list of traits with no repeats.

Back- reference checking would be a messy nightmare to code, especially with all the use-cases out there and different template layouts.

I mean, I have templates rolling on 200 cross-referenced tables, internal column referencing those results into other cross template callouts, mixed in with 300 normal table callout’s being column referenced after being hidden. Some of these tables start out at different places but roll in the same result tables.

Trying to back-reference all that... is not something I would want to chase down. Not to mention if I did get that working, all the potential issues it might cause unexpectedly when another result pops up somewhere that looks the same but came from a different table or callout. It’s kind of a can of worms.

Let me think...

I can think of one easy way to do this, which would be to create a new callout where you would specify a string and a limit for how many times it would be allowed to appear in the resulting story. Something like [:Limit “Shy”:1], and it would find the first instance of Shy in your story, and erase the rest, but that’s problematic too... for a bunch of reasons.

Or maybe a callout like [:Trait:NoRepeat][3x] would roll the Trait table thrice, discarding any repeat results and re-rolling the table. That’s not a bad solution, but fitting that in with custom naming, column referencing, cross-template storage, cross template referencing, cross template column referencing, and the hidden feature is not only difficult, but the result would be clunky and cumbersome for an end-user to use I think.

I don’t know... I mean maybe I could look into this if more people are interested? Sound off folks. Tell me what you think.

JimSocks
July 5th, 2021, 04:33
I think it’s one of those cases where just because you CAN do something, doesn’t always mean that you should?

UrsaTeddy
July 5th, 2021, 07:52
I would have thought it would be something like the regexp back referencing.

Jiminimonka
July 5th, 2021, 09:37
Sounds like a nightmare!

Jiminimonka
July 5th, 2021, 09:38
Sounds like a nightmare!

Are there any examples of these massively complex tables available? A mod maybe? Thanks

JimSocks
July 5th, 2021, 16:01
A mod maybe?

I’ve got a mod I’ve already poured over 1,000 hours into, with still a road ahead to go. It’s designed to give you a complete world to run a campaign in, and storylines for said campaign. It used my work on content generator as it’s bedrock, and has just exploded since then with the addition of all the new functionality. It’s... well it’s crazy massive.

I have formally requested Smiteworks permission for me to run a Kickstarter for it. Hopefully I get approval, and then I will let you all know when the campaign is set to start. The idea is this: if the Kickstarter is successfully funded, the mod will be free to everyone instead of an expensive paid item on DMsGuild. If that happens, then everyone has easy access to it if they want it and in my opinion Fantasy Grounds would become the absolute hands down go-to program for making a homebrew campaign, and then running said adventure. It’d be the bees knees.

There are resources out there that help you create a homebrew campaign, but I have seen them all and nothing even comes close to this.

Jiminimonka
July 5th, 2021, 17:17
I'll back that Kickstarter!

BaneTBC
July 6th, 2021, 18:31
You may actually be able to put it into the new Forge component instead of DMsGuild, but that remains to be seen once it is released.

JimSocks
July 10th, 2021, 00:36
Hey everybody!

New features are now live- including the ability to column-reference with Link Record results!
Also, I made a new comprehensive tutorial video for the Wiki, complete with quick navigation links in the video description so you can go straight to whatever you need to learn about!

Click HERE to go see the new video! (https://www.youtube.com/watch?v=FKI3e6mHG3I)

damned
January 8th, 2022, 10:34
Hi JimSocks

Raw Data: [:Organization Leadership:ORG]

Outputs (example) Large Centralised, 6, 2

#ORG|1# gives me Large centralised
#ORG|2# gives me 6
#ORG|3# gives me 2

How do I take #ORG|3# and use it to roll twice (because its value is 2) on another table
(example)
[2x][Countries]

JimSocks
January 9th, 2022, 14:34
So, that’s a tricky one that the code wasn’t designed to accommodate, BUT that doesn’t mean it won’t! I’ve found that by being sneaky we can eek more horsepower out of the system, so give this a shot:

Knowing the “order of operations” helps with a trick like this. What I mean by that is, which callouts are resolved first, second, and so on.

Cross template callouts and references are handled before normal table callouts with square brackets.

Soooo...

Try making the original callout a cross-template callout {:Organization Name:ORG} then do the regular callouts like this:
[{#ORG|3#}x][Countries]

This MIGHT work (I can’t test it for you right now)

What should happen here is that the cross template callout will get stored, then the cross template reference gets replaced, then the regular callouts get checked, and if done right- when they are checked they’ll be holding [2x][Countries] !

Let me know if that works! (If it doesn’t, there’s another trick we can try ;)
(Edited because I put the "x" in the wrong location)

damned
January 9th, 2022, 14:47
Close.

This works


Raw Data: {:Organization Leadership:ORG}

{#ORG|1#}
{#ORG|2#}
{#ORG|3#}

This one? [{#ORG|3#}x][Country]


But what the heck is a cross-template callout!

Zacchaeus
January 9th, 2022, 14:53
We really, really need more documentation on this.

JimSocks
January 9th, 2022, 20:40
Close.

...

But what the heck is a cross-template callout!

Ah yes, I put the “x” on the wrong side there didn’t I!? Glad it worked!

As for a cross-template callout, it’s already explained in detail on the videos I’ve posted (that are also on the wiki) as well as in the wiki text and to a lesser extent, in the top post of this thread (it at least explains the concept there)



... need more documentation


I think the documentation is adequate, but folks either don’t know where to find it or don’t bother to read/watch it. I’m open to ideas though- I can explain it better perhaps if the existing documentation doesn’t cut it?

damned
January 9th, 2022, 22:05
Ive read the doco and watched the videos.
Im lost....

These things are quite complex and following along with the video leaves me impressed but still lacking in understanding.

I would love to see more details/detailed/examples on the written documentation.
I know doco is painful to write... I have plenty of things that could do with better doco...

Arkaerial
February 13th, 2022, 15:54
Hey JimSocks, I asked this question but was directed to this thread. I'm just going to paste what I asked.

My question is I'm creating a random tables for my campaign an it's been okay because I never had to go to deep into the story template commands. The problem I'm stuck on is having a table roll up a random number ex. 1d20 merchants in a caravan. What I need is the results of the 1d20 merchants to be multiplied by 2 for the total number of carts in the caravan. How would I multiply the sums of the 2 separate tables or columns?

JimSocks
February 14th, 2022, 13:29
Hi there!

So, table math operations are actually from the base functionality. I’ll be honest, I always screw this up when I try to do it from memory and I’m in the car today with crappy reception or I’d look it up myself. It’s in the wiki though!

Multiplication works via an asterisk. As I said, I always get the order wrong when I guess but here’s my guess anyways- something like this:

[merchants][*2]

Gosh that’s likely to be entirely wrong syntax… the wiki could probably straighten that out with the right syntax.

Or… now that I think of it… MAYBE this would work but no promises:

[:[merchants]*2:MerchantNumber]

This assumes the table [merchants] only contains numerical values. But then again, if it does, you could probably just use [1d20*2] instead?

There’s another way perhaps: do the math work inside the merchants table instead of outside of it? So give the merchants table another column which contains the doubled values of the first column, then column-reference it when you need it.

So say we roll a 5 on the merchants table, and in that row column 1 contains “5” and column 2 contains “10”. When we want the doubled value from column two, just call it with #merchants|2#

Hopefully one of these suggestions works for you! (Just make sure to check the wiki about the math syntax because like I said, I always mess it up when attempting from memory)

Arkaerial
February 15th, 2022, 18:04
Thanks JimSocks, I'll try this today an let you know. Life has been a little hectic at the moment.
Thanks again

So I am going to post a few different ways that did work. I'm not sure if these were the way, but I can see I'm running down this rabbit hole.
Requires 2 Tables:

Table 1: [1d20]
Table 2: [2]

[:?MC01|1: people]
[:?MC02:carts]

Merchants: <people>
Carts: [<people>*<carts>]
or
Carts: [<people>+<people>]

The way I prefer since I can easily reference the columns elsewhere which is really nice.
1 Table with multiple columns
column 1: 1d20 column 2: [2]

{:?MC01|1:a}
{:?MC01|2:b}

Merchants: {a}
Carts: [{a}*{b}]

Thanks again.

tjlee
June 17th, 2022, 22:54
Someone suggested I post here, but rather than repost, I'll just include a link to my original post:

https://www.fantasygrounds.com/forums/showthread.php?74114-SUPPORT-17888-Story-Template-issue-involving-Callout-Internal-Ref-w-Custom-Naming&p=653328#post653328

Any advice would be appricated.

Thanks.

JimSocks
October 28th, 2022, 05:04
Story Templates Order of Operations:
The "PEMDAS"-like list below might help you to understand the "why" behind why some things work while others may not. This is how Story Templates work to parse your text and give you a beautiful Story Output- in this EXACT order. This could affect you for instance, if you try to put a column reference inside of a cross-template callout, as detailed in the post before this one. The order doesn't allow for that, because cross-template callouts are resolved first. Here is the order, in order:

*Each of these steps is also resolved TOP to BOTTOM in your text. In other words, lines you write below are affected by/processed after the lines existing above them in your body of text, within each respective step outlined below.

Cross Template Write in the template title area
Cross Template Write in the main body of text


(so, the first two things it does is look for callouts to store cross-template values you can reference later in this same template, or in another somewhere else. NOTE that from this point on, your template will no longer have ANY cross-template callouts in it until later when a table might dredge one up. Also note how it does the title area FIRST in a lot of these operations- it treats the title almost as an entirely separate entity- and that can be used to your advantage sometimes!)



perform Callout Storage References in the template title area
perform Callout Storage References in the main body of text


(so, next it looks for references to cross-template data to replace in the text. At this point on, there will now be NO cross-template references left until later when a table might dredge one (or thirty) up.)



replace Date in the title
replace Date in the main body


(now it's looking for date callouts, and replacing them with what the user wanted)



perform Internal Callouts in the title
perform Internal Callouts in the main text


(these are looking for callouts nested within callouts, and replacing them first. ie [:a [tableA] and [tableB] inside a parent:StorageName])



perform Internal References in the title
perform Internal References in the main body


(now it's looking for references nested within any table callouts. ie: [a <tableA> and <tableB> inside a parent] NOTE: It doesn't solve these yet- it can't. Instead, it saves them for later along with the whole table. If you ever get a result like "|!!|!|Table text|!|!!|", you can be sure you are having a syntax issue with either this exact step, or it's brother later on. NOTE: This ALSO is looking for #column|references# that are stored inside table callouts, and does the same thing with them, too- storing the whole enchilada for later solving.)



perform Table Lookups in the title
perform Table Lookups in the main body


(NOW we get to rolling on regular tables that are left, since the things nested within them (cross-template stuff and internal callouts, at least) should be resolved now, leaving us with regular table names. But what if those tables spit out cross-template callouts or references!? That's why the next things up are...)



Cross Template Write in the title
Cross Template Write in the main body text


(Again! Here we resolve storing cross-template goodies that came out of our tables. Of note- this is the LAST TIME your text will be checked for things you want to WRITE into a cross-template storage value. If you try to store anything after this into a cross-template storage spot, it won't work.)



perform Callout Storage References in the title
perform Callout Storage References in the main body text


(And this again too! Because tables can dig up cross-template references too, and this will resolve them. This will NOT be the last check for retrieving cross-template references you stored earlier- we get more chances for that below again.)



perform Column Reference Links in the title
perform Column Reference Links in the body


(Here it's looking for the #column|References# you might have lying around all by their lonesome, and resolves them. Note that cross-template ones were done way earlier, this is just for regular ones.)



perform Literal Replacements in the title
perform Literal Replacements in the text


(Don't worry about this step, but it's here. This just cleans up some code so it reads itself correctly. Code doesn't like some symbols, and this makes sure it turns a blind eye to them. The only way this might be an issue for someone, is if they start using really non-normal ascii characters in their table names or callouts. Don't do that.)



resolve Internal References in the title
resolve Internal References in the main text


(NOW it solves the internal references from earlier. Because of some physics involved, this was the best way to crack this nut. This is the other place you might hunt down an issue where your output has |!!|!| in it, as this is the brother we talked about earlier. Usually issues here have to do with syntax like odd ascii characters.)



perform Callout Storage References in the main body text
perform Callout Storage References in the main body text AGAIN


(Now it looks for references to cross-template data to replace in the text TWO MORE TIMES. Yes, this is entirely on purpose. When tables start digging deep, you need these additional checks. It comes up more than you might think, and I have had folks ask me for MORE recurses of this so they can have their tables dig even deeper. In the future if I get enough requests for this, I may add the extra recurses as it doesn't cost much processor-wise by this point- but for now it's just two re-looks here. Of note: This is the very last time a table or reference will be resolved anywhere.)



perform Link Replacements in the main text


(Find anything you intended to be a link, or that came out of a table and was supposed to be a link, and well... make it a link)



perform Indefinite Articles in the title
perform Indefinite Articles in the main body


(Look for areas the user wanted correct articles placed into the output, and make those pesky buggers right!)



perform Capitalize in the title
perform Capitalize in the main body


(Lastly, look for areas the user thought a table result might start a sentence, and capitalize it if it actually ended up doing so)

Weepdrag
March 7th, 2023, 20:00
Has anyone figured out a work-around for building a Random Encounter into a Template? That would be one feature that would make these AWESOME!