PDA

View Full Version : Story Template produces |!!|!|Table Name|!|!!



dearestleader
February 14th, 2022, 05:09
Hi All,

I have a similar problem to what is referenced in https://www.fantasygrounds.com/forums/showthread.php?68829-Story-Template-Not-Working-Properly&highlight=story+template

I believe it might be a character in the table name since it happens on Half-orc and Half-elf. I do not have this issue if the Race table brings up Gnome, Dwarf, Elf, Halfling, Human, etc. Do the experts know if this is related to the hyphen in the table name?


Name: |!!|!|Faerūn, Half-orc, Male|!|!!| |!!|!|Faerūn, Half-orc, Surname|!|!!|
Name: |!!|!|Faerūn, Half-elf, Male|!|!!| |!!|!|Faerūn, Half-elf, Surname|!|!!|

Story Template Contents
WORLD: [:World:Continent]
Race, Gender, Class: [Race] [Gender] [1d2]-level [Class]
Name: [<Continent>, <Race>, <Gender>] [<Continent>, <Race>, Surname]
Continent just generates Faerūn for now
Gender is a table that 50/50 outputs Male or Female
Race is the table from Xanathar's
Class is the table from Xanathars

Using FGU and the 5e ruleset to try this out.

JimSocks
February 14th, 2022, 12:35
Hi there!

You are absolutely correct- it’s the hyphen that’s getting you. It’s a known incompatibility, and it’s not an easy nut to crack in the code, either.

The output you are seeing with the |!!|!| tags means that the hyphen is specifically getting stuck in FG’s throat as it attempts to resolve your Callout Internal Reference (ie when you nest a reference inside a call out name like [:table <one>:name] as an example). But trust me, if it wasn’t getting stuck there it would get stuck in any one of another fifty places in the code. Hyphens don’t play nice.

I’ll take a stab at the code this week to see if I can figure out a way to allow hyphens in table names, but until then here’s two workarounds:

1. Copy the tables from the sourcebook, and remove the hyphens from your copied versions then use those instead. Fixed!

2. If you MUST use the sourcebook tables as-is, there’s a clunkier, finicky way you might be able to. You might have to tinker with it, and it’s going to print a line you won’t want in addition the the one you do. Here it is, nonetheless:

Start off the original callout with a cross-template callout instead. Then reference the custom name of that inside your table with the internal references. So it might look something like this:

WORLD: [:World:Continent]
Race, Gender, Class: {:Race:RaceName} [Gender] [1d2]-level [Class]
Name: [<Continent>, {RaceName}, <Gender>] [<Continent>, {RaceName}, Surname]

Note: this second method is not guaranteed to work, and even if it does it may print extra stuff you weren’t desiring. Those hyphens are real jerks.

dearestleader
February 14th, 2022, 13:03
Thanks for verifying! I'll go with Workaround #1. It's easier to make a copy of the table from Xanathar's and remove the hyphen in Half-orc and Half-elf, then change the name of my tables to match that source. Just trying to use as much official off the shelf material as possible without changing it.

JimSocks
February 21st, 2022, 21:00
As of this afternoon I have submitted a large update to the story template code to Smiteworks.
Give it some time and they will toss it into the game.

A part of this update was fixing your hyphen issue. Once implemented you should no longer have any troubles with those pesky hyphens! :)

I have not tackled the issue yet with the special alpha character present in "Faerūn" yet, but I will have a go at that for the next update down the line.

Nylanfs
February 22nd, 2022, 15:42
So does this mean we can start using Klingonese? :D