FORUM ARCHIVED

Complex buff-spell-buff help

Discussion in 'Modding' started by codebracker, Sep 6, 2012.

  1. codebracker

    codebracker Member

    I need help
    my next skill is done exept for one thing:
    I'm trying to make a spell that applies a 1 turn buff every turn in a 3x3 circle (template 100)
    this is the code I've tried (no it doesn't work, exept the last part)
    Code:
    <spell name="Operation room" type="self" icon="skills/room_32.png" downtime="1" >
    <buff useTimer="0" allowstacking="0" stacksize="1" removable="1" self="1" icon="skills/room_64.png" smallicon="skills/room_32.png" bad="0" >
    <effect type="trigger" name="Operation field" />
    <primarybuff id="2" amount="-5"/>
    </buff>
    <description text="You can create an operation room, under your controll." />
    </spell>
    <spell name="Operation field" type="template" templateID="100" anchored="1" icon="skills/room_32.png" >
    <effect type="trigger" name="Operation" />
    <description text="You can create an operation room, under your controll."/>
    </spell>
    <spell name="Operation" type="self" icon="skills/operation_32.png" >
    <buff useTimer="1" time="1" allowstacking="0" stacksize="1" self="1" icon="skills/operation_64.png" smallicon="skills/operation_32.png" bad="1" >
    </buff>
    <description text="As long as you're within a surgeons room, consider yourself a patient on the operating table." />
    </spell>
    It's suposed to work like this:
    1: (operation room) is an on/off buff that is suposed to continuously cast spell 2 once per turn
    2: (operation field) a spell that is suposed to apply buff 3 to everyone in a 3x3 circle - template 100
    3: (operation) a blank 1 turn buff that trigger-allows the use of three next spells (AoE manipulation)

    If anyone knows whats wrong or a better way please help.
     
  2. Kazeto

    Kazeto Member

    Instead of giving the first one a trigger, give it a dot effect (outside of the buff) that requires said buff to work.
     
  3. Lunix Vandal

    Lunix Vandal Member

    Or, to borrow a page from Warlockery,
    Code:
    <spell name="Operating Room" type="self" icon="skills/room_32.png" downtime="1" >
        <buff useTimer="0" allowstacking="0" stacksize="1" removable="1" self="1" icon="skills/room_64.png" smallicon="skills/room_32.png" bad="0" >
            <primarybuff id="2" amount="-5"/>
        </buff>
        <effect type="trigger" spell="Operation Trigger"/>
        <description text="You can create an operating room under your control." />
    </spell>
     
    <spell name="Operation Trigger"/>
        <effect type="trigger" requirebuffontrigger="1" requirebuffontriggername="Operating Room" spell="Operation"/>
        <effect type="trigger" requirebuffontrigger="1" requirebuffontriggername="Operating Room" spell="Operation Trigger" amount="2"/>
    </spell>
     
    <spell name="Operation" type="template" templateID="100" anchored="1">
        <buff useTimer="1" time="1" allowstacking="0" stacksize="1" self="1" icon="skills/operation_64.png" smallicon="skills/operation_32.png" bad="1" >
        </buff>
        <description text="As long as you're within a surgeon's room, consider yourself a patient on the operating table." />
    </spell>
    The recursion caused by the second spell is forgivable in this case due to the all-important 'requirebuffontrigger' stuff and the 'amount="2"', which causes the next loop-around to occur on your next turn, rather than the current one, if and only if you still have Operating Room up. (A similar trick is how the newest version of YHTNTEP-Warlockery nukes your mana if you shrug off Empowered Form early.)
     
    Essence likes this.
  4. codebracker

    codebracker Member

    Thanks it works exept
    <spell name="Operation Trigger"/>
    shouldn't have a / at the end
    and self="1" shoul probably be 0
    Oh yeah and it doesn't apply the buff to anyone(still)
     
  5. codebracker

    codebracker Member

    Could someone make the code for this spell and try it out, because none of those seemed to work.
    It's suposed to be a buff that triggers a buff (different one) to enemies in an AoE around you, for as long as they are in range.
     
  6. Lunix Vandal

    Lunix Vandal Member

    Le derp. :confused:
    Forgot that buffs count the turn on which they are applied against their duration -- the buff is (or should be) being applied, but evaporates before you can interact with it at all. Try this:
    Code:
    <spell name="Operating Room" type="self" icon="skills/room_32.png" downtime="1" >
        <buff useTimer="0" allowstacking="0" stacksize="1" removable="1" self="1" icon="skills/room_64.png" smallicon="skills/room_32.png" bad="0" >
            <primarybuff id="2" amount="-5"/>
        </buff>
        <effect type="trigger" spell="Operation Trigger"/>
        <description text="You can create an operating room under your control." />
    </spell>
     
    <spell name="Operation Trigger">
        <effect type="trigger" requirebuffontrigger="1" requirebuffontriggername="Operating Room" spell="Operation"/>
        <effect type="trigger" requirebuffontrigger="1" requirebuffontriggername="Operating Room" spell="Operation Trigger" amount="2"/>
    </spell>
     
    <spell name="Operation" type="template" templateID="100" anchored="1">
        <buff useTimer="1" time="2" allowstacking="1" stacksize="2" self="0" icon="skills/operation_64.png" smallicon="skills/operation_32.png" bad="1" >
        </buff>
        <description text="As long as you're within a surgeon's room, consider yourself a patient on the operating table." />
    </spell>
     
    OmniaNigrum likes this.
  7. codebracker

    codebracker Member

    Thanks but for some reason it doesn't want to give me the spell, wil try to fix later
     
  8. codebracker

    codebracker Member

    I've got the spell to work, but it still doesn't apply the buff to enemies.
    I've modified it a little, here's the result.
    Code:
    <spell name="Operating Room" type="self" icon="skills/room_32.png" downtime="5" wand="0">
        <requirements mincost="5" mp="15" savvyBonus="0.15" />
        <buff useTimer="0" destroyonmove="1" stacksize="1" allowstacking="0" icon="skills/room_64.png" smallicon="skills/room_32.png">
            <halo name="sprites/sfx/conflux/conflux" first="0" num="3" frameRate="100"/>
            <primarybuff id="2" amount="4"/> <!-- Nimbleness -->
            <secondarybuff id="10" amount="2"/> <!-- armour -->
            <secondarybuff id="7" amount="5"/> <!-- block -->
            <resistbuff aethereal="2" transmutative="4" />
        </buff>
        <effect type="trigger" spell="Operation Trigger"/>
      <anim sprite="sprites/sfx/glintA/glintA" frames="5" framerate="60" centerEffect="0" sfx="portal" />
        <description text="You can create an operating room under your control (but obviously you have to stay inside)." />
    </spell>
    <spell name="Operation Trigger">
        <effect type="trigger" requirebuffontrigger="1" requirebuffontriggername="Operating Room" spell="Operation"/>
        <effect type="trigger" requirebuffontrigger="1" requirebuffontriggername="Operating Room" spell="Operation Trigger" amount="2"/>
    </spell>
    <spell name="Operation" type="template" templateID="100" anchored="1">
        <buff useTimer="1" time="2" allowstacking="1" stacksize="2" self="0" icon="skills/operation_64.png" smallicon="skills/operation_32.png" bad="1" >
        </buff>
        <description text="As long as you're within a surgeon's room, consider yourself a patient on the operating table." />
    </spell>
    This is the result, but still no buffs on opponents.
    What am I doing wrong?
     
  9. Kazeto

    Kazeto Member

    Instead of having "Operation" be the effect triggered "Operation Trigger", make a spell with a different name that would fulfil this purpose (aka. place a template to work with), which would call "Operation" on every tile it affects with its type being "targetmonster" instead.

    So something like this:
    Code:
    <spell name="Operating Room" type="self" icon="skills/room_32.png" downtime="5" wand="0">
        <requirements mincost="5" mp="15" savvyBonus="0.15" />
        <buff useTimer="0" destroyonmove="1" stacksize="1" allowstacking="0" icon="skills/room_64.png" smallicon="skills/room_32.png">
            <halo name="sprites/sfx/conflux/conflux" first="0" num="3" frameRate="100"/>
            <primarybuff id="2" amount="4"/> <!-- Nimbleness -->
            <secondarybuff id="10" amount="2"/> <!-- armour -->
            <secondarybuff id="7" amount="5"/> <!-- block -->
            <resistbuff aethereal="2" transmutative="4" />
        </buff>
        <effect type="trigger" spell="Operation Trigger"/>
      <anim sprite="sprites/sfx/glintA/glintA" frames="5" framerate="60" centerEffect="0" sfx="portal" />
        <description text="You can create an operating room under your control (but obviously you have to stay inside)." />
    </spell>
     
    <spell name="Operation Trigger">
        <effect type="trigger" requirebuffontrigger="1" requirebuffontriggername="Operating Room" spell="Operation Trigger 2"/>
        <effect type="trigger" requirebuffontrigger="1" requirebuffontriggername="Operating Room" spell="Operation Trigger" amount="2"/>
    </spell>
     
    <spell name="Operation Trigger 2" type="template" templateID="100" anchored="1">
        <effect type="trigger" spell="Operation">
    </spell>
     
    <spell name="Operation" type="targetmonster">
        <buff useTimer="1" time="2" allowstacking="1" stacksize="2" self="0" icon="skills/operation_64.png" smallicon="skills/operation_32.png" bad="1" >
        </buff>
        <description text="As long as you're within a surgeon's room, consider yourself a patient on the operating table." />
    </spell>
    It ought to work that way (though I give no guarantees, having had a hard day and simply being too tired to test it).
     
    OmniaNigrum likes this.
  10. codebracker

    codebracker Member

    Thanks, I appreciate your effort:D , but unfortunately it still doesn't apply a buff:(.
     
  11. Essence

    Essence Will Mod for Digglebucks

    Completely off-the-cuff and with very little thought: have you made sure that each spell being called comes before the spell calling it in the XML?
     
  12. codebracker

    codebracker Member

    what?
     
  13. OmniaNigrum

    OmniaNigrum Member

    The rules for standard XML requires the spells that are called to come *BEFORE* the spell that calls them in the text itself.

    It may or may not be the case with DoD, but it is good to stick to that method of doing things.
     
    Kazeto likes this.
  14. codebracker

    codebracker Member

    I didn't know that, never had that problem before, and my spells work ok exept this one (even managed a swap-with-target and lockable as a target, xml checker never heard of both)
    But the problem seams to be, as far as I know, that the buff should cast a spell every turn for as long as it's active, but nobody knows how to make it work
    PS: do you mean the effect should be before the spell? The vanilla game has them not only after spells, but even across diferent files at that!
     
  15. Kazeto

    Kazeto Member

    It depends on the kind of trigger.
     
  16. Essence

    Essence Will Mod for Digglebucks

    Oh, is that all? Shit, son, that's cake with pie in it.

    Code:
    
    <spell name="The Spell You Really Wanna Trigger" type="self">
     <description text="It's The Spell You Really Want To Trigger!"/>
     </spell>
    
    <spell name="TheSpellYouReallyWannaTrigger Trigger" type="self">
     <effect type="trigger" spell="The Spell You Really Wanna Trigger" amount="1" requirebuffontrigger="1" requirebuffontriggername="TheBuffInQuestion"/>
     <effect type="trigger" spell="TheSpellYouReallyWannaTrigger Trigger" amount="2" requirebuffontrigger="1" requirebuffontriggername="TheBuffInQuestion"/>
    </spell>
    
    <spell name="TheBuffInQuestion" type="target">
     <buff usetimer="1" time="55" bad="1" self="1" smallicon="skills/magic_deform32.png" icon="skills/magic_deform64.png">
      <description text="It's the Buff that you want to have cast a spell every turn for as long as it's active!"/>
    </buff>
     <effect type="trigger" spell="TheSpellYouReallyWannaTrigger Trigger"/>
    </spell>
     
    <spell name="TheBuffInQuestion Trigger" type="target">
     <effect type="trigger" spell="TheBuffInQuestion"/>
     </spell>
    

    Basically, you have a buff call a spell that, in turn, calls itself with amount="2" (so it'll happen next turn, triggering itself, so it'll happen the turn after that, triggering itself endlessly) -- except you requirebuffontrigger the self-trigger, so the loop stops if the buff leaves. Then, you have THAT spell also trigger another spell -- the spell you really wanna trigger. I do this at least three times in all of my dinking around in Arcane Capacitor. :)
     
    OmniaNigrum likes this.
  17. Kazeto

    Kazeto Member

    You know Essence, you just made me realize what's wrong with the snippet of code I wrote for the guy...
    Because "amount" is not used for what I meant to use it for when it checks for buffs. Ugh, I'm blind for not having noticed that (the fact that I never made a spell that would require multiple instances of a buff in order to do something is my excuse).

    codebracker, this one should work:
    Code:
    <spell name="Operating Room" type="self" icon="skills/room_32.png" downtime="5" wand="0">
        <requirements mincost="5" mp="15" savvyBonus="0.15" />
        <buff useTimer="0" destroyonmove="1" stacksize="1" allowstacking="0" icon="skills/room_64.png" smallicon="skills/room_32.png">
            <halo name="sprites/sfx/conflux/conflux" first="0" num="3" frameRate="100"/>
            <primarybuff id="2" amount="4"/> <!-- Nimbleness -->
            <secondarybuff id="10" amount="2"/> <!-- armour -->
            <secondarybuff id="7" amount="5"/> <!-- block -->
            <resistbuff aethereal="2" transmutative="4" />
        </buff>
        <effect type="trigger" spell="Operation Trigger"/>
      <anim sprite="sprites/sfx/glintA/glintA" frames="5" framerate="60" centerEffect="0" sfx="portal" />
        <description text="You can create an operating room under your control (but obviously you have to stay inside)." />
    </spell>
     
    <spell name="Operation Trigger" type="self">
        <effect type="trigger" requirebuffontrigger="1" requirebuffontriggername="Operating Room" spell="Operation Trigger 2"/>
        <effect type="trigger" spell="Operation Trigger 0" amount="2"/>
    </spell>
     
    <spell name="Operation Trigger 0" type="self">
        <effect type="trigger" requirebuffontrigger="1" requirebuffontriggername="Operating Room" spell="Operation Trigger"/>
    </spell>
     
    <spell name="Operation Trigger 2" type="template" templateID="100" anchored="1">
        <effect type="trigger" spell="Operation"/>
    </spell>
     
    <spell name="Operation" type="targetmonster">
        <buff useTimer="1" time="2" allowstacking="1" stacksize="2" self="0" icon="skills/operation_64.png" smallicon="skills/operation_32.png" bad="1" >
        </buff>
        <description text="As long as you're within a surgeon's room, consider yourself a patient on the operating table." />
    </spell>
     
    OmniaNigrum likes this.
  18. codebracker

    codebracker Member

    will test soon
    PS: <effect type="trigger" spell="Operation">
    it's suposed to be <effect type="trigger" spell="Operation"/>
    PPS: tested, it doesn't work, i think I posted a few posts ago to please test before posting?