View Single Post
Hydrothermal
Junior Member
 
Join Date: Sep 2014
Location: USA
Posts: 11

Old February 10th, 2020, 01:41 PM
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 by Hydrothermal; February 11th, 2020 at 08:34 PM.
Hydrothermal is offline   #1 Reply With Quote