• 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

Modified Armour Training

gwydion2

Member
I'm trying to create a class abilty similar to armour training, but adding AC to the armour and not giving the ability to move at normal speed.
Obviously I started with copying Armour training and modified from there.
I removed the speed adjustment portion and looking at the relevant area of scripting for armour check and max dex, I tried a simple approach first, adding the lines in red below.

field[abValue].value += field[xCount].value
field[abValue2].value += field[xCount].value
field[abValue3].value += field[xCount].value

~ Improve the armor check penalty and max dex stats of our armors.
foreach pick in hero from BaseArmor where "EquipType.Armor"
eachpick.field[arArmorChk].value += field[abValue].value
eachpick.field[arMaxDex].value += field[abValue2].value
eachpick.field[tACArmor].value += field[abValue3].value

This didn't work, but when I replaced
[tACArmor] with [arBonus]
it did work, but not quite how I wanted it.
This increased the armour value of any armour by 1 but also increased the hero's natural armour bonus by 1 (per training level).

This seems to be getting somewhere, making me think I'm close to the answer, but I'm not sure how to fix it so the armour AC increases but not natural armour.
 
Try adding a debug within your foreach, to make it clear all the items which are being iterated through.

Code:
foreach dadadadadaWHATEVER
  debug "The currently iterated pick is " & eachpick.idstring
  nexteach

To see debug messages, go to "Develop -> Enable Data File Debugging", and then go to "Develop -> Floating Info Windows -> Show Debug output"

I think you'll find one of the picks your foreach is finding is incorrect. Once you have found that pick's unique ID, you can go to "Develop -> Floating Info Windows -> Show Pick Tags" and select the errant pick in the window that shows up. What tags are on that pick but not the armors you should be foreaching through? Once you know the tags unique to the wrong thing, you can modify your foreach to exclude that wrong thing.

Hope that helps!
 
Back
Top