bcholmes / StarTrek2d20

Character creation tool for Star Trek Adventures RPG from Modiphius.
ISC License
18 stars 7 forks source link

Potential feature: Export as XML for Fantasy Grounds #120

Open Felderburg opened 1 year ago

Felderburg commented 1 year ago

Per discussion in #119 an FG-specific issue is requested.

Proposed: a way to export characters to XML files, for import to the Fantasy Grounds official ruleset/modules.

The relevant items from #119 (conversation between BCHolmes (quoted) and myself):


It's almost-certainly possible. I don't have Fantasy Grounds, myself, so I'd need the output of that poking around to help me, and I'd probably need someone to test things out.

Attached is an exported character (they export as xml which github evidently doesn't support, so I saved it in notepad++ as .txt with no changes). This character was generated through the FG "character creator" which walks people through the lifepath creation process. Characters can also be created from scratch, which I assume would yield different results (especially in the attribute and discipline sections, which it looks like have the calculations from the lifepath steps—while a scratch character can have those options drag-and-dropped, if someone were to type them or change them manually I am currently unsure what it would look like).

I will endeavour to get other examples to you, specifically a drag-and-dropped character and a totally manual one, but not tonight.

The thing about FG is that most talents don't actually have mechanical effects, and must have their effect be manually done in FG. So that probably makes an export easier. You can make "custom" talents as well, so it should be possible to see what an export of a character with talents and lifepath options not covered in the available FG modules looks like, which would make an export of a character with Delta Quadrant stuff, for example, possible from this tool to an FG-readable xml.

Vulcan Test Export.txt

Edit: you will note the presence of curly apostrophes converted into &#8217 ; type stuff; I submitted that issue as a bug on the FG forums. Most of them seem to appear in talent or item descriptions, so they shouldn't affect anything mechanical if you use straight apostrophes.

Edit: I strongly suspect a simplified version would work. Many items have a lot of formatting that is, mechanically, unnecessary. For example, the career events, while looking nice in FG, probably don't need the bolding and extra lines to be readable. I'm not sure how hard it would be to take things like that from the helpers files and turn them into xml—the text is there, but is it worth formatting for FG?

I should also note that I will provide screenshots of the character sheets in FG at some point, because looking at the xml and the sheet in FG, it is immediately obvious what tags are important and how they go in the UI, but won't be if you don't have FG.


This bit, here, looks a bit hard to produce:

  <control>
    <careerevent type="number">0</careerevent>
    <edit type="number">7</edit>
    <environment type="number">0</environment>
    <misc type="number">0</misc>
    <species type="number">1</species>
    <total type="number">11</total>
    <training type="number">1</training>
    <upbringing type="number">2</upbringing>
  </control>

It looks like a summary of how the different points were applied (a base of 7, +1 because Vulcan species, +2 because of upbringing, +1 because of Starfleet training). I might be able to derive that at the time a character is first generated; the "view" version of the character doesn't currently save that information.

The links might also be hard. The format for some of them might be doable; I'll need to think about it. How many sources do they currently support?

And am I reading it right that you gave the character focus names like "upbringing focus"?

I don't think that the way the points are gained/calculated matters to FG mechanically (I assume that the dev of the ruleset kept things notated this way for transparency/better record keeping). That's why I'll be creating a character manually, to see what that looks like (I will also edit Mr. Vulcan Test manually to see how that goes). I'm away from my FG computer, but as I recall you can just type a new number in, or do a "temporary" change which changes the total but has an indicator number next to the stat of how much it was changed by, which should be interesting to see the xml of.

And am I reading it right that you gave the character focus names like "upbringing focus"?

Correct. For the steps that have a focus or a value, I put [step] [item]. It seemed like that would be easier to see the structure of things that way.

The links might also be hard. The format for some of them might be doable; I'll need to think about it. How many sources do they currently support?

They currently support the Starfleet core book and Alpha Quadrant. Based on how quickly Alpha came out after the core, I assume the other quadrant books will also be out relatively soon. I will not be purchasing anything other than the core from FG (maybe Klingon core if it includes updated milestones and the House system).

The links are interesting, and another reason we need to see a manual/custom character. Not only can things be typed in manually to a character sheet, it is also possible to create custom lifepath options, which link in the same way as the rules-as-written ones on the character sheet, but I assume don't link to "reference.environment.id-00001@Star Trek Adventures Core Rulebook" (e.g.).

I'll muck about this evening (maybe) and do some more exports. I still strongly suspect that this version of an export is more complicated than a custom character will be, or if I just type in stats from a character created using this tool.

Felderburg commented 1 year ago

Attached is a character created mostly by editing, with a few career events dragged and dropped. We can now see the "edit type" items for stats are the base number. Without attaching too many files, I've also found that editing the "total" line item does nothing—it is automatically calculated. The "misc" line item is the temporary change one.

Of note, when creating a character "from scratch" by editing the character sheet directly, dragging and dropping career events doesn't do anything, but dragging and dropping items like upbringing/environment create little popups that allow you to choose stats per the selected item. (Also of note, you can not manually edit below the totals given by lifepath options—our test vulcan has 5 from various steps (edited down from 6 during the final touches) and can't go below that manually but the temp item can go as low as you can scroll.)

Lt test from scratch2.txt Lt test from scratch2_drag and drop2.txt

At this point, I wonder how much time and effort this will take, and if it's "worth" it. Random thoughts as they come to me:

bcholmes commented 1 year ago

Two complications.

First: there's no "easy" indication of whether or not an upbringing was accepted or rejected. I may have to go spelunking into the attribute/discipline build info to figure it out. Which will work for the characters that were built using lifepath, but not all characters.

Second: rank is gonna be tricksy. Here's how rank is represented in the drag-and-drop character:

<rank type="string">4</rank>

I can speculate that 4 = Lt. Cmdr. But that's just a guess. Vulcan science guy doesn't appear to have a rank. So that's odd. Can you confirm/refute?

It suggests to me that the representation of rank is going to need to change once enlisted folks and non-Starfleet characters get introduced.

Can you create a character using the "Another Species' Homeworld" Upbringing?

bcholmes commented 1 year ago

At this point, I wonder how much time and effort this will take, and if it's "worth" it.

I'm not overly worried about that, at the moment. It may need a bit of back-and-forth, but if you're up for it, I am too.

Felderburg commented 1 year ago

Rank is selected by clicking through rank icons. It starts with no rank, as the Vulcan (doesn't) show, and then uses TNG pips starting with "Chief Warrant Officer" at one black pip, then the standard scheme from ensign to captain, and the flag officers are listed as commodore with one pip and fleet admiral with 2 (which is perhaps a feedback that I should report now that I see it). So CWO, Ens, Lt jg, and then Lieutenant being the fourth is why 'test from scratch' is rank 4. There does not appear to be a way to create a custom rank.

"Another Species' Homeworld" is available. It allows you to just select any attribute and any discipline. Looking at the rulebook, that's probably the easiest way to code it, although I suppose it might annoy people who would prefer a list of homeworlds.

Upbringing: correct, there doesn't appear to be a way in the character sheet to tell whether an upbringing was accepted or rebelled against. The initial selection does have a choice, but once the attribute is added it doesn't seem to track beyond adding to the <upbringing type="number">X</upbringing> line item. I have inquired on the FG forums (https://www.fantasygrounds.com/forums/forumdisplay.php?137-Star-Trek-Adventures-2d20). (Edit: the reply: "No, didn't really think it was needed. The player can make note of it in their notes.")

Side note: the most recent question in the general questions thread on FG asked about exporting ships. The response from the dev was "No, that is not available." So I guess we don't have to worry about that.

Felderburg commented 1 year ago

Attached is a picture of the UI, which may help? I don't know. Apparently last time I was mucking around I dropped a bunch of stats using the temporary change method, which is why several are in the negative. You can see the second small number that shows how much I reduced them. The small number is what shows up in the "misc" line item for a stat. Negatives just use a regular hyphen (e.g. <misc type="number">-2</misc>).

I did not show the ships tab in this pic because I haven't made any ships in this testing environment yet, and I'm not sure it's even something that an export from this tool should do.

You may also note that there is a section for supporting characters—I haven't messed with that yet. Exporting them would tie them to a specific character (although they can be copy-dragged to other characters) and also doesn't add them to the main character list, so how that works is likely going to be up to individual tables (e.g. some tables may want a normal sheet for their supporting folks).

Edit: interesting note about the UI. I created a character just to see about the upbringing thing, and its export did not have an HP section. After going to the combat tab, it did (although I'm not sure if it's actually viewing the tab, or closing and opening the character that made it appear).

Edit: Most items with the orange badge are clickable links (e.g. talents). The lifepath options are also clickable, although that is not readily visible in the UI. Once they get into the character sheet, items that don't contain the links you noted are editable (items and talents). Linked items open a popup that contains non-editable info from the ruleset.

vulcan science guy char sheet ui

bcholmes commented 1 year ago

I've implemented an initial version of this. There are limitations that I've made -- notably, I do not currently link thinks like Environments to their rule content (partially because Environments like those from the Player's Guide would not be supported). But I may tweak things over time.

Felderburg commented 1 year ago

I've implemented an initial version of this. There are limitations that I've made -- notably, I do not currently link thinks like Environments to their rule content (partially because Environments like those from the Player's Guide would not be supported). But I may tweak things over time.

I'll take a look at the results later this week/weekend.

Felderburg commented 1 year ago

I just exported an NPC real quick. I'll have to check how it goes into FG, but looking at the XML, the focuses have the new line "/n" between them, rather than splitting each focus to a new id#.

E.g.: `

upbringing focus
        <id-00002>
            <name type="string">training focus 1</name>
        </id-00002>
        <id-00003>
            <name type="string">training focus 2</name>
        </id-00003>
        <id-00004>
            <name type="string">training focus 3</name>
        </id-00004>
        <id-00005>
            <name type="string">career event focus (truly alien being)</name>
        </id-00005>
        <id-00006>
            <name type="string">career 2 focus (breakthrough/invention)</name>
        </id-00006>
    </focuslist>`

Edit oh jeez the formatting, but it's pulled from vulcan test guy.

bcholmes commented 1 year ago

Interesting. I actually spent a bit of time creating characters in FG and all the ones that I created came out with a single focus/id-000x element with text separated by new line indicators.

But I can change that.

Felderburg commented 1 year ago

Well, I should probably retest exports. There's been a few updates since I created 'Vulcan test guy'.