FORUM ARCHIVED

Why does this crash the game? (thrownBuff workaround experiment)

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

  1. Aegho

    Aegho Member

    I figured I could maybe do a workaround for thrownBuff and crossbowShotBuff not working in buff tags by adding it directly to the skill and then checking for buff through filter, my first attempt failed due to targeting breaking, but then I remembered reading through chronomancy's spellDB and came up with the following:

    SpellDB portion:
    Code:
    <spell name="Find Juggle Target" type="area" radius="100">
    <effect type="trigger" spell="Juggle Hit" requirebuffontrigger="1"
     
    requirebuffontriggername="Juggle Throw" />
      </spell>
     
    <spell name="Juggle Hit" type="target" >
      <effect type="damage" crushing="99" crushingF="1" secondaryScale="2" />
      </spell>
     
    <spell name="Juggle Check" type="self" >
    <effect type="trigger" spell="Find Juggle Target" requirebuffontrigger="1"
     
    requirebuffontriggername="Juggle" />
      </spell>
     
    <spell name="Juggle Throw" type="target" >
          <buff useTimer="1" time="1" self="0" icon="skills/warrior/thrown2_64.png"
     
    smallicon="skills/dual_pitcher32.png">
      <secondarybuff id="12" amount="-1"/>
      </buff>
      <effect type="trigger" spell="Juggle Check" />
      </spell>
     
    <spell name="Juggle" type="self" downtime="15" icon="skills/warrior/thrown2_32.png" >
      <description text="You're juggling some balls."/>
      <buff useTimer="0" attacks="3" icon="skills/warrior/thrown2_64.png"
     
    smallicon="skills/dual_pitcher32.png">
        <targetHitEffectBuff type="damage" crushing="1" crushingF="1" secondaryScale="2"/>
      </buff>
      </spell>
    SkillDB portion:
    Code:
    <ability name="Juggling" icon="skills/warrior/thrown2_64.png" skill="714" level="0">
      <description text="You've learned to juggle."/>
      <secondarybuff id="9" amount="5"/> <!-- EDR -->
      <thrownBuff name="Juggle Throw" percentage="100"/>
      <spell name="Juggle"/>
      </ability>
    The game crashes from a "cannot read memory" error when the visible projectile in the throwing weapon animation reaches the enemy.

    PS: The 99 damage is just so I could easily see, visually, if the damage dealing portion worked, it's being changed to 1 after.

    PPS: Added download in case you want to fiddle with it.
     

    Attached Files:

  2. Glazed

    Glazed Member

    It would help a lot if you described what this is trying to do.
     
  3. Aegho

    Aegho Member

    Skill has a buff

    Throwing procs a debuff on the targeted enemy, then checks if you have the buff the skill provides, if you have the buff the skill provides then it triggers a search for the enemy with the debuff, and hits it. (Actually it does an area 100 spell that triggers the hit on any targets that have the debuff).

    Its a workaround to thrownBuff not working in buff tags.

    Btw: adding self="0" to the debuff didn't fix it either, I tried that after posting. Editing to show that.
     
  4. Essence

    Essence Will Mod for Digglebucks

    If it's a memory area, the first thing I'd do is tone down the area of effect. You don't ever throw something at a target 100 spaces away; that can probably be cut down to <radius="12"> realistically. Also, does it crash if the player doesn't have Juggle active?


    Also, if you keep showing off coding skills like that, someone might offer you a job. That's clever work. :)
     
  5. Aegho

    Aegho Member

    It doesn't happen if juggle is not active.

    Lowered area to 15 and it still crashes.

    As a sidenote, since updating to RC6 I no longer get the error message when it crashes. Just a very quick crash to desktop. It does however create a crash dump every single time.
     
  6. Essence

    Essence Will Mod for Digglebucks

    OK, then that means the trouble is with Find Juggle Target or something that it calls. This is silly, but it's bit me in the ass before: rearrange everything so that any spell being triggered is above the spell that's triggering it (i.e. put Juggle Hit above Find Juggle Target, etc.)
     
  7. Aegho

    Aegho Member

    Rearranged them, no change.

    Also tried changing the icons for the debuff, didn't help.

    Crash does not occur on enemy dodge either btw.
     
  8. Essence

    Essence Will Mod for Digglebucks

    This is really stupid: try changing the spell type on Juggle Check to "target". That's about my last idea; everything looks like it should work to me. If you still have the problem, post the crashdump up in the RC6 feedback thread.
     
  9. Cullen

    Cullen Member

    I think problem is it self. i mean, throw -> buff find -> hit? i think it's something weird. throw -> buff end. find -> hit would solve the problem. use find in other skill or somehow delay it or sometihng

    i think good example is, this

    Code:
        <spell name="Grandfather Clock Paradox" type="targetemptyfloor" downtime="50" icon="skills/spells/grandfather_clock_paradox_32.png">
            <!-- Find and activate any existing Grandfather Clocks -->
            <effect type="trigger" spell="Find Grandfather Clock" />
           
            <!-- Summon a Grandfather Clock -->
            <effect type="summonhostile" monsterType="Grandfather Clock" />
           
            <!-- Setup our summon to be invulnerable and stationary -->
            <effect type="trigger" spell="Frozen in Time" />
           
            <!-- FX -->
            <anim sprite="sprites/sfx/smokepuffbig/smokepuffbig" frames="6" framerate="100" centerEffect="1" sync="1" sfx="bampf" />
            <description text="First discovered by the great Doc Brown, Brownian Motion forces your body into the gap between space and time. As long as this is maintained your physical form will periodically realign itself." />
        </spell>
       
        <!-- Polymorph Spell -->
        <spell name="Grandfather Clock Paradox " type="targetemptyfloor" downtime="0" icon="skills/spells/grandfather_clock_paradox_32.png">
            <effect type="trigger" spell="Grandfather Clock Paradox" />
           
            <!-- FX -->
            <anim sprite="sprites/sfx/smokepuffbig/smokepuffbig" frames="6" framerate="100" centerEffect="1" sync="1" sfx="bampf" />
            <description text="First discovered by the great Doc Brown, Brownian Motion forces your body into the gap between space and time. As long as this is maintained your physical form will periodically realign itself." />
        </spell>
       
        <spell name="Find Grandfather Clock" type="area" radius="100">
            <effect type="trigger" spell="Activate Grandfather Clock" amount="1" />
           
            <!-- FX -->
            <anim sprite="sprites/sfx/time_invis/time_invis" frames="2" framerate="1" />
            <description text="First discovered by the great Doc Brown, Brownian Motion forces your body into the gap between space and time. As long as this is maintained your physical form will periodically realign itself." />
        </spell>
       
        <spell name="Activate Grandfather Clock" type="target">
            <!-- Must use damage instead of 'Kill Time' as we need this to be taxa specific -->
            <effect type="damage" existential="9999" taxa="Grandfather Clock" />
        </spell>
       
        <spell name="Thinking With Portals" type="targetcorpse">
            <effect type="teleport" />
           
            <!-- FX -->
            <anim sprite="sprites/sfx/digging_ray_hit/digging_ray_hit" frames="9" framerate="60" centerEffect="0" sfx="teleport_short" />
        </spell>
    found this in Chronomancy
     
  10. Aegho

    Aegho Member

    Sorry, I can't make sense of your sentence. Are you saying I should use another skill to do the hit with? This is supposed to be a workaround for thrownbuff not working inside buff tags, it's supposed to go off instantly. I've tried using after="1" in there, it doesn't help.

    The current sequence is throw->buff enemy->check for buff on self->if found, then find enemy with buff->hit enemy.

    I'm aware of the grandfather clock paradox. I based the enemy finding check on it.
     
  11. Kazeto

    Kazeto Member

    I'll get to it from another direction, then. With just one question.

    Have you tried changing small parts of the spell chain so that you'd know which part exactly is at fault (by substituting the last triggered spell with something that works for certain, for example)?

    If not, then go do that and don't reply to this thread unless you either figured out what is wrong or can honestly answer "yes".
     
  12. Cullen

    Cullen Member

    Juggle.png

    I think i fixed it but with Active. Check and find was broken (or i dont know how to use it.i just learn requirebuffontrigger would work) so i changed both to target. i think you may change this to work passively
     

    Attached Files:

    Aegho likes this.
  13. Aegho

    Aegho Member

    Thanks for the help Cullen, but your version does not actually check if you're running the juggle buff, so it would ALWAYS work, ie: indistinguishable from a normal 100% proc. The juggle check was there to check if you had the Juggle buff running on yourself.

    But at least it narrows down the problem. (Or maybe not so much, since you also did away with the enemy finding solution).
     
  14. Aegho

    Aegho Member

    Well I narrowed down what the problem was. It's the Find Juggle Target spell that causes the crash...

    I changed it to a template spell and it stoped crashing, but it didn't perform the juggle hit damage.
     
  15. Essence

    Essence Will Mod for Digglebucks

    Try a type="fireball" radius="20"?
     
  16. Aegho

    Aegho Member

    Makes the game hang instead of crash.
     
  17. Null

    Null Will Mod for Digglebucks

    anim. That is all.
     
    Kazeto and Aegho like this.
  18. Aegho

    Aegho Member

    Thanks, adding an animation fixed the crashing... unfortunately the damage isn't being applied.

    Code:
    <spell name="Juggle Hit" type="target" >
      <effect type="damage" crushing="99" crushingF="1" secondaryScale="2" />
      </spell>
     
    <spell name="Find Juggle Target" type="area" radius="20" >
      <anim sprite="sprites/sfx/summonA/summonA" frames="1" framerate="100" centerEffect="1" />
    <effect type="trigger" spell="Juggle Hit" requirebuffontrigger="1" requirebuffontriggername="Juggle Throw" />
      </spell>
     
    <spell name="Juggle Check" type="self" >
    <effect type="trigger" spell="Find Juggle Target" requirebuffontrigger="1" requirebuffontriggername="Juggle" />
      </spell>
     
    <spell name="Juggle Throw" type="target" >
          <buff useTimer="1" time="1" self="0" icon="skills/spells/boulderization64.png" smallicon="skills/spells/boulderization32.png">
      <secondarybuff id="12" amount="-1"/>
      </buff>
      <effect type="trigger" spell="Juggle Check" />
      </spell>
    Stable but not completely functional.

    The debuff gets correctly applied... other than that, I would guess the requirebuffontrigger stuff isn't working completely.
     

    Attached Files:

  19. Null

    Null Will Mod for Digglebucks

    requirebuffontrigger checks the caster sadly.
     
  20. Aegho

    Aegho Member

    If that's true it becomes much easier! Fixed it within seconds, when I knew that!

    Now there's only the visual blight that Juggle Throw text shows up on every thrown attack, wether juggling is up or not(but the damage is only done when juggling is up).