XML Output Inconsistancies

3 views
Skip to first unread message

David Berg

unread,
Jul 15, 2010, 5:29:12 PM7/15/10
to iplay4e-api
This thread can be used to discuss any inconsistant XML generation
seen in iplay4e and can serve as a report mechanism to allow Andrew to
resolve such things in future revisions.

David Berg

unread,
Jul 15, 2010, 6:29:50 PM7/15/10
to iplay4e-api
At Andrew's request, I am posting this email so everyone is aware of
this issue.

On Thu, Jul 15, 2010 at 3:42 PM, david berg wrote:
>
> Andrew,
>
> http://iplay4e.appspot.com/view?key=agdpcGxheTRlchMLEgtDaGFyYWN0ZXJWMhjlpCYM
>
> In looking at some of the iplay4e XML I saw the following
>
> <Condition name="+3d8 to damage once per round (Hunter's Quarry) - ?"/>
> <Condition name="+1 to attack rolls if none of your allies are closer to the
> target - Prime Shot"/>
>
> I am trying to code a conversion/sub parser, but I am uncertain of which way
> your parser handles the condition naming. In the 1st one it appears that
> the condition name is encapsulated inside "()". The second appears as
> though the condition name follows the " - " Is there a primary format that
> this follows or is it likely that I will come across this type of variation
> in some of the other powers? I didn't know if this was a compendium thing
> or not so I thought I'd ask if you know of any other variations that I should watch
> and should code for?
>
> Thanks,
> Dave Berg
>
>

Looks like an issue in my parser, and inconsistency in WotC's
presentation. Here are the chunks I'm parsing:

+1 to attack rolls if none of your allies are closer to the target -
Prime Shot.

+1d6 to damage once per round (Hunter&apos;s Quarry)

Here's the code I'm parsing that with:

try:
conditionStr, factorName = '
'.join(conditionWords[1:]).split(' - ')
except ValueError:
conditionStr, factorName = '
'.join(conditionWords[1:]), '?'

So I'm trying to get the factor "name", such as Prime Shot, from what
comes after the dash in their XML. On failure, I use "?" to mean
"hell if I know". I should probably also be testing for their
Hunter's Quarry format, where the "name" is in parentheses.

Later, I turn back around and join the condition description and name
around the dash - leading to - ? in some cases.

To be honest, I'm not even sure why I'm parsing it out. Perhaps I
initially intended Condition nodes to have both name and description
attributes.

If you're consuming my XML, I'd recommend using what comes after the
dash as the name - and then bug me regularly to fix my parser for the
Quarry situation ;->

Cheers,
Andrew

P.S. This would have been a good post on the iplay4e-api google group.
I didn't copy them on the response because it would have been rude,
but if you don't mind, forward it along there. The info may be useful
to others.

Andrew Reutter

unread,
Jul 15, 2010, 7:00:30 PM7/15/10
to iplay...@googlegroups.com
I see two action items for myself here:

- Make my parser better handle the Hunter's Quarry format in the dnd4e
file, so I don't end up with "?" as the "name" of the condition.

- Change my ip4xml format to present the name and the description
separately, in a backwards-compatible way. Right now, it's like this:

<Condition name="add a bunch to every roll - Mega Power" />

The backwards compatible yet more flexible output should be:

<Condition name="add a bunch to every roll - Mega Power"
label="Mega Power" description="add a bunch to every roll" />

Dave, would that suit your needs? Anyone else have an opinion?

Cheers,
Andrew

David Berg

unread,
Jul 16, 2010, 9:59:38 AM7/16/10
to iplay4e-api


>     <Condition name="add a bunch to every roll - Mega Power"
>       label="Mega Power" description="add a bunch to every roll" />
>
> Dave, would that suit your needs?  Anyone else have an opinion?

Yes, I will be able to reparse it as needed.
Don't go to too much trouble with it. I was just looking for a little
clarification on what to expect as a standard. You are doing an
awesome job given the various inconsistencies in the Character Builder
XML. I think your plan for backward compatability is a good one.

Thanks again,
Dave

FYI, my parser will output something like this:

+1 to attack rolls if none of your allies are closer to the target -
Prime Shot.

<Condition name="Prime Shot" description="+1 to attack rolls if none
of your allies are closer to the target" type="attackbonus" value="1" /
>

3d8+10 to damage once per round (Hunter&apos;s Quarry) - ?

<Condition name="Hunter&apos;s Quarry" description="3d8+10 to damage
once per round" type="damagebonus" value="3d8+10" />


Andrew Reutter

unread,
Jul 16, 2010, 10:36:33 AM7/16/10
to iplay...@googlegroups.com
Okay, I'm curious. You're processing my XML and producing a
"downstream" XML format?

David Berg

unread,
Jul 17, 2010, 7:30:58 PM7/17/10
to iplay4e-api

Another question

Saw this in XML I was testing

Ref: http://iplay4e.appspot.com/view?key=agdpcGxheTRlchMLEgtDaGFyYWN0ZXJWMhjlpCYM


Iplay4e XML

<Power actiontype="Immediate Interrupt" display-
class="USAGE_AdamantRecovery" name="Adamant Recovery"
powerusage="Daily" url="http://www.wizards.com/dndinsider/compendium/
power.aspx?id=4443" use-
script="CHARACTERagdpcGxheTRlchMLEgtDaGFyYWN0ZXJWMhjlpCYM.triggerVariable('USAGE_AdamantRecovery',
{isBoolean:1});">
<Weapon attackstat="Unknown" defense="Unknown" name="Unarmed"
weaponurl="">
<AttackBonus dice-class="dice1d20plus11Attack" value="11">
<Factor abbreviation="1/2 Level" modifier="+11" name="Half
Level"/>
</AttackBonus>
<Damage dice-class="diceDamage" value=""/>
</Weapon>
</Power>


CB XML

<Power name="Adamant Recovery">
<specific name="Power Usage"> Daily </specific>
<specific name="Action Type"> Immediate Interrupt </
specific>
<Weapon name="Unarmed">
<AttackBonus> 11 </AttackBonus>
<Damage> </Damage>
<AttackStat> Unknown </AttackStat>
<Defense> Unknown </Defense>
<HitComponents> +11 half your level.

</HitComponents>
<DamageComponents>
</DamageComponents>
</Weapon>
</Power>

Looking at the DDI/Compendium link it appears this is not an attack.
As a result I have a few questions.

1. Is this a CB or Compendium error?
2. Has anyone noticed this type of issue before? (Is this a one time
thing or is it recurring problem?)
3. Does anyone know if testing for powers with attack info, but no
corresponding damage component, and re-assigning them as non weapon
based powers would cause any issues elsewhere? (Do attacks with attack
bonuses exist that don't do damage?)

Andrew Reutter

unread,
Jul 21, 2010, 12:37:09 PM7/21/10
to iplay...@googlegroups.com
On Sat, Jul 17, 2010 at 6:30 PM, David Berg <dber...@cybergtech.com> wrote:
>
> Another question
>
> Saw this in XML I was testing
>
<snip>

|>
> Looking at the DDI/Compendium link it appears this is not an attack.
> As a result I have a few questions.
>
> 1. Is this a CB or Compendium error?

CB. That stuff comes almost straight from the dnd4e file.

> 2. Has anyone noticed this type of issue before? (Is this a one time
> thing or is it recurring problem?)

I see it occasionally; wish there was something to be done about it.
Report it to WotC, I suppose...

> 3. Does anyone know if testing for powers with attack info, but no
> corresponding damage component, and re-assigning them as non weapon
> based powers would cause any issues elsewhere? (Do attacks with attack
> bonuses exist that don't do damage?)

I wouldn't take that approach; even if no such powers currently exist,
nothing prevents them from existing in the future. Probably better to
pass it through and campaign to have the source data corrected.

Cheers,
Andrew

chad

unread,
Jul 21, 2010, 12:49:33 PM7/21/10
to iplay...@googlegroups.com
I skimmed this the first time, since I'm not at the point of dealing with XML in
my (not-yet-existant) app yet, but the reply caught my eye, so:

On Jul 17, 2010, at 4:30 PM, David Berg wrote:
> 3. Does anyone know if testing for powers with attack info, but no
> corresponding damage component, and re-assigning them as non weapon
> based powers would cause any issues elsewhere? (Do attacks with attack
> bonuses exist that don't do damage?)


Absolutely. The canonical example I'll suggest is `Astral Seal'.

Hope that helps,
*Chad

David Berg

unread,
Jul 21, 2010, 2:10:44 PM7/21/10
to iplay4e-api
Thanks guys,

Good advice and example.

Dave

David Berg

unread,
Aug 23, 2010, 1:04:22 AM8/23/10
to iplay4e-api
Came across a "The+0" damage entry. CB is the source. Subsequently,
replicated here as well. Any idea if this has any sort of meaning
gloabally or is it simply an CB error?

iplay file @ http://iplay4e.appspot.com/characters/agdpcGxheTRlchQLEgtDaGFyYWN0ZXJWMhjdxosCDA

from the dnd4e file
<Power name="Primordial Slime" >
<specific name="Power Usage" > Daily </specific>
<specific name="Action Type" > Standard action </specific>
<Weapon name="Staff of Gathering +6" >
<RulesElement name="Staff of Gathering +6" type="Magic
Item" internal-id="ID_FMP_MAGIC_ITEM_2969" url="http://www.wizards.com/
dndinsider/compendium/item.aspx?fid=2969&amp;ftype=1"
charelem="149043f8" legality="rules-legal" />
<AttackBonus> 29 </AttackBonus>
<Damage> The+0 </Damage>
<AttackStat> Charisma </AttackStat>
<Defense> Fortitude </Defense>
<HitComponents> +8 Charisma modifier.
+15 half your level.
+6 enhancement bonus.
+6 Enhancement bonus - Inherent Bonuses [Doesn&apos;t Stack]

</HitComponents>
<DamageComponents>
</DamageComponents>
</Weapon>
... </Power>
Reply all
Reply to author
Forward
0 new messages