Senior Member
Join Date: Jun 2010
Location: Florida
Posts: 235
|
So I have a similar question posted awhile back and a few others have asked something similar as well.
I have been unable to get "usrCandid1" and "ChooseSrc1" to work with a list of content not already defined in SW. My example would be this edge, where I tired an Array instead: Code:
<thing id="edgMilRank" name="Military Rank" description="" compset="Edge" summary="Select a rank" uniqueness="unique"> <fieldval field="usrLabelAr" value="Menu1"/> <arrayval field="usrArray" index="0" value="Ensign"/> <arrayval field="usrArray" index="1" value="Lieutenant"/> <arrayval field="usrArray" index="2" value="Lt. Commander"/> <arrayval field="usrArray" index="3" value="Commander"/> <arrayval field="usrArray" index="4" value="Captain"/> <usesource source="Travel"/> <tag group="MinRank" tag="0"/> <tag group="User" tag="Activation"/> <tag group="EdgeType" tag="Background"/> <eval phase="PreTraits" priority="5000"><![CDATA[ if (field[abilActive].value <> 0) then perform #traitadjust[trCharisma,+,1,"Air NCO"] endif]]> <before name="Calc trtFinal"/> </eval> </thing> The above code spits out no errors, you just get the Edge and no menu to select choices from. |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Looking at the code for the editor tab for edges, usrArray is commented out, so this is not currently available for Edges. If you want to use this, I'd recommend putting it in the enhancement request thread.
|
#2 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
In order to get that sort of selection with a selection-based menu, I'd create items on the Simple tab to represent each of the selections. Manually create some tag (I think the User group looks like a good group to use), and assign it to all of them. Then, you can write a candidate expression that covers all the items you've created.
|
#3 |
Senior Member
Join Date: Jun 2010
Location: Florida
Posts: 235
|
Well, with "usrCandid1" I had this:
Code:
<thing id="edgMiRank2" name="Military Rank" description="" compset="Edge" summary="Select a rank" uniqueness="unique"> <fieldval field="usrCandid1" value="Ensign | Lieutenant | Commander | Captain"/> <usesource source="Travel"/> <tag group="MinRank" tag="0"/> <tag group="User" tag="Activation"/> <tag group="EdgeType" tag="Background"/> <tag group="ChooseSrc1" tag="Hero"/> <eval phase="PreTraits" priority="5000"><![CDATA[ if (field[abilActive].value <> 0) then perform #traitadjust[trCharisma,+,1,"Air NCO"] endif]]> <before name="Calc trtFinal"/> </eval> </thing> I got lost beyond that trying to figure out how to write an expression that pulled the list into the selection box. |
#4 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
usrCandid1 = "component.Simple & User.The tag you created to distinguish these items"
|
#5 |
Senior Member
Join Date: Jun 2010
Location: Florida
Posts: 235
|
You rock Mathias!!
For everyone else, this is how I applied his suggestions: Simple Items: Code:
<thing id="valTREnsig" name="O1 Ensign" compset="Simple"> <usesource source="Travel"/> <tag group="User" tag="Rank" name="Rank" abbrev="Rank"/> </thing> <thing id="valTRLieut" name="O2 Lieutenant" compset="Simple"> <usesource source="Travel"/> <tag group="User" tag="Rank" name="Rank" abbrev="Rank"/> </thing> etc. Code:
<thing id="edgMiRank" name="Military Rank" compset="Edge" summary="Select a rank" uniqueness="unique"> <fieldval field="usrCandid1" value="component.Simple & User.Rank"/> <usesource source="Travel"/> <tag group="User" tag="Activation"/> <tag group="EdgeType" tag="Background"/> <tag group="ChooseSrc1" tag="Thing"/> <tag group="MinRank" tag="0"/> <eval phase="PreTraits" priority="5000"><![CDATA[ if (field[abilActive].value <> 0) then perform #traitadjust[trCharisma,+,1,"Military Rank"] endif]]> <before name="Calc trtFinal"/> </eval> </thing> |
#6 |
Senior Member
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819
|
So basically what does that do? Just give a select list with the Edge that simply displays text (the rank chosen, in this case?) I could add it to the Common Codes thread if you like, but I want a good way to explain what it's doing to someone reading this for the first time and trying to decide if this code will help them do what they want to do.
Lenny Zimmermann Metairie, LA, USA Data files authored (please let me know if you see any issues with any of these if you have/use them): Official (In the downloader) 50 Fathoms, Deadlands: Hell On Earth, Deadlands: Noir, East Texas University, Necessary Evil (requires Super Powers Companion), Pirates of the Spanish Main, Space 1889 (original file by Erich), Tour of Darkness, Weird War II, Weird Wars: Rome Coming Eventually Evernight (LWD has completed their review but I have some fixes to make first... although Pinnacle mentioned this might get an overhaul to SWADE so I may just wait for that first. If you just HAVE to have this now, though, just PM me) |
#7 |
Senior Member
Join Date: Nov 2009
Posts: 891
|
I wonder if a Knowledge Array could be made so that we can have a list of predefined Knowledge skills.
Evil wins because good rolls poorly .... or the players are not paying enough attention to the game. |
#8 |
Senior Member
Join Date: Jun 2010
Location: Florida
Posts: 235
|
To answer Zarlor.
I used this because I wanted an 'established' series of Military Ranks in place of a generic Domain-filled box. Other examples might be: Knowledge-based languages, you could create a list of the languages for your world, use this as the selection option when they pick new Knowledge (Language). I am actually going to use this for a setting of mine. Heck, even for some of the Hindrances (Allergies, Quirks, Phobias, etc.). For some settings, the GM just might want a finite list for his characters to choose from. I tried finding some threads with similar needs for something like this: http://forums.wolflair.com/showthread.php?t=30863 http://forums.wolflair.com/showthread.php?t=21113 Which made me think of Skill Specializations or Preset Knowledge lists, seeming to get most use out of something like this. Hope that helps you out with phrasing for Common Code examples. BTW, I love that immensely, thank you very much. |
#9 |
Senior Member
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819
|
My pleasure. It's largely personal notes for myself from when I was first learning these things and I figured I'd share in case anyone else might find it useful.
One last question... I'm assuming that doing it this way forces the selection only to what is on the list. Is there a way to allow the selection from a list like this but then also allow a blank box for manual entry? Lenny Zimmermann Metairie, LA, USA Data files authored (please let me know if you see any issues with any of these if you have/use them): Official (In the downloader) 50 Fathoms, Deadlands: Hell On Earth, Deadlands: Noir, East Texas University, Necessary Evil (requires Super Powers Companion), Pirates of the Spanish Main, Space 1889 (original file by Erich), Tour of Darkness, Weird War II, Weird Wars: Rome Coming Eventually Evernight (LWD has completed their review but I have some fixes to make first... although Pinnacle mentioned this might get an overhaul to SWADE so I may just wait for that first. If you just HAVE to have this now, though, just PM me) |
#10 |
|
|