• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

XSL for standard stat block output

wdmartin

Well-known member
Is there someplace I can find the XSL that defines the BBCode output for the standard pathfinder stat block? Or is it hard coded in? I went poking through the game system data folders and failed to find it.

All I really want to do is create a custom output option that adds a carriage return after each skill and item in my inventory, so that those sections don't become a massive unreadable lump of text when I post them.

But unless that XSL is available someplace, I'm going to have to manually reimplement the entire thing. Which would be a ton of work for a fairly minor change. Plus I probably wouldn't do it as well as the Lone Wolf staff did -- I'm sure they've run into and taken into account more weird edge cases and exceptions than I've even dreamed exist.

Any suggestions would be welcome.
 
Sorry, can't help with the BBcode stuff — I'm pretty sure I've seen other comments here that it's "baked in", though.

I guess it depends on how often you have to do this, but if it were me, I'd open the text file in vim, highlight the lines for skills, then execute :s/$/^V^M/ and hit Enter. (The replacement string contains two characters, "^V" is Ctrl-V and "^M" is the Enter key. All highlighted lines will have an extra newline added to them. I just tested this in MacVim.) Repeat for inventory items. Make this a macro and now it's just highlighting the text and a single keystroke.

If you don't have vi or vim available, I'm sure your favorite editor has something similar.

It'd be a pain if you were doing this a lot, though. In that case, I'd find a way to do it in Python or Perl or some other interpreted language. The issue there is selecting the lines to be modified — you'll need some way to identify which lines should be affected. For example, if the skills start with the string SKILLS and end with a blank line, then Perl could select all of those lines with something like /SKILLS/../^$/ inside a while loop.
 
Sigh. I was afraid of that.

I may go for a programmatic solution -- probably Python. XSL has its uses, but it's really clunky to work with.
 
The statblocks are not generated by XSL. They're generated by a set of scripts and procedures within the program.

However, the relevant pieces are within a procedure, which means it's accessible in the editor - in the procedures tab, copy sbmain2, and you can look at how these are generated. The skills and gear are both in sbmain2.


Here's the dossier element that builds things:

Code:
  <!-- the regular statblock -->
  <dossier
    id="txtpaizo"
    name="Statblock">
    <dossier_text
      styles="plain+html+bbcode+wikitext+print"
      grouping="default"
      statblock="yes">
      <live><![CDATA[!CharType.typArmy & !CharType.typKing]]></live>
      <synthesize><![CDATA[
        call sbmain
        call sbmain2
        ]]></synthesize>
      </dossier_text>
    </dossier>


So you could use that to create a new dossier that called a different procedure that was a copy of sbmain2, and you'd choose the different version at the top of the statblock window, in the "Print What?" section.



The problem would be that if we make changes to sbmain2 in future updates, your version won't have those.
 
Back
Top