|
Senior Member
Join Date: May 2013
Posts: 240
|
I need to adjust the code for the magic weapon Serithtial so that it can assume the form of my PC's favored weapon.
I copied the thing, renamed it, and added a couple new bootstraps inside the magic weapon gizmo: The improvised weapon power works fine, though it triggers an error specifying that magic weapons can't be improvised. This one can, because GM fiat. The only problem is that "shovel" is not appearing in the selector: The thing wShovel exists and has been working fine for the whole campaign. I set a condition on it (First, 450, "fieldval:usrIndex = 8"). That's identical to all the other forms, except I incremented the usrIndex value by one. What else I need to do in order to make this form show up in the selector? |
#1 |
Junior Member
Join Date: Feb 2021
Posts: 8
|
This item uses custom usrArray menu for weapon type choice.
it is not a tag-based choice - just harcoded array of possible values. It looks like editor doesn't provide you way to modify it, so, open your user file with any editor, find menu definition: <arrayval field="usrArray" index="7" value="Short sword"/> and add your Showel there: <arrayval field="usrArray" index="8" value="Showel"/> Don't forget to make Gizmo bootstrap conditional: <bootstrap thing="wShovel"> <containerreq phase="First" priority="450">fieldval:usrIndex = 8</containerreq> </bootstrap> |
#2 |
Senior Member
Join Date: May 2013
Posts: 240
|
I figured it out.
The bootstrap was just fine, but the options that display in the UI are set up inside the usrArray. I have no idea how you're supposed to edit that in the HL editor -- I figured it out by opening up the .user file in a text editor and reading the XML. Once I added this line: Code:
<arrayval field="usrArray" index="8" value="Shovel"/> Finally, the magic sauce to get rid of the error saying that improvised weapons can't be magical/masterwork, I added an eval script on the item that runs at First/10000 and says this: Code:
perform hero.assign[Custom.MagImprov] So it all works now. Yay! Last edited by wdmartin; March 1st, 2021 at 09:14 PM. Reason: correcting typos |
#3 |
|
|