Jump to content

Compound powers in exports


eepjr24

Recommended Posts

When exporting compound powers, how do you associate all the powers in the compound power to each other? I can detect that a power is part of a compound power using <!--IF_COMPOUND_POWER> and split them with <!--COMPONENT_POWERS> but I am not seeing a way to determine if a give component is part of a given compound power. This is a parsing problem especially when more than one compound power can appear on a sheet. Am I just missing a tag somewhere?

 

- E

Link to comment
Share on other sites

I have 2 compound powers next to each other on the character sheet. One has 2 powers, the other has 3 powers. I loop twice for the first one and 3 times for the second one. That results in 5 lines in the export. Outside of creating some type of physical break in the output is there any internal value I can add to the 5 lines that will let me know the first 2 are one power and the next three are another power? The UID's are different for each line but there must be something associating them or HD would not know that they were a single compound power.

 

To reference the HDC directly, I am getting the below. I am able to access the ID's "1632573853008" and "1632573950664", but I would like to have the "1632573659675" ID in both of them to associate them. Is that available?

 

    <POWER XMLID="COMPOUNDPOWER" ID="1632573659675" BASECOST="0.0" LEVELS="0" ALIAS="Compound Power" POSITION="31" MULTIPLIER="1.0" GRAPHIC="Burst" COLOR="255 255 255" SFX="Default" SHOW_ACTIVE_COST="Yes" INCLUDE_NOTES_IN_PRINTOUT="Yes" NAME="Tellerium Decay Battery" QUANTITY="1" AFFECTS_PRIMARY="No" AFFECTS_TOTAL="Yes">
      <NOTES>Recovery is proportion to End use per Phase. 10 is maximum usage, adds 0 REC. 0 End = 12 Rec. 5 End = 6 Rec. etc.Total is averaged so take (End Used / 50 * 12) + 8 to get actual REC. Player will handle this tracking.</NOTES>
      <POWER XMLID="ENDURANCERESERVE" ID="1632573853008" BASECOST="0.0" LEVELS="80" ALIAS="Endurance Reserve" POSITION="0" MULTIPLIER="1.0" GRAPHIC="rads" COLOR="0 255 0" SFX="Radiation" SHOW_ACTIVE_COST="Yes" INCLUDE_NOTES_IN_PRINTOUT="Yes" NAME="Main Battery" QUANTITY="1" AFFECTS_PRIMARY="No" AFFECTS_TOTAL="Yes">
        <NOTES />
        <MODIFIER XMLID="FOCUS" ID="1632573919091" BASECOST="-0.25" LEVELS="0" ALIAS="Focus" POSITION="-1" MULTIPLIER="1.0" GRAPHIC="Burst" COLOR="255 255 255" SFX="Default" SHOW_ACTIVE_COST="Yes" OPTION="IIF" OPTIONID="IIF" OPTION_ALIAS="IIF" INCLUDE_NOTES_IN_PRINTOUT="Yes" NAME="" COMMENTS="" PRIVATE="No" FORCEALLOW="No">
          <NOTES />
        </MODIFIER>
        <POWER XMLID="ENDURANCERESERVEREC" ID="1632573866922" BASECOST="0.0" LEVELS="8" ALIAS="Recovery" POSITION="-1" MULTIPLIER="1.0" GRAPHIC="rads" COLOR="0 255 0" SFX="Radiation" SHOW_ACTIVE_COST="Yes" INCLUDE_NOTES_IN_PRINTOUT="Yes" NAME="" QUANTITY="1" AFFECTS_PRIMARY="No" AFFECTS_TOTAL="Yes">
          <NOTES />
        </POWER>
      </POWER>
      <POWER XMLID="ENDURANCERESERVE" ID="1632573950664" BASECOST="0.0" LEVELS="0" ALIAS="Endurance Reserve" POSITION="1" MULTIPLIER="1.0" GRAPHIC="Burst" COLOR="255 255 255" SFX="Default" SHOW_ACTIVE_COST="Yes" INCLUDE_NOTES_IN_PRINTOUT="Yes" NAME="Scaled Recovery Unit" QUANTITY="1" AFFECTS_PRIMARY="No" AFFECTS_TOTAL="Yes">
        <NOTES>End use for the suit is maxed at 10</NOTES>
        <POWER XMLID="ENDURANCERESERVEREC" ID="1632791389809" BASECOST="0.0" LEVELS="12" ALIAS="Recovery" POSITION="-1" MULTIPLIER="1.0" GRAPHIC="Burst" COLOR="255 255 255" SFX="Default" SHOW_ACTIVE_COST="Yes" INCLUDE_NOTES_IN_PRINTOUT="Yes" NAME="Harmonium Recharge Cycler" QUANTITY="1" AFFECTS_PRIMARY="No" AFFECTS_TOTAL="Yes">
          <NOTES>The Harmonium Recharge Cycler kicks in whenever a portion of the main suit powers are not being utilized at full. The player will keep track of the unused amount of reserve capacity for each phase, average at the end of the turn and then apply that as a percentage to determine the amount of REC. So if the average usage was 80%, he will get (.2 * 12 = 2.4) two additional REC that turn.</NOTES>
          <MODIFIER XMLID="FOCUS" ID="1632791389787" BASECOST="-0.25" LEVELS="0" ALIAS="Focus" POSITION="-1" MULTIPLIER="1.0" GRAPHIC="Burst" COLOR="255 255 255" SFX="Default" SHOW_ACTIVE_COST="Yes" OPTION="IIF" OPTIONID="IIF" OPTION_ALIAS="IIF" INCLUDE_NOTES_IN_PRINTOUT="Yes" NAME="" COMMENTS="" PRIVATE="No" FORCEALLOW="No">
            <NOTES />
          </MODIFIER>
          <MODIFIER XMLID="LIMITEDRECOVERY" ID="1632791389789" BASECOST="-1.0" LEVELS="0" ALIAS="Limited Recovery: Proportional to Reserve Usage" POSITION="-1" MULTIPLIER="1.0" GRAPHIC="Burst" COLOR="255 255 255" SFX="Default" SHOW_ACTIVE_COST="Yes" INCLUDE_NOTES_IN_PRINTOUT="Yes" NAME="" COMMENTS="" PRIVATE="No" FORCEALLOW="No">
            <NOTES />
          </MODIFIER>
        </POWER>
      </POWER>
    </POWER>

 

- E

Link to comment
Share on other sites

You can specify whatever you want -- it's no different from any other Power export.  Each Compound Power is handled independently, regardless of its position in the Powers list.  You can add any separator you want between the Compound Powers (no different from a separator between any other Powers) or between the individual component Powers.   When you're overriding the default behavior of the application (e.g. replacing/redefining the way Compound Powers are exported) the onus is on you to create an export format that will make sense.  If the components of multiple Compound Powers are running together in your export format, they're doing that based on your own design.

As for the ID values, those are largely intended for use within HD itself and are not typically part of an export. While there's nothing preventing you from using them, you're not going to find too much beyond basic access in the export process.  The components of a Compound Power will have access to their own, but accessing the ID of their parent (the Compound Power itself) would require programmatic access (i.e. not part of an export).

Link to comment
Share on other sites

13 minutes ago, HeroGM said:

If you may, put up what you want the export to look like. That may help in figuring.out what you want.

Sure, nothing proprietary to it that I know of. To add some context, this is doing a JSON export for import into Roll20 to fill in the Character Sheet written by Sir Argo.

 

"powers":[<!--IFPOWERS--><!--POWERS--><!--IS_NOT_SEPARATOR--><!--IF_NOT_COMPOUND_POWER-->
	{"name":"<!--IFNAME--><!--NAME--><!--/IFNAME-->","framework":"<!--IS_MP-->MP<!--/IS_MP--><!--IS_VPP-->VPP<!--/IS_VPP-->","prefix":"<!--IS_LIST_ITEM--><!--LISTPREFIX--><!--/IS_LIST_ITEM-->","desc":"<!--POWER_TEXT-->","uid":<!--UNIQUEID-->,"type":"<!--DISPLAY-->","damage":"<!--POWER_DMG-->","range":"<!--POWER_RANGE-->","input":"<!--INPUT--><!--OPTION-->","level":"<!--LEVELS-->","end":"<!--POWER_END-->","active":"<!--ACTIVE_COST-->","base":"<!--BASE_COST-->","real":"<!--POWER_COST-->","XMLID":"<!--XMLID-->","strMod":"<!--POWER_DMG-->","class":{"attack":<!--IF_ATTACK-->true<!--/IF_ATTACK-->,"mental":<!--IF_MENTAL-->true<!--/IF_MENTAL-->,"adjustment":<!--IF_ADJUSTMENT-->true<!--/IF_ADJUSTMENT-->,"bodyaffecting":<!--IF_BODYAFFECTING-->true<!--/IF_BODYAFFECTING-->,"sensory":<!--IF_SENSORY-->true<!--/IF_SENSORY-->,"move":<!--IF_MOVEMENT-->true<!--/IF_MOVEMENT-->,"defense":<!--IF_DEFENSE-->true<!--/IF_DEFENSE-->,"compound":false,"senseaffecting":<!--IF_SENSEAFFECTING-->true<!--/IF_SENSEAFFECTING-->,"special":<!--IF_SPECIAL-->true<!--/IF_SPECIAL-->},"modifiers":[<!--MODIFIERS-->{"value":"<!--MODIFIER_VALUE-->","name":"<!--IFNAME--><!--NAME--><!--/IFNAME-->","uid":<!--UNIQUEID-->,"type":"<!--DISPLAY-->","damage":"<!--POWER_DMG-->","range":"<!--POWER_RANGE-->","input":"<!--INPUT--><!--OPTION-->","level":"<!--LEVELS-->"},<!--/MODIFIERS-->],"adders":[<!--ADDERS-->{"name":"<!--IFNAME--><!--NAME--><!--/IFNAME-->","uid":<!--UNIQUEID-->,"type":"<!--DISPLAY-->","damage":"<!--POWER_DMG-->","range":"<!--POWER_RANGE-->","input":"<!--INPUT--><!--OPTION-->","level":"<!--LEVELS-->"},<!--/ADDERS-->]},<!--/IF_NOT_COMPOUND_POWER--><!--IF_COMPOUND_POWER--><!--COMPONENT_POWERS-->
	{"name":"<!--IFNAME--><!--NAME--><!--/IFNAME-->","framework":"<!--IS_MP-->MP<!--/IS_MP--><!--IS_VPP-->VPP<!--/IS_VPP-->","prefix":"<!--IS_LIST_ITEM--><!--LISTPREFIX--><!--/IS_LIST_ITEM-->","desc":"<!--POWER_TEXT-->","uid":<!--UNIQUEID-->,"type":"<!--DISPLAY-->","damage":"<!--POWER_DMG-->","range":"<!--POWER_RANGE-->","input":"<!--INPUT--><!--OPTION-->","level":"<!--LEVELS-->","end":"<!--POWER_END-->","active":"<!--ACTIVE_COST-->","base":"<!--BASE_COST-->","real":"<!--POWER_COST-->","XMLID":"<!--XMLID-->","strMod":"<!--POWER_DMG-->","class":{"attack":<!--IF_ATTACK-->true<!--/IF_ATTACK-->,"mental":<!--IF_MENTAL-->true<!--/IF_MENTAL-->,"adjustment":<!--IF_ADJUSTMENT-->true<!--/IF_ADJUSTMENT-->,"bodyaffecting":<!--IF_BODYAFFECTING-->true<!--/IF_BODYAFFECTING-->,"sensory":<!--IF_SENSORY-->true<!--/IF_SENSORY-->,"move":<!--IF_MOVEMENT-->true<!--/IF_MOVEMENT-->,"defense":<!--IF_DEFENSE-->true<!--/IF_DEFENSE-->,"compound":true,"senseaffecting":<!--IF_SENSEAFFECTING-->true<!--/IF_SENSEAFFECTING-->,"special":<!--IF_SPECIAL-->true<!--/IF_SPECIAL-->},"modifiers":[<!--MODIFIERS-->{"value":"<!--MODIFIER_VALUE-->","name":"<!--IFNAME--><!--NAME--><!--/IFNAME-->","uid":<!--UNIQUEID-->,"type":"<!--DISPLAY-->","damage":"<!--POWER_DMG-->","range":"<!--POWER_RANGE-->","input":"<!--INPUT--><!--OPTION-->","level":"<!--LEVELS-->"},<!--/MODIFIERS-->],"adders":[<!--ADDERS-->{"name":"<!--IFNAME--><!--NAME--><!--/IFNAME-->","uid":<!--UNIQUEID-->,"type":"<!--DISPLAY-->","damage":"<!--POWER_DMG-->","range":"<!--POWER_RANGE-->","input":"<!--INPUT--><!--OPTION-->","level":"<!--LEVELS-->"},<!--/ADDERS-->]},<!--/COMPONENT_POWERS--><!--/IF_COMPOUND_POWER--><!--/IS_NOT_SEPARATOR--><!--/POWERS--><!--/IFPOWERS-->],

 

I am starting to wonder if I should have just skipped exporting at all and just parsed the XML directly, since everything is available there and things appear to be missing in the export. I don't have the time to do that right now, but I'll have to add looking into it for future.

 

- E

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...