FORUM ARCHIVED

So I got inspired enough to create a mod in about an hour and it crashes

Discussion in 'Modding' started by Aegho, May 8, 2012.

  1. Aegho

    Aegho Member

    I wrote an entire skill mod in about an hour(the inspiration was with me), however it seems to crash the game, and since I didn't test it until I wrote the whole thing, I'm not sure where to start the debugging. Anyone find any obvious errors in these?

    Code:
    <skillDB>
     
    <skill name="Circus Freak" id="412" type="rogue" description="Unlike some, you ran away from the circus, instead of to it.">
      <art icon="skills/skill_deadshot.png"/>
       <loadout type="armour" subtype="Plastic Shoes" always="1" />
       <loadout type="armour" subtype="Pleather Armour" always="1" />
      </skill>
     
    <ability name="Circus Freak" icon="skills/skill_deadshot.png" skill="412" startSkill="1">
      <description text="Unlike some, you ran away from the circus, instead of to it."/>
      </ability>
     
    <ability name="Person Vault" icon="skills/spells/spell_air4_64.png" skill="412" level="0">
      <description text="It's like polevaulting, but with people. You give them a good whack too for good measure."/>
      <secondarybuff id="6" amount="4"/> <!-- dodge -->
      <spell name="Whack"/>
      </ability>
     
    <ability name="Clown Combat" icon="skills/wizard/spell_white6_64.png" skill="412" level="1">
      <description text="You've learned a bunch of combat tricks from the circus clowns."/>
      <secondarybuff id="2" amount="2"/> <!-- melee power -->
      <targetHitEffectBuff percentage="50" name="Clown Combat" />
      <triggerondodge percentage="30" name="Clown Combat" />
      <blockBuff percentage="20" name="Clown Combat" />
      </ability>
     
    <ability name="Fire Dancing" icon="skills/wizard/spell_fire5_64.png" skill="412" level="2">
      <description text="The fire dancer taught you a thing or two."/>
      <spell name="Fire Dancing"/>
      <resistbuff conflagratory="1" />
      <primarybuff id="2" amount="2"/> <!-- nimbleness -->
      </ability>
     
    <ability name="Wheel of Daggers" icon="skills/dual_pitcher64.png" skill="412" level="3">
      <spell name="Ready Knives"/>
      <description text="You've Learned the art of knife throwing, you don't think too much of where the knives come from."/>
      <secondarybuff id="3" amount="2"/> <!-- caddishness -->
      <resistbuff slashing="1" />
      </ability>
     
    <ability name="Human Cannonball" icon="skills/spells/montresors_wall64.png" skill="412" level="4">
      <spell name="Human Cannonball"/>
      <description text="You fly through the air, no safety net in here though. Don't ask where the cannon came from."/>
      <damagebuff aetherial="3" />
      <secondarybuff id="10" amount="1"/> <!-- armour -->
      <secondarybuff id="13" amount="2"/> <!-- health regent -->
      <primarybuff id="4" amount="5"/> <!-- stubborness -->
      </ability>
     
    </skillDB>
    Code:
    <spellDB>
     
    <!-- Called upon effects -->
     
    <spell name="Up and Over" type="template" templateID="31" anchored="1" icon="skills/rogue/skill_lockpicking2_32.png" >
       <description text="Go over their heads."/>
       <effect type="teleport" />
       </spell>
     
    <spell name="Acid Flower Spray" type="target" icon="skills/warrior/macery2_32.png" >
       <description text="Acid pain."/>
       <effect type="damage" acidic="2" acidicF="0.1" />
       </spell>
     
    <spell name="Custard Pie" type="target" icon="skills/warrior/macery2_32.png" >
       <description text="Pie to the face."/>
       <effect type="damage" existential="2" existentialF="0.1" />
       <effect type="blind" amount="2" />
       </spell>
     
    <spell name="Clown Kick" type="target" icon="skills/warrior/macery2_32.png" >
       <description text="Clown shoe kick."/>
       <effect type="damage" crushing="2" crushingF="0.1" />
       <effect type="knock" amount="2" />
       </spell>
     
    <spell name="Clown Combat" type="target" icon="skills/rogue/leap64.png" wand="0">
       <effect type="triggerfromlist">
    <option name="Acid Flower Spray" />
    <option name="Custard Pie" />
    <option name="Clown Kick" />
       </effect>
       </spell>
     
    <spell name="You're a projectile" type="missilebeam" icon="skills/spells/montresors_wall32.png" >
       <description text="Flying clown alert." />
       <effect type="knock" amount="5" />
       <effect type="damage" crushing="15" crushingF="0.5" primaryScale="0" />
       </spell>
     
    <spell name="Rough Landing" type="self" icon="skills/warrior/macery2_32.png" >
       <description text="Ouch."/>
       <effect type="damage" crushing="10" crushingF="0.1" primaryScale="0" />
       </spell>
     
    <!-- Activated Abilities -->
     
    <spell name="Whack" type="template" templateID="30" anchored="1" attack="1" downtime="4" icon="skills/wizard/spell_air4_32.png" wand="0">
       <effect type="trigger" spell="Up and Over" after="1" />
       <description text="Hit someone while you vault them." />
       </spell>
     
    <spell name="Fire Dancing" type="self" downtime="20" icon="skills/wizard/spell_fire5_32.png" >
       <description text="Sets fire to your weapons."/>
       <buff useTimer="1" turns="10" icon="skills/wizard/spell_fire5_64.png" smallicon="skills/spells/magic_steel32.png">
    <anim sprite="sprites/sfx/impactA/impactA" frames="6" framerate="60"  sfx="blast" centerEffect="0"/>
    <damagebuff conflagratory="3" />
    <secondarybuff id="18" amount="3" /> <!-- sight -->
    <secondarybuff id="17" amount="1" /> <!-- trap sight -->
    <secondarybuff id="5" amount="5" /> <!-- haywire -->
    <secondarybuff id="12" amount="-20" /> <!-- sneakiness -->
       </buff>
       </spell>
     
    <spell name="Ready Knives" type="self" downtime="40" icon="skills/dual_pitcher32.png" >
       <description text="You ready your throwing knives."/>
       <buff useTimer="1" turns="5" icon="skills/dual_pitcher64.png" smallicon="skills/spells/magic_steel32.png">
    <damagebuff piercing="3" />
    <secondarybuff id="18" amount="1"/> <!-- sight -->
       </buff>
       <effect type="spawn" itemname="Throwing Knife" amount="5"/>
       </spell>
     
    <spell name="Human Cannonball" type="targetfloor" downtime="50" icon="skills/spells/montresors_wall32.png" >
       <description text="You enter your cannon and go for a flight without safety net."/>
       <effect type="trigger" spell="You're a projectile" />
       <effect type="teleport" after="1" />
       <effect type="trigger" spell="Rough landing" after="1" />
       </spell>
     
    </spellDB>
     
  2. NaiDriftlin

    NaiDriftlin Member



    You have an open buff tag in the Fire Dancing Spell in the spellDb with no closing tag, causing a close mismatch in the spell.

    That's the only obvious XML based error I could pick up.

    My methodology for debugging(I do programming outside of XML, so I'll trim it up for your situation) is fairly straightforward.

    Have a program check your tagging/parse the document. A browser and parse XML and tell you any errors. Notepad++(A free, GNU licensed text editor designed for/by progammers) can help you pick out inconsistencies.

    Next: Find out what DOES work. Open a second document and past the code into it, start at the top of both documents, and work your way down, adding segments of code bit by bit. The first time your game crashes, check what code you just added and figure out what's wrong with it.
     
  3. Aegho

    Aegho Member

    I already found that one actually, edited the file, and it still crashes.
     
  4. NaiDriftlin

    NaiDriftlin Member

    When does it crash? Right when the game starts? When you use a skill? When you pick a character skill?
     
  5. Aegho

    Aegho Member

    After typing in the name of your character and pressing enter.
     
  6. NaiDriftlin

    NaiDriftlin Member



    Immediately following the enter? Okay, so as the game starts, but after selection. Do you get an error message associated with the crash?
     
  7. Aegho

    Aegho Member

    Immediately following, and I just get the usual windows a program has crashed message.
     
  8. NaiDriftlin

    NaiDriftlin Member

    Let me load it up and see what I can find.

    When you test this, are you running other mods, or just your own?
     
  9. Aegho

    Aegho Member

    Tried both ways, crashes in either case.
     
  10. NaiDriftlin

    NaiDriftlin Member

    Actually, I think I found it. Your skill technically doesn't have a starting skill. This would explain why it crashes immediately populating the skills on your character.

    Code:
    <skill name="Circus Freak" id="412" type="rogue" description="Unlike some, you ran away from the circus, instead of to it.">
    And

    Code:
    <ability name="Circus Freak" icon="skills/skill_deadshot.png" skill="448" startSkill="1">

    The skill numbers don't match up. Try correcting the skill=448 to 412 and see how it works.

    Edit: I went full retard and said startSkill, not Skill. Changed my text to reflect that.
     
  11. Aegho

    Aegho Member

    Well I'll be damned, I missed that, thought I'd changed all those(I used another mod I'm working on as a template).

    But yeah still crashes, gnaaah.
     
  12. NaiDriftlin

    NaiDriftlin Member


    In the same place?
     
  13. Aegho

    Aegho Member

    Yup.
     
  14. NaiDriftlin

    NaiDriftlin Member

    Code:
    <cfreakSkills>
    Some XML readers don't accept custom tags. Try stripping out this and its closing statement on line 58(and its sister lines in the spell database and use comments instead.

    Code:
     <!-- Comment Example --> 
    Use <!-- to open a comment line, and use --> to close it.
     
  15. Aegho

    Aegho Member

    Weird, all other skills have something like that, including my other mods that do not crash... but I guess I'll try anything.

    Incidentally I found another bug and fixed it without of course fixing the crashing (the fire dancer skill didn't call on the spell).
     
  16. Aegho

    Aegho Member

    ... and it still crashes after taking out those custom tags. Same place.
     
  17. NaiDriftlin

    NaiDriftlin Member

    Do you have a backup copy of your code thus far?
     
  18. Aegho

    Aegho Member

    I just edited the original post with the most recent version.
     
  19. NaiDriftlin

    NaiDriftlin Member

    Okay:

    Making sure you have backup to draw from/revert to, strip out all code except for the main skill and the startSkill. Move SpellDB out of the mod directory and load it. You're probably going to need to go tag segment by tag segment to find that bug.
     
  20. NaiDriftlin

    NaiDriftlin Member

    Example:

    skillDB.xml contains:


    Code:
    <skill name="Circus Freak" id="412" type="rogue" description="Unlike some, you ran away from the circus, instead of to it.">
      <art icon="skills/skill_deadshot.png"/>
      <loadout type="armour" subtype="Plastic Shoes" always="1" />
      <loadout type="armour" subtype="Pleather Armour" always="1" />
      </skill>
     
    <ability name="Circus Freak" icon="skills/skill_deadshot.png" skill="412" startSkill="1">
      <description text="Unlike some, you ran away from the circus, instead of to it."/>
      </ability>
    
    And that's it.

    You SHOULD be able to start the game, select the skill, and get into the game with just that going.

    Edit:

    Make sure you have <skilldb> and </skilldb>, naturally.