• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Class ability that changes armor type

TobyFox2002

Well-known member
Heya, I have run into a class ability that is causing me some issues.

The class ability is that at 7th level any heavy amour is treated as medium armor and the armor check penalty is reduced by 1. I think there is a timing issue. But I cant find it, either that or I am not transitioning properly. I adapted some of this code from the mithral material code.

It gives me no errors, but just does nothing. Any thoughts?
Code:
      ~ If we're disabled, do nothing
      doneif (tagis[Helper.SpcDisable] <> 0)

      ~ If we're not shown, Get out Now!
      doneif (tagis[Helper.ShowSpec] <> 0)

      foreach pick in hero from BaseArmor where "Helper.CurrArmor"
~ If we're armor, change our class
      if (eachpick.parent.tagis[component.BaseArmor] <> 0) then
         if (eachpick.tagis[ArmorClass.Heavy] <> 0) then
            perform eachpick.delete[ArmorClass.Heavy]
            perform eachpick.assign[ArmorClass.Medium]
            perform eachpick.delete[ArmorCateg.Slows]
         endif
      endif
      nexteach
 
You're already checking if an item is an armor in the foreach, then you're checking if the parent of the item is an armor, which will almost always be the hero. Toss some debugs in to check loop position but I think you need to drop that if statement
 
Well, thank you for your help. This has been nasty, working on this issue for two days. The timing for this seems to be a very narrow space between Post-Levels 35-50. Any earlier than that and it would be always active regardless of level. Any later and nothing happens. Also, the if/else statement worked but removing it and it also still works. So.. I removed it. I wasn't entirely happy with "Helper.CurrArmor" so I changed it to ArmorClass.Heavy for the foreach.

Post-Level/50
Code:
      ~ If we're disabled, do nothing
      doneif (tagis[Helper.SpcDisable] <> 0)

      ~ If we're not shown, Get out Now!
      doneif (tagis[Helper.ShowSpec] <> 0)

      Debug "Our class level : " & hero.tagcount[Classes.KniCrwDLC]
      
      ~ If we're not the proper level, Get out Now!
      doneif (hero.tagcount[Classes.KniCrwDLC] < 7)
~ Note: The Timing of this script is extremely tight.  Any earlier
~ than Post-Levels/50 and it will not detect the correct class levels.

      foreach pick in hero from BaseArmor where "ArmorClass.Heavy"
        debug "Armor Check: (before)" & eachpick.field[arArmorChk].value
        eachpick.field[arArmorChk].value += 1
            perform eachpick.delete[ArmorClass.Heavy]
            perform eachpick.assign[ArmorClass.Medium]
            perform eachpick.delete[ArmorCateg.Slows]
            perform eachpick.assign[Helper.Prof1Step]
        debug "Armor Check (after): " & eachpick.field[arArmorChk].value
      nexteach
 
Your comment is incorrect - the Post-Levels/35 requirement isn't imposed by the Classes.? test - it's coming from the Helper.ShowSpec test. And shouldn't that test be reversed? Only leaving the script if Helper.ShowSpec is NOT present?

I think post-levels/50 may be when Helper.ShowSpec is added, so anytime after that, you're always exiting the script early on.
 
Your comment is incorrect - the Post-Levels/35 requirement isn't imposed by the Classes.? test - it's coming from the Helper.ShowSpec test. And shouldn't that test be reversed? Only leaving the script if Helper.ShowSpec is NOT present?

I think post-levels/50 may be when Helper.ShowSpec is added, so anytime after that, you're always exiting the script early on.

I can only tell you what I have observed, and while I didnt go by each step on timing to get the exact number PL/35 is roughly where this seemed to stop functioning.

If I reverse Helper.ShowSpec the script ceases to function entirely.
 
Yes, that's what I'd expect, because you're using the Helper.ShowSpec test incorrectly. Reverse it, and then figure out the correct timing based on the corrected script. Start your testing at Post-Levels/1000, and since this is already a class special, delete the Classes.? test, because that's redundant once Helper.ShowSpec is working correctly.
 
Yes, that's what I'd expect, because you're using the Helper.ShowSpec test incorrectly. Reverse it, and then figure out the correct timing based on the corrected script. Start your testing at Post-Levels/1000, and since this is already a class special, delete the Classes.? test, because that's redundant once Helper.ShowSpec is working correctly.

Well, I feel like an idiot, yep.. that does it.
 
Back
Top