• 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

How can I modify a weapon's properties with an activation?

I want to add a new weapon that allows the user to toggle a checkbox to change its damage and other stats. However, nonmagical weapons don't have an option to give them an activated ability. I got around this by directly adding the User.Activation tag and actName field, then checking abilActive in an eval script to manipulate the weapon's stats.

Code:
doneif (field[abilActive].value = 0)

field[wDamage].value -= 1
field[wAttack].value -= 1
perform this.delete[wCritMin.19]
perform this.assign[wCritMin.20]

This triggers an error when the weapon is loaded for the first time ("Attempt to access field 'usrChkText' that does not exist for thing wTestItem"), but it does work. I'm mostly okay with the error popping up if it's otherwise functional, but it also breaks if the weapon is selected for a custom magic weapon. I assume because the magic weapon is picking the actual weapon as a gizmo, my eval script only sets the fields on the gizmo pick and not the container. I have two questions:

- Is there a better way to get the checkbox to show up (ideally without the usrChkText error)? I thought about bootstrapping a separate ability to create the entry on the in-play tab, but I don't want to go down that road if it's not the right solution.
- How can I get my eval script to work both when the weapon is magical and nonmagical? I tried to figure out how to reference the container from the script, but I've never worked with gizmos before so I think I'm missing a lot of steps.
 
Last edited:
I fixed the magic weapon issue by checking container.ishero and then using either this or parent to make the modifications. I still get the (non-breaking) usrChkText error, though. It seems it will occur as long as User.Activation is present on the weapon and setting usrChkText just triggers the same error. Is there a different tag that I should use, or a way to define usrChkText for the thing?
 
Back
Top