Useing the Spell System Reference from the mod wiki

Discussion in 'Modding' started by Themaxtr, Jul 9, 2014.

  1. Themaxtr

    Themaxtr Member

    I am new to modding DOD and want to use some of the things i found in this page (http://dredmod.com/wiki/Spell_System_Reference) of the mod wiki but i cant figure out how to use things like <senseWallsFlag> or <polymorph> this is what i tried I was just throwing things together trying to figure things out.

    <spellDB>
    <spell name="Sonic Scan" type="targetemptyfloor" icon="sprites/11th.png">
    <polymorph name="Batty" >
    <requirements usetimer="18"/>
    <effect type="spawnitematlocation" itemName="Fez" />
    <description text="Test." />
    </spell>
    </spellDB>


    It works if it take out <polymorph name="Batty" > So I'm assuming that I'm not understanding the wiki.
    If anyone can help i would be extremely thankful.
     
  2. Alistaire

    Alistaire Member

    You have to put anything in the <buff> section of the reference, in a <buff> tag.

    <spellDB>
    <spell name="Sonic Scan" type="targetemptyfloor" icon="sprites/11th.png">
    <buff useTimer="1" time="20" stacksize="1" self="1" icon="skills/batty64.png" smallicon="skills/batty32.png">
    <polymorph name="Batty" >
    </buff>
    <requirements usetimer="18"/>
    <effect type="spawnitematlocation" itemName="Fez" />
    <description text="Test." />
    </spell>
    </spellDB>
     
  3. Themaxtr

    Themaxtr Member

    I tried your code and it still did not work it works if i take out <polymorph name="Batty" > but not if i leave it in.
    I modified the code to make it more clear what I am doing.

    <spell name="Sonic Scan" type="self" icon="sprites/11th.png" >
    <buff useTimer="1" time="24" allowstacking="0" stacksize="1" self="1" icon="sprites/11th.png" smallicon="sprites/11th.png">
    <secondarybuff id="0" amount="5"/> <!-- hp -->
    <polymorph name="Batty">
    </buff>
    <description text="This is a test." />
    </spell>


    I am getting this error from my XML editor.

    XML Parsing error at line 7:
    Premature end of data in tab spell line 1


    If i take out <polymorph name="Batty"> i get the heath buff but i don't get the spell at all if i leave it in.
    Thanks for your help.
     
  4. Arron Syaoran

    Arron Syaoran Member

    I tried copying over the "Demon Form" spell as a new spell: "Demon Curse", which the only difference is it's type="target" instead of type="self". The reason why I did so is to have a Trap cast Demon Curse, which polymorphs whatever steps on it, instead of it polymorphing the player when a monster or player steps on it.

    When I did so, game crashed upon load.

    Edit: If I can get Demon Curse Effect to work on both Monsters and Player, I'll probably release a 0.1.7 update to my Android Rogue Mod, which will come before Android Insurrection.
     
  5. Alistaire

    Alistaire Member

    You didn't end the <polymorph> tag;

    <polymorph name='Batty'>
    to
    <polymorph name='Batty'/>

    If you don't already, get a specialized code editor to make it easier to notice these errors. They're very common, and having a syntax highlight in your editor, showing you that you didn't end a tag, is a must.
     
  6. Themaxtr

    Themaxtr Member

    Thanks so much that was it.
    Any editors you could recommend? I have been using a plugin for notepad++ its ok but not amazing and i would love an alternative.
     
  7. Alistaire

    Alistaire Member

    I personally use Programmer's Notepad for any scripting (Lua/XML/PHP), but I'm sure there's specialized XML editors with folder structures and such.

    Turning on syntax highlights for XML in PN, and always adding a few empty lines on the end of the file, means you can see when a tag isn't closed properly. You wouldn't believe how many times that breaks an XML/HTML file.

    The Reference Category on the wiki is nice to keep in a tab when scripting. Especially the Player Statistics page when editing itemDB.xml .

    If you want to mimic an existing item/spell in DoD, you're always free to edit the main game files (which could be at C:\Program Files (x86)\Steam\SteamApps\common\dungeons of dredmor\game) and copy-paste parts of the code into your XML.

    If you're not sure what your error is, the Mod XML Validator can give you more detailed errors than "Something went wrong, closing now.."
    If your mod still doesn't work after doing all of that, I'd ask the forums.
     
  8. Arron Syaoran

    Arron Syaoran Member

    I've been using Dashcode, which comes with Xcode, for my Mac. It highlights everything between quotes in purple, < /> Tags in Red, and Remarks in Green. It doesn't check for missing syntax though.
     
  9. Themaxtr

    Themaxtr Member

    Thanks for all your help i will look into those and see if they help.
     
  10. Themaxtr

    Themaxtr Member

    Thanks for your help but now i am having another problem. I am trying to use the <senseWallsFlag> and <senseMapFlag> but they are not working here is my code.

    <spell name="Sonic Scan" type="self" icon="sprites/11th.png" >
    <buff useTimer="55" time="25" allowstacking="0" stacksize="1" self="1" icon="sprites/11th.png" smallicon="sprites/11th.png">
    <sightbuff amount="10" />
    <senseWallsFlag amount ="1" />
    <senseTrapFlag amount = "1" />
    <senseMapFlag amount = "1" />
    </buff>
    <description text="This is a test." />
    </spell>


    The sight buff and <sense trap flag> works but the <senseWallsFlag> does not let me see though walls and <senseMapFlag> does not reveal the map. Am i missing something or do they work differently than i think?

    i ran the mod validator and got this error.

    C:\Users\Maxwell Flynn\Documents\Gaslamp Games\Dungeons of Dredmor\mods\Be the Dr\mod\spellDB.xml
    1 error(s) found.

    Line 5, Position: 3 -- 'senseWallsFlag' is not a valid child for 'buff'



    The spell appears in game and the sight and trap buffs work so i am confused by the error.
    Any help would be awesome.
     
    Last edited: Jul 17, 2014