Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - Pathfinder Roleplaying Game (http://forums.wolflair.com/forumdisplay.php?f=62)
-   -   How can I modify a weapon's properties with an activation? (http://forums.wolflair.com/showthread.php?t=63833)

Hydrothermal February 10th, 2020 01:41 PM

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.

Hydrothermal February 11th, 2020 09:59 PM

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?

Minous February 12th, 2020 07:20 AM

You might think of implementing this via an adjustment that selects the weapon in a drop down


All times are GMT -8. The time now is 03:40 PM.

Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.