Steve Jackson Games - Site Navigation
Home General Info Follow Us Search Illuminator Store Forums What's New Other Games Ogre GURPS Munchkin Our Games: Home

Go Back   Steve Jackson Games Forums > Roleplaying > GURPS > GURPS Character Assistant

Reply
 
Thread Tools Display Modes
Old 02-18-2024, 01:15 PM   #1
Angel Darkover
 
Join Date: Mar 2006
Location: Seattle, WA
Default Question about #ChoiceList

I have a question about #Choicelist. Specifically, how do I use multiple #ChoiceList structures within a single trait (specifically a modifier but it should be the same regardless of type of trait)? Inspecting select() examples, they get numbered but that doesn't seem to work for #ChoiceList. Putting multiple #ChoiceList into the modifier does prompt for each of them, but it doesn't resolve the variables into the values assigned. Can anyone explain to me how it works for multiple #ChoiceList options?

Thanks in advance.
__________________
Madness takes its toll. Please have correct change.
Angel Darkover is offline   Reply With Quote
Old 02-18-2024, 01:31 PM   #2
Stormcrow
 
Join Date: Aug 2004
Location: Ronkonkoma, NY
Default Re: Question about #ChoiceList

Give each #ChoiceList a separate name(), then use each name as a variable elsewhere in the trait.
Stormcrow is offline   Reply With Quote
Old 02-18-2024, 07:41 PM   #3
Armin
GCA Prime
 
Armin's Avatar
 
Join Date: Aug 2004
Location: Portland, OR
Default Re: Question about #ChoiceList

What Stormcrow said.

GCA Data File Reference Guide

Page 131. Note the name(ChoiceName) and how the result variables on p. 133 use ChoiceName, so replace that with the name specified instead of ChoiceName. Then profit!
__________________
Armin D. Sykes | Visit my GCA5 blog for updates and previews. | Get GURPS Character Assistant 5 now at Warehouse 23.
Armin is offline   Reply With Quote
Old 02-19-2024, 03:26 AM   #4
Angel Darkover
 
Join Date: Mar 2006
Location: Seattle, WA
Default Re: Question about #ChoiceList

Thanks for the answers, but I was actually already doing that. Here is the code that I am using.

Code:
Cyclic (Every %IntervalName%, [Cycles] cycles, %ResistableName%, %ContagiousName%), 0%, page(B103, P101, campaign wiki), _
    Formula((%IntervalNameAlias%*[Cycles]*%ResistableNameAlias%)+%ContagiousNameAlias%), ForceFormula(Yes), _
    x(_
        #InputReplace("Please enter the total number of cycles after the initial effect:", "[Cycles]", "2", "Total Cycles"), _
        #CHOICELIST(_
            LIST(1 second, 10 seconds, 1 minute, 1 hour, 1 day), _
            NAME(Interval), _
            TITLE(Interval Between Cycles), _
            TEXT(Please indicate the interval between cycles:), _
            ALIASLIST(100, 50, 40, 20, 10), _
            PICKSALLOWED(EXACTLY 1), _
            METHOD(BYNUM)), _
        #CHOICELIST(_
            LIST(Resistable, Not Resistable), _
            NAME(Resistable), _
            TITLE(Resistable Effect), _
            TEXT(Please indicate whether or not the interval effect is potentially resistable:), _
            ALIASLIST(0.5, 1), _
            PICKSALLOWED(EXACTLY 1), _
            METHOD(BYNUM)), _
        #CHOICELIST(_
            LIST(Not Contagious, Mildly Contagious, Highly Contagious), _
            NAME(Contagious), _
            TITLE(Contagious Effect), _
            TEXT(Please indicate whether or not the interval effect is contagious and, if so, how contagious:), _
            ALIASLIST(0, 20, 50), _
            PICKSALLOWED(EXACTLY 1), _
            METHOD(BYNUM)))
As you can see, they have different names and variable expectations.

Adding the modifier, to verify that the formula works, I used 10 cycles, 1 second, not resistable, and highly contagious for the respective prompts.
The resulting name extension is "Every %IntervalName%, 10 cycles, %ResistableName%, %ContagiousName%" and the formula is "(%IntervalNameAlias%*10*%ResistableNameAlias%)+%C ontagiousNameAlias%" so the #ChoiceList variables are not resolving to their values.

For more information, I am creating spell modifiers as per MyGURPS: Modifying Spells, similar to the Thaumatology rules. It shouldn't matter, but I figured I would add it in case it does.

For testing purposes, I was using a brand new blank character and the Deathtouch spell as the target trait. I first added Ambidexterity (for Body Control prereqs) then added Deathtouch, picking the first prereqs option and letting it auto-add all needs. Then I add the modifier to the Deathtouch spell. Consistently repro-able.

Also, if it matters, here are the books that I am adding (in order) prior to my custom data file:
GURPS Basic Set 4th Ed.--Characters
GURPS Martial Arts 4e
GURPS Fantasy 4e
GURPS Magic 4e
GURPS Magic 4e - Clerical Magic
GURPS Psionic Powers 4e
GURPS Low-Tech 4e
GURPS Low-Tech Companion 2 - Weapons and Warriors
GURPS Low-Tech Companion 3 - Daily Life and Economics
GURPS Power-Ups 3 Talents
GURPS Power-Ups 2 Perks 4e

If it helps uncover what is going on, I also found that if the #InputReplace was second in the X() rather than first, it wouldn't even proc. Moving it to first allowed to proc and, as it shows above, resolves its variable just fine.
__________________
Madness takes its toll. Please have correct change.
Angel Darkover is offline   Reply With Quote
Old 02-19-2024, 07:04 AM   #5
ericbsmith
 
ericbsmith's Avatar
 
Join Date: Aug 2004
Location: Binghamton, NY, USA. Near the river Styx in the 5th Circle.
Default Re: Question about #ChoiceList

Haven't tested this, but I'm pretty sure the formula line should be:
Code:
Formula((%IntervalAlias%*[Cycles]*%ResistableAlias%)+%ContagiousAlias%), ForceFormula(Yes), _
The naming schema is always "%NameTag%" where Name is the name of the variable in the name() field and tag() is the name of the other tag field you're referencing. So IntervalName brings out the name() tag of the name(Interval) variable. IntervalNameAlias would bring out the alias() tag of the name(IntervalName) variable, which is obviously not the variable name you're looking to reference.
__________________
Eric B. Smith GURPS Data File Coordinator
GURPSLand
I shall pull the pin from this healing grenade and...
Kaboom-baya.
ericbsmith is offline   Reply With Quote
Old 02-19-2024, 08:42 AM   #6
Stormcrow
 
Join Date: Aug 2004
Location: Ronkonkoma, NY
Default Re: Question about #ChoiceList

Quote:
Originally Posted by Angel Darkover View Post
Adding the modifier, to verify that the formula works, I used 10 cycles, 1 second, not resistable, and highly contagious for the respective prompts.
The resulting name extension is "Every %IntervalName%, 10 cycles, %ResistableName%, %ContagiousName%" and the formula is "(%IntervalNameAlias%*10*%ResistableNameAlias%)+%C ontagiousNameAlias%" so the #ChoiceList variables are not resolving to their values.
You've got a #ChoiceList with name(Interval), then you try to reference the variable with %IntervalName%, but that's not how it works. See page 133 of the reference document Armin mentioned. For instance:
  • %Interval% would give you the first option the user selected (such as "1 second").
  • %IntervalAlias% would give you the alias of the first option the user selected (such as "100").
  • %IntervalList% would give you every option the user selected, as a list (if you could pick more than one of those options, it might be "1 second, 10 seconds, 1 hour").
  • %IntervalAliasList% would give you the aliases of every option the user selected, as a list (those options would have an alias list of "100, 50, 20").

And there are a lot of other options there. Wherever the documentation says "ChoiceName," that's where you substitute in the name of your #ChoiceList.

Quote:
If it helps uncover what is going on, I also found that if the #InputReplace was second in the X() rather than first, it wouldn't even proc. Moving it to first allowed to proc and, as it shows above, resolves its variable just fine.
This is a separate issue I was talking to Armin about just the other day. It's a bug in the way GCA processes directives. He's working on it.
Stormcrow is offline   Reply With Quote
Old 02-19-2024, 02:12 PM   #7
Angel Darkover
 
Join Date: Mar 2006
Location: Seattle, WA
Default Re: Question about #ChoiceList

Thank you both for the answers. I did read the documentation (I am referencing it frequently throughout this process), but I evidently misinterpreted it. Somehow I thought "Name" was separate from the choice itself. I'm glad to know that it was a simple user error that I can easily fix.

Again, thank you to all who contributed.
And thank you even more, Armin, for providing such a versatile tool to support our gaming needs.
__________________
Madness takes its toll. Please have correct change.
Angel Darkover is offline   Reply With Quote
Old 02-19-2024, 03:55 PM   #8
Armin
GCA Prime
 
Armin's Avatar
 
Join Date: Aug 2004
Location: Portland, OR
Default Re: Question about #ChoiceList

Thanks for the help, Stormcrow and Eric.

Thanks, Angel Darkover, and good luck with your project!
__________________
Armin D. Sykes | Visit my GCA5 blog for updates and previews. | Get GURPS Character Assistant 5 now at Warehouse 23.
Armin is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Fnords are Off
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 10:46 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2024, vBulletin Solutions, Inc.