06-05-2009, 09:07 AM | #1 |
Join Date: Aug 2004
Location: Ronkonkoma, NY
|
#Choice syntax
I want to give the user a choice of Military Ranks 1–4. I think the #Choice directive is the one I want, but I'm not sure where to put it. The wiki says "the output generated by this directive will be inserted in place of the result variables, instead of in place of this directive." I don't understand what this means. I tried something along the lines of
adds(#Choice(AD:Military Rank=1, AD:Military Rank=2, AD:Military Rank=3, AD:Military Rank=4)) but that doesn't seem to work. I get the choice when applying the template, but Military Rank doesn't show up in the character. |
06-05-2009, 02:09 PM | #2 |
Join Date: Aug 2004
Location: Binghamton, NY, USA. Near the river Styx in the 5th Circle.
|
Re: #Choice syntax
Your best bet is to look in the existing data files for examples and copy from there - that's almost invariably what I end up doing all the time when I'm writing the official files.
All #Directives go within an x() tag; this tag is parsed then emptied once added to the character. The output can be in any other part of the trait. Code:
adds(AD:Rank = %examplealiaslist%), x(#ChoiceList(_ name(example), title(Rank Choice), text(Choose the level of Rank you'd lie to have:), picksallowed(atleast 1), method(bynumber), list(_ "Rank 1", "Rank 2", "Rank 3", "Rank 4" _ ), aliaslist(_ "1", "2", "3", "4" _ )_ )_ )
__________________
Eric B. Smith GURPS Data File Coordinator GURPSLand I shall pull the pin from this healing grenade and... Kaboom-baya. |
06-05-2009, 04:34 PM | #3 | |||
Join Date: Aug 2004
Location: Ronkonkoma, NY
|
Re: #Choice syntax
Quote:
Quote:
Quote:
|
|||
06-05-2009, 09:51 PM | #4 | |
Join Date: Feb 2006
Location: Krotz Springs, LA US
|
Re: #Choice syntax
Quote:
That's about the extent of my knowledge here, unfortunately.
__________________
Thomas M. EDWARDS <tmedwards@motoslave.net> GCA4 resources: GCA Repository, Phoenix (r66), GMCS (2.17), Bookish (r12) |
|
06-06-2009, 06:28 AM | #5 |
Join Date: Aug 2004
Location: Ronkonkoma, NY
|
Re: #Choice syntax
Ah, okay. So I put the concatenation of name() + "aliaslist" (surrounded by %s) somewhere in the item. The #ChoiceList will display the list() to the user and return his choice as the corresponding item from aliaslist() to wherever the variable is in the item.
I see that the Mechanic skill uses %examplelist% instead of %examplealiaslist%, and it has a list() but no aliaslist(). Thus, you can use %namelist% as well, if you don't need an aliaslist(). I suppose the aliaslist() corresponds to the list() in a one-to-one manner? The name() tag, therefore, lets you use more than one #ChoiceList in an item, by naming your variable. I'll bet all this would work for just plain old #Choice too... Thanks! That helps a lot! |
06-06-2009, 08:57 AM | #6 | ||
Join Date: Aug 2004
Location: Binghamton, NY, USA. Near the river Styx in the 5th Circle.
|
Re: #Choice syntax
Quote:
Quote:
There's more information here and here as well.
__________________
Eric B. Smith GURPS Data File Coordinator GURPSLand I shall pull the pin from this healing grenade and... Kaboom-baya. |
||
06-06-2009, 05:59 PM | #7 |
Join Date: Aug 2004
Location: Ronkonkoma, NY
|
Re: #Choice syntax
Ah! I hadn't seen those before. Thanks!
|
Tags |
gca |
|
|