How to use setchosen[]?
Does anyone know how to use the setchosen[...] target reference on a menu field?
For example Code:
<field id="someField" name="Example" type="user" style="menu"/> Being able to set the value of menu-style user fields would make one thing possible that I haven't found any other solution for (creating a shadowed proxy pick to use with a menu_thing in the UI, and pass on the result to an already existing non-shadowed pick). It would also help me to clean up some messy scripts/workarounds I've written, since I would be able to use a menu-style field as a simple script-modified linkage. |
I was able to track down an example in a procedure (xactMonSet from pathfinder).
Code:
~if we need to select from the list of factions, provide an initial |
setchosen could very easily overwrite the user's choices in drop-downs, so it definitely needs to be in a trusted script - using setchosen is a sledgehammer approach, and I don't think I've ever used it except in a creation script, to set a default the user can later change. For most cases where you need to choose a specific thing for the user, assigning an identity tag that says "the thing with this Id was chosen for this menu" and then writing your scripts to first check for that tag, then check if the user made a choice is the better solution for cases like "You gain X as a bonus, but it must choose Y".
|
All times are GMT -8. The time now is 12:34 PM. |
Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.