-
September 12th, 2020, 02:35 #1
Is this possible with an extension?
Can an extension add this functionality to story templates? I am just wondering if it is even theoretically possible?
Basically, I want to roll once on a main table, and then reference the previously rolled columns individually a-la-carte afterwards.
Table Extention Query.JPG
-
September 12th, 2020, 04:42 #2
Not sure what your trying to achieve? But I think it could be done.
Remember You can nest tables too, if that would help??"When questing once in noble wood of gray medieval pine, I came upon a tomb, rain-slicked, rubbed cool, ethereal, its inscription long vanished, yet still within its melancholy fissures."
-
September 12th, 2020, 04:53 #3
Nope- nesting tables doesn't work for recalling usable data within a story template.
I want to call a table with several columns, then individually use the results of that initial table roll's individual column results later. The implications of being able to achieve this would blow the roof off my story templates! In the attached picture from the first post, you can see the table, the story template, and the generated result. I am wondering if an extension COULD be made which makes the <Star Type|2> reference work as I want it to in this example picture. Namely, if it worked the way I am looking for then the generated story would replace that reference with "AIII" in this instance, since that was the result from column 2 when the entire table was previously rolled.
-
September 15th, 2020, 05:46 #4
Sure, but you would have to re-write the table functionality. Paramaterize everything, and write the LUA so that all those parameters can be stored. And determine how long they should be stored for.
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.
-
September 15th, 2020, 15:15 #5
I figured it had more to do with the output of the tables themselves than the story templates (though I assume story template code would have to be altered some too, in order to parse the altered output of the tables). I am thinking the values shouldn't be stored past the generation of the result from the template? Once the story is successfully generated, the storage locations get cleaned out? I can't imagine needing them past that point, and that could free up the space for the next table's data. Also, only table output when requested from story template needs to be altered, all others can stay the same.
WAIT! Normally, when a table with several columns outputs to a story, the result ends up with semi-colons between column data! Maybe it's possible to keep table output as-is, but have the story template store the output into "columns" using the semicolons as a de-limiter!? This would mean using semicolons in your text would be off limits, but that's a teeny price to pay. So, here's the idea (tell me if I am crazy!):
Within the story template, you type: [Test Table] The Test Table has two columns that say: Column one: ONE Column two: TWO. Normally, when generated this would output in the resulting story entry as: ONE; TWO. So, we alter the story template to take the results of a given table's output, in this case [Test Table], and look for semicolons in the output. If it finds it, it stores each in a location that can be called with <Test Table|1> and <Test Table|2>. In this case, thereafter calling <Test Table|2> would output only: TWO. The storage solution for this could be very similar to how the data for previously rolled tables is already handled.
-
September 15th, 2020, 15:50 #6
You're crazy.
But your idea is sane
Still would require an extension though!
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.
-
September 15th, 2020, 16:19 #7
- Join Date
- Jan 2014
- Location
- California
- Posts
- 1,564
Unless you expect to need to regularly change the table data you might do better to just build an extension with the options you want rather than monkey with the table system.
-
September 16th, 2020, 20:03 #8
Anyone here know where I should start looking in the FG code for the Story Template sections?
Sadly, the only thing I only ever learned to code poorly was C++, so looking at the lua code confounds me. I think this is something I would have to look into commissioning someone to do on my behalf... lua looks so confusing to me
-
September 23rd, 2020, 04:41 #9
OK so... I enrolled in a lua class for this.
I am already picking it up quickly enough to cause trouble, but I am also only just getting started. I have located the lua code that handles the tables in FG, but now I need to find the lua that handles the story templates and I am coming up empty handed.
Can anyone point me to the right filename? EDIT: After looking for ages, I Found it right after posting this...
ALSO OF NOTE HOWEVER... I found this little ditty in the FG code, which might be useful to gaze at while I figure out how to capture the incoming data from a table headed towards the story template output, and then de-limit it based on the semicolons to be stored as separate column data for later retrieval:
Code:-- SPLIT CLAUSES -- -- The source string is divided into substrings as defined by the delimiters parameter. -- Each resulting string is stored in a table along with the start and end position of -- the result string within the original string. The result tables are combined into -- a table which is then returned. -- -- NOTE: Set trimspace flag to trim any spaces that trail delimiters before next result -- string -- function split(sToSplit, sDelimiters, bTrimSpace) if not sToSplit then return {}, {}; end -- SETUP local aStrings = {}; local aStringStats = {}; -- BUILD DELIMITER PATTERN local sDelimiterPattern = "[" .. sDelimiters .. "]+"; if bTrimSpace then sDelimiterPattern = sDelimiterPattern .. "%s*"; end -- DEAL WITH LEADING/TRAILING SPACES local nStringStart = 1; local nStringEnd = #sToSplit; if bTrimSpace then _, nStringStart, nStringEnd = trim(sToSplit); end -- SPLIT THE STRING, BASED ON THE DELIMITERS local sNextString = ""; local nIndex = nStringStart; local nDelimiterStart, nDelimiterEnd = sToSplit:find(sDelimiterPattern, nIndex); while nDelimiterStart do sNextString = sToSplit:sub(nIndex, nDelimiterStart - 1); if sNextString ~= "" then table.insert(aStrings, sNextString); table.insert(aStringStats, {startpos = nIndex, endpos = nDelimiterStart}); end nIndex = nDelimiterEnd + 1; nDelimiterStart, nDelimiterEnd = sToSplit:find(sDelimiterPattern, nIndex); end sNextString = sToSplit:sub(nIndex, nStringEnd); if sNextString ~= "" then table.insert(aStrings, sNextString); table.insert(aStringStats, {startpos = nIndex, endpos = nStringEnd + 1}); end -- RESULTS return aStrings, aStringStats; end
Code:sLocalReplace = table.concat(aOutputResults, "; ");
Last edited by JimSocks; September 23rd, 2020 at 05:00.
-
October 7th, 2020, 04:50 #10
Ok so I am making some headway, and I have a plan. There are some mysteries yet to figure out, like on the line
Code:for nStartTag, sTag, nEndTag in sOutput:gmatch("())%[([^%]]+%]()")
Also, where can I find the class defininitions for the "DB" class called here with the getValue tacked onto it:
Code:sText = performTableLookups(DB.getValue(node, "text", ""));
For the record, here is the plan right now: have the story template search for tables with a special character set FIRST, and resolve those tables storing any results into arrays. Next, look the template over for reference links of those tables, using the same special character sets. When a "special character set table" is referenced, insert the data stored in it's array for that location.
Practical use: A story template has a Table to roll on, but it has a double asterisk at it's beginning, and later there are references to it using the same double asterisk:
Code:[**NPC Table] <**NPC Table|4> <**NPC Table|1> <**NPC Table|6> <**NPC Table|4>
Code:[**TableA] [**TableB] [<**TableA|1><**TableB|1>]
Last edited by JimSocks; October 7th, 2020 at 05:08.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks