• 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

Reduce Armor check via script enigma!

bodrin

Well-known member
I have a trait that reduces the armor check penalty by 1 to a minimum check penalty of 0.

I thought just copying a part of the Mithral script would work but I get these errors

Pre levels 2500

Code:
doneif (container.parent.field[arArmorChk].value <> 0)

 [COLOR=Red]~Reduce our Armor check penalty by 1
  container.parent.field[arArmorChk].value += 1[/COLOR]

HTML:
Attempt to access non-existent parent pick for a top-level container from script
- - -
Attempt to access non-existent parent pick for a top-level container from script
- - -
Attempt to access non-existent parent pick for a top-level container from script

Confused, why doesn't it work? The red highlighted part is a direct copy and paste from an existing script.
 
Confused, why doesn't it work? The red highlighted part is a direct copy and paste from an existing script.
A trait is on the Hero so it has no Container. A material like Mithrial goes on to a Gizmo when creating the custom weapon. So it has to access its Parent Container which is the Gizmo.

You will need to first FIND the armor to affect as you are not on the actual Thing.
 
This article on what all the dots means will hopefully help you figure out why container.parent is correct for a material trying to affect the armor it's on, but not correct for a trait trying to find a piece of armor;

http://forums.wolflair.com/showthread.php?t=21663


I have a real blind spot for some code, it's quite annoying at times.
Thanks for the heads up.


Also their is an existing trait that does exactly this by the way. It's called "Armor Expert" and is in HL.

You know, I do really get annoyed with myself.
Of course there would be something that already exists to compare.

In the words of Simpson, Homer et al DOH!!!
 
Back
Top