FG Spreadshirt Swag
Page 1 of 2 12 Last
  1. #1

    Story Template Output Troubles

    Hello, I have spent an incredible amount of hours tinkering with the various options in Story Templates, and I feel like I have a pretty good understanding of what works and what doesn't. I am perplexed however as to why the bottom example is not working.

    Template Data
    Race Ability Roll: [:NPCG Ability Score Rolls <Race>|2:STRr]
    Class Ability Table: [:NPCG Ability Score STR <Class>:CSTR]
    Exceptional Strength Table: [:NPCG Ability Score PSTR:PSTR]
    Class Ability Result: [:#CSTR|<STRr>#:STR]
    Ability Call Back: <STR>
    Exceptional Strength Call Back: #PSTR|<STR>#

    Template Output
    Race Ability Roll: 5
    Class Ability Table: 9 9 9 9 9 9 9 9 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
    Exceptional Strength Table: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 (69) 0 0 0 0 0 0 0
    Class Ability Result: 9
    Ability Call Back: 9
    Exceptional Strength Call Back: #PSTR|9#

    For some reason the last step in the column number calls back correctly but not the table.

    I included a screenshot of an example.
    Attached Images Attached Images
    "My campaigns are multi layered tapestries upon which I texture themes and subject matter which quite frankly would be to strong for your hobbiest gamer."
    -Doug Dougalson

    Fantasy Grounds License: Ultimate
    Games I Run: AD&D 2nd Ed
    Currently Running: AD&D 2E (Forgotten Realms)
    Games I play: Any~
    Converted Modules: Faiths & Avatars (2e), Demihuman Deities (2e), Tome of Magic (2e), Dragon Mountain (2e)
    Current Projects: None
    Created Content: AD&D 2E NPC generator Module

  2. #2
    Super-niche and complicated examples are hard to sus out where they are going awry without an intimate knowledge of the structure of all the tables involved unfortunately.

    Though it looks like your last call differs from all the others a bit, though I can’t definitively say that’s the issue here.

    Try using a cross-template storage/reference combo, even if you aren’t planning on using the data in another template. Cross-template data takes a different path than regular callouts/references, and sometimes that can be just what the doctor ordered.

  3. #3
    I played with cross-templates for a while but I could not get them to do what I needed either. I admit I'm not extremely savvy on those but I could get basic features to work. I've watched your video many times and I found it very helpful.
    That Said, This screen shot should help you understand what I'm trying to do and the logical things I've tried that I feel should work. I kept the tables very simple so you can see what I'm trying to do.
    Essentially I have 3 tables;
    Table A is the roll.
    Table B is the stat result from the roll.
    Table C is any bonuses from the results of table B.

    Its the table C output that I can't get to work no matter what I try.
    Attached Images Attached Images
    "My campaigns are multi layered tapestries upon which I texture themes and subject matter which quite frankly would be to strong for your hobbiest gamer."
    -Doug Dougalson

    Fantasy Grounds License: Ultimate
    Games I Run: AD&D 2nd Ed
    Currently Running: AD&D 2E (Forgotten Realms)
    Games I play: Any~
    Converted Modules: Faiths & Avatars (2e), Demihuman Deities (2e), Tome of Magic (2e), Dragon Mountain (2e)
    Current Projects: None
    Created Content: AD&D 2E NPC generator Module

  4. #4
    Wouldn't your Table C formula look very similar to your Table B formula, so {:#<c>|<d>#:e}? Storing the bonus result into a variable e? Therefore your stat would be in d, and the bonus in e?

  5. #5
    {:#<c>|<d>#:e} Will just store the data as {e} for later use.
    Also the <c> is not the correct syntax. I just put that because I was trying every combination just to make sure I didn't miss something.
    #c|<b># should be the correct syntax as that calls the table and its asking for the column from the results of table B.
    I can't even get the story templet to output the result.
    Third Tier reference just doesn't seem to work.
    I have tried every combination of <> #|# {} {#|#} {:#|#:n} that I can think of.
    Right now the only solution I have is to have a table that rolls The Class and Race together.
    This gets pretty crazy as I'm sure you can imagine. If you have say 6 Races that's 6 Tables just for Fighter.
    This also makes it very difficult if not impossible to have a story template roll for a random race. Not a huge deal but it would be a nice feature to include.

    I also want to clarify that screen shot is just a quick example. This story template is for AD&D 2e. Character classes have a lot of parameters that I'm trying to include based on RAW.
    Races have Ability Bonuses and Penalties.
    Classes have minimum ability requirements.
    Warriors have different HP and STR bonus's than non-warrior classes.

    Anyway if its not an option that can be added or clarified for me, I'd like to know so I know that I need to commit to making race/class ability tables for every race/class combination.
    "My campaigns are multi layered tapestries upon which I texture themes and subject matter which quite frankly would be to strong for your hobbiest gamer."
    -Doug Dougalson

    Fantasy Grounds License: Ultimate
    Games I Run: AD&D 2nd Ed
    Currently Running: AD&D 2E (Forgotten Realms)
    Games I play: Any~
    Converted Modules: Faiths & Avatars (2e), Demihuman Deities (2e), Tome of Magic (2e), Dragon Mountain (2e)
    Current Projects: None
    Created Content: AD&D 2E NPC generator Module

  6. #6
    Good afternoon I wanted to revisit this as there has not been any viable solution recommended nor any updates.

    I played with Cross Template Storage as much as I could figure out based on the videos I was able to find. The examples provided did not solve any of the issues.

    The real problem seems to be that I cannot use a table column to call out a specific column in another table. No matter how I try it I just get one of two errors,

    A straight up table call out returns the following: |!!|!|Table B Stat Bonus|8|!|!!|

    and a cross reference either says No Stored Data or #Bonus|8# depending on how I attempt to use it.

    I feel the examples I have given above more than explain the issue I am having, and are simple enough to replicate the issue.

    Can I please be notified if this is being looked into or if I should just assume there will be no fix.

    v/r,

    Frank
    "My campaigns are multi layered tapestries upon which I texture themes and subject matter which quite frankly would be to strong for your hobbiest gamer."
    -Doug Dougalson

    Fantasy Grounds License: Ultimate
    Games I Run: AD&D 2nd Ed
    Currently Running: AD&D 2E (Forgotten Realms)
    Games I play: Any~
    Converted Modules: Faiths & Avatars (2e), Demihuman Deities (2e), Tome of Magic (2e), Dragon Mountain (2e)
    Current Projects: None
    Created Content: AD&D 2E NPC generator Module

  7. #7
    It saddens me that this is being ignored.
    "My campaigns are multi layered tapestries upon which I texture themes and subject matter which quite frankly would be to strong for your hobbiest gamer."
    -Doug Dougalson

    Fantasy Grounds License: Ultimate
    Games I Run: AD&D 2nd Ed
    Currently Running: AD&D 2E (Forgotten Realms)
    Games I play: Any~
    Converted Modules: Faiths & Avatars (2e), Demihuman Deities (2e), Tome of Magic (2e), Dragon Mountain (2e)
    Current Projects: None
    Created Content: AD&D 2E NPC generator Module

  8. #8
    You should PM JimSocks directly. He provided and supports the feature.

    Regards,
    JPG

  9. #9
    Zacchaeus's Avatar
    Join Date
    Dec 2014
    Location
    Scotland
    Posts
    20,831
    Quote Originally Posted by Frankison View Post
    It saddens me that this is being ignored.
    Sorry but the only person who really understands these things is JimSocks and he's not around a lot anymore as far as I can see. I'd do what Moon Wizard suggests and hope that he gets back to yiou.
    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

  10. #10
    TLDR: So, this isn't something the system was built to support.

    Namely, you are trying to do too many things in the same template in a row, also in an order that isn't going to work even if it was set up to support doing all those operations in a row. Your chief problem is when you try to use #column|references#, the order in which those are resolved isn't going to work with what you want to do, especially with how cross-template references are resolved as well. You see, it does things in a very certain order of operations, and some things only work in that order- sort of like PEMDAS if you are into math stuff. Also because of the order, some things won't work at all because the system has to store values and hold them in reserve while checking and replacing others before printing the stored values. It's all a complicated dance to get them to all work in concert, but I have done my best to recurse the most used operations in order to make this transparent for the vast majority of users.

    Additionally, the WAY in which cross-template data is stored (in conjunction with it's order) means it's storing the EXACT phrase "#b|<a>#" and NOT what those resolve out to- because again: the order of operations. Try to call {d} in another template, and you'll see what I mean. It looks like it's resolving fine in your single template, but that's a trick being played on you by the order of operations- {d} spits out #b|<a>#, which is later resolved and appears to look just fine- but that number was NOT stored in {d}, it was the exact phrase "#b|<a>#" instead! (but WHY doesn't {:#b|<a>#:d} resolve the column reference, you might ask- again, this is because it's not TIME YET to do that in the order of operations- cross template resolving comes way beforehand, so it just stores the raw "#b|<a>#" text as {d} )

    What you can do, is either roll on half the things in a pre-loader template (a story template who's only purpose it is, is to roll and store values for other templates to use), and call those using cross-template referencing in your main templates, or make lots of tables instead. In the Campaign Generator mod I am making, I choose the former of these two options once right at the very beginning, but then in several internal templates I choose the latter just because more than one pre-loader template is clunky to the user so I do all the table work on the back end so they don't have to deal with that. You are correct, this can result in a lot of tables- but it can still be random with some clever ordering and tables calling other tables. Here is one more super sneaky trick you can toy with to try to outsmart the order of operations- I use it to great effect and it helped me get around some interesting order of operations problems, but again it relies on using a pre-loader template:

    {:Region Race:Main City Race}
    {:MC Racial Variation Words:MRacial Noun}
    {:?<MRacial Noun>:MC Racial Noun}
    In the above example- [Region Race] spits out a race, let's say "Gnome". That gets stored in a cross-template reference as {Main City Race}. Next, the table [MC Racial Variation Words] only has one result possible inside of it- a line that reads: [{Main City Race} Variation Words] as it's only table item- so [MC Racial Variation Words] essentially also has a cross-template reference inside it's results that was JUST rolled and stored one line earlier. That is then stored in MRacial Noun, which is IMMEDIATELY referenced in the next line. Then I store that inside MC Racial Noun for use elsewhere. Now, because of the order of operations, if I re-order these lines at all this will NOT work- it has to go in this order. Furthermore, if I try to call {MC Racial Noun} or {#MC Racial Noun|4#} in this same template- it won't work, either! However, if I call either of those in a NEW template, then I get "Gnomish", or whatever racial noun I stored with all that trickery earlier.

    So to recap, when the system parses your story template for things to take action on- it does so in the following order I spoke about above (see next post). The "PEMDAS" below might help you to understand the "why" behind why some things work while others may not... or maybe this will come out as senseless gibberish that won't help you at all, but perhaps might help someone else as time goes on.

    I know this isn't what you hoped to hear, but your use-case just isn't supported by the code, as it's trying to do too much in the same template, in an order which isn't going to work. Apologies for not being swift on the investigation, but work has me sent off to a land far far away for awhile.
    Last edited by JimSocks; October 28th, 2022 at 04:28.

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