gimmegimme220 / cbloader

Automatically exported from code.google.com/p/cbloader
0 stars 0 forks source link

AppendNodes doesn't pick up variables from earlier in RulesElement #23

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Have a RulesElement in one .part with code something like this:
<RulesElement name="Awesome Bonus" type="Internal" 
internal-id="ID_INTERNAL_INTERNAL_AWESOME_BONUS" source="SabreCat" >
   <specific name="_SupportsID"> ID_ESJ_FEAT_7776 </specific>
   <rules>
      <statadd name="Awesome Bonus" value="+1" />
      <statadd name="Awesome Bonus" value="+1" requires="Paragon Tier" />
      <statadd name="Awesome Bonus" value="+1" requires="Epic Tier" />
      <statadd name="Fisticuffs:damage" value="+Awesome Bonus" type="Feat" requires="Weapon Proficiency (Fisticuffs) proficiency" />
   </rules>
</RulesElement>

2. In another .part, use AppendNodes like so:
<AppendNodes name="Awesome Bonus" type="Internal" 
internal-id="ID_INTERNAL_INTERNAL_AWESOME_BONUS" source="SabreCat" >
   <rules>
      <statadd name="Pugilism:damage" value="+Awesome Bonus" type="Feat" requires="Weapon Proficiency (Pugilism) proficiency" />
   </rules>
</AppendNodes>

3. Merge your file.

What is the expected output? What do you see instead?
  I would expect the append to follow the path of the original node before adding its components, picking up the value of "Awesome Bonus" along the way. Instead, CBloader throws an error saying that the value of "value" cannot be null.

What version of the product are you using? On what operating system?
  1.1.4, Windows 7

Original issue reported on code.google.com by sabre...@gmail.com on 15 Dec 2010 at 12:50

GoogleCodeExporter commented 8 years ago
Tell me, Does the Second part come before the first part alphabetically?

IE: RulesElement.part, AppendNodes.part

If so, it is processing the AppendNodes first, seeing that there is no such 
element yet, and ignoring it, then processing the RulesElement.

For now the easiest way to fix this is to put a 'Z' at the start of any file 
which uses AppendNodes. I was already working on a preemptive fix for this bug 
though ;)

Original comment by YeOldeSt...@gmail.com on 15 Dec 2010 at 11:23

GoogleCodeExporter commented 8 years ago
The RulesElement being modified is WotC content from the .main file. Shouldn't 
that always come first for these purposes?

Original comment by sabre...@gmail.com on 16 Dec 2010 at 12:20

GoogleCodeExporter commented 8 years ago
(Now that I look at it, I guess my initial writeup of the issue was misleading 
on that count. Got overzealous in scrubbing out the copyrighted content and 
ended up calling .main a .part...)

Original comment by sabre...@gmail.com on 16 Dec 2010 at 12:22

GoogleCodeExporter commented 8 years ago
In that case, can you post the element in question?

As it's an AppendNodes, it should be fine to post the node in it's entirety.

Original comment by YeOldeSt...@gmail.com on 16 Dec 2010 at 12:35

GoogleCodeExporter commented 8 years ago
Hmm, then again, maybe that's not the cause of the problem. I commented it out 
and my .part file is still throwing the error. Never mind this for now, I'll 
investigate further and see if I can isolate the issue better.

Original comment by sabre...@gmail.com on 16 Dec 2010 at 5:00

GoogleCodeExporter commented 8 years ago
Okay, it looks like I get the error whenever I use AppendNodes at all, so maybe 
this is more a question for the wiki. Here's an example...

<AppendNodes name="Implement Proficiency (Proficient Weapons)" 
type="Proficiency" 
internal-id="ID_INTERNAL_PROFICIENCY_IMPLEMENT_PROFICIENCY_(PROFICIENT_WEAPONS)"
 source="Core" >
   <rules>
      <grant name="ID_INTERNAL_PROFICIENCY_IMPLEMENT_PROFICIENCY_(TIKBALANG_HOOVES)" type="Proficiency" requires="Weapon Proficiency (Tikbalang Hooves)" />
   </rules>
</AppendNodes>

Original comment by sabre...@gmail.com on 16 Dec 2010 at 5:29

GoogleCodeExporter commented 8 years ago
I think I have reproduced this error.  But only once.

Can you look at the element in the combined part, and tell me if it looks wrong?

(has two rules elements, hasn't changed, has duplicates, etc.  Other than that, 
I'll keep poking at it, and try to get the error again.

Original comment by YeOldeSt...@gmail.com on 16 Dec 2010 at 2:00

GoogleCodeExporter commented 8 years ago
The element appears to be untouched.

Original comment by sabre...@gmail.com on 17 Dec 2010 at 1:51

GoogleCodeExporter commented 8 years ago
Found the error.  I made an assumption that everything had an internal-id 
attribute. Pushing a bugfix now.

Original comment by YeOldeSt...@gmail.com on 17 Dec 2010 at 3:15

GoogleCodeExporter commented 8 years ago
Cool! I'm puzzled, though--in what way doesn't the above have an internal-id?

Original comment by sabre...@gmail.com on 17 Dec 2010 at 3:50

GoogleCodeExporter commented 8 years ago
<grant name="ID_INTERNAL_PROFICIENCY_IMPLEMENT_PROFICIENCY_(TIKBALANG_HOOVES)" 
type="Proficiency" requires="Weapon Proficiency (Tikbalang Hooves)" /> has a 
name, a type, but no internal-id.  That's where it was erroring.

Original comment by YeOldeSt...@gmail.com on 17 Dec 2010 at 4:30