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 11-23-2018, 05:28 PM   #31
Refplace
 
Refplace's Avatar
 
Join Date: Nov 2008
Location: Yukon, OK
Default Re: Making Pick lists

Latest issue.
My goal with this new bit of code is to build a spell as a Technique of skills on the character sheet with the cat(Affinity).
A lot of the code works but this choicelist section seems to get skipped.
I created a short test item to try and work out the syntax but so far no go.

Code:
	_New Select Test type(Tech/A), mods(Spells)
#Select1(text("Pick the Affinity Skill this is based on"), 
List(_
#BuildSelectList(skills where (cat) includes "Affinity", template ([Choose Affinity Skill this technique is based on]%ListItem%)),
	)_
	)_
__________________
My GURPS publications GURPS Powers: Totem and Nature Spirits; GURPS Template Toolkit 4: Spirits; Pyramid articles. Buying them lets us know you want more!
My GURPS fan contribution and blog:
REFPLace GURPS Landing Page
My List of GURPS You Tube videos (plus a few other useful items)
My GURPS Wiki entries

Last edited by ericbsmith; 11-23-2018 at 07:19 PM. Reason: Accidentally edited Refplace's message instead of replying to it.
Refplace is offline   Reply With Quote
Old 11-23-2018, 07:16 PM   #32
ericbsmith
 
ericbsmith's Avatar
 
Join Date: Aug 2004
Location: Binghamton, NY, USA. Near the river Styx in the 5th Circle.
Default Re: Making Pick lists

First, #BuildSelectList only drags in traits that are already on the character (so they can be upgraded or modified). If that is your intention you can use it, otherwise you need to use #BuildList and specify a[LISTS] or just write out the individual items in the list in the comma separated style.

Code:
_New Select Test type(Tech/A), mods(Spells)
#Select1(text("Pick the Affinity Skill this is based on"), 
          List(_
                #List(AffinitySkills)_
               )_
               ),
or:

Code:
_New Select Test type(Tech/A), mods(Spells)
#Select1(text("Pick the Affinity Skill this is based on"), 
          List(_
                "SK:Fu",
                "SK:Foo",
                "SK:Bar",
                "SK:Kung"_
               )_
               ),
__________________
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 11-23-2018, 07:30 PM   #33
Refplace
 
Refplace's Avatar
 
Join Date: Nov 2008
Location: Yukon, OK
Default Re: Making Pick lists

Quote:
Originally Posted by ericbsmith View Post
First, #BuildSelectList only drags in traits that are already on the character (so they can be upgraded or modified). If that is your intention you can use it, otherwise you need to use #BuildList and specify a[LISTS] or just write out the individual items in the list in the comma separated style.

Code:
_New Select Test type(Tech/A), mods(Spells)
#Select1(text("Pick the Affinity Skill this is based on"), 
          List(_
                #List(AffinitySkills)_
               )_
               ),
or:

Code:
_New Select Test type(Tech/A), mods(Spells)
#Select1(text("Pick the Affinity Skill this is based on"), 
          List(_
                "SK:Fu",
                "SK:Foo",
                "SK:Bar",
                "SK:Kung"_
               )_
               ),
Ah no / for the code tag here.
And yes I want to build the techniques off skills already on the charecter. That way its a much smaller list. My Affinity system is a mix of Book/Path and Ritual magic but includes rules for player designed Affinities (Like Paths or Colleges) so there can be a LOT of them to choose from.
Ok, trying that code now ty
__________________
My GURPS publications GURPS Powers: Totem and Nature Spirits; GURPS Template Toolkit 4: Spirits; Pyramid articles. Buying them lets us know you want more!
My GURPS fan contribution and blog:
REFPLace GURPS Landing Page
My List of GURPS You Tube videos (plus a few other useful items)
My GURPS Wiki entries
Refplace is offline   Reply With Quote
Old 11-23-2018, 08:14 PM   #34
Refplace
 
Refplace's Avatar
 
Join Date: Nov 2008
Location: Yukon, OK
Default Re: Making Pick lists

Hmm that did not work, I tried some changes and currently using
[CODE]
_New Select Eric type(Tech/A), mods(Spells),
#Select1(text("Pick the Affinity Skill this is based on"),
List(_
#BuildSelectList(AffinitySkills)_
)_
),

[Code]

It just puts the name of the skill _New Select Eric and does not ask for a choice from a list. The full code also seems to skip that section, though the rest of it works as intended. Though until I get the skill to base the Technique in there I wont know for sure.
[CODE]
<%NewSpellList%>
_New Form Skill A (%newspelllist% Affinity), type(Tech/A), mods(Spells), cat(%newspelllist%, Affinity), shortcat(%newspellaliaslist%, AF), class(Affinity), time(var), duration(var), needs("SK:Symbol Drawing"), castingcost([castingcost]),
x(#InputToTagReplace("Please enter the name of this spell:", name, , "New Spell"),
#InputReplace("Please enter the Casting Cost of this spell:", "[castingcost]", "New Spell"),
#Select1(text("Pick the Affinity Skill this is based on"),
List(_
#BuildSelectList(skills where (cat) includes "Affinity", template ([Choose Affinity Skill this technique is based on]%ListItem%)),
)_
)_
#Select1(text("Pick the Affinity Skill this is based on"),
List(_
#BuildSelectList(AffinitySkills)_
)_
),
#ChoiceList(_
name(newspell),
title(New Spell: Choose a Spell Type),
text(Chose the Spell Type from the list below),
picksallowed(1),
method(bynumber),
list(_
"Attack",
"Barrier",
"Binding",
"Bonus and Penalties",
"Calling",
"Communication",
"Concealment and Observation",
"Control and Shape",
"Create",
"Healing and Restoration",
"Information",
"Movement",
"Protection",
"Purify and Refinement",
"Seek and Identification",
"Special Effects",
"Summoning",
"Transformation",
"Work",
"User Defined" _
),

),
#edit _
), noresync(yes)

[CODE]

Here is an example skill it shouldpull from.
<AffinitySkills>

Affinity (Beauty), type(IQ/A), default(SK:Ritual Magic - 6, SK:Symbol Drawing - 6, SK:Thaumatology - 6), needs(SK:Ritual Magic | SK:Symbol Drawing | SK:Thaumatology), upto(SK:Ritual Magic), page(00), cat(Affinity)
__________________
My GURPS publications GURPS Powers: Totem and Nature Spirits; GURPS Template Toolkit 4: Spirits; Pyramid articles. Buying them lets us know you want more!
My GURPS fan contribution and blog:
REFPLace GURPS Landing Page
My List of GURPS You Tube videos (plus a few other useful items)
My GURPS Wiki entries
Refplace is offline   Reply With Quote
Old 11-24-2018, 02:24 AM   #35
Refplace
 
Refplace's Avatar
 
Join Date: Nov 2008
Location: Yukon, OK
Default Re: Making Pick lists

Quote:
Originally Posted by ericbsmith View Post
First, #BuildSelectList only drags in traits that are already on the character (so they can be upgraded or modified). If that is your intention you can use it, otherwise you need to use #BuildList and specify a[LISTS] or just write out the individual items in the list in the comma separated style.
Do you know an example that uses this function in the data files?
So far no variation I tried works but if I can see a working example maybe that will help.
The goal is to build a list to pick from of skills already on the sheet.
__________________
My GURPS publications GURPS Powers: Totem and Nature Spirits; GURPS Template Toolkit 4: Spirits; Pyramid articles. Buying them lets us know you want more!
My GURPS fan contribution and blog:
REFPLace GURPS Landing Page
My List of GURPS You Tube videos (plus a few other useful items)
My GURPS Wiki entries
Refplace is offline   Reply With Quote
Old 11-24-2018, 10:39 AM   #36
Armin
GCA Prime
 
Armin's Avatar
 
Join Date: Aug 2004
Location: Portland, OR
Default Re: Making Pick lists

I think Eric got a little confused because he read your code first, and that planted an incorrect seed into his brain. That's easy with stuff as esoteric as this.

SelectX() is a tag() for templates, not a #directive. It will never work to use #SelectX as a directive.

Aside from that, SelectX() is for picking actual traits, not text. This is something that confuses people all the time, so I tried to make it clear in my screed a while back: you have to keep straight when you're working with text, which GCA will manipulate to create a trait at the end of the process, and when you're working with a trait, which can't be inserted into the trait that's currently being built.

You're building a technique, and you want to insert a piece of text that references an existing trait. You need to use #ChoiceList here.

Then, because you're no longer using a SelectX(), you can't use #BuildSelectList either, since that only works inside SelectX().

Instead, you can use #BuildCharItemList(), which is almost identical to #BuildSelectList, but is a standard directive. The structure is even the same. (Both #BuildCharItemList and #BuidlSelectList are used pretty extensively in various complex templates for After the End or Dungeon Fantasy.)

Okay?

So, #ChoiceList in your technique definition, building the list() with #BuidlCharItemList. With that in mind, this is almost the same as the skills/spells you were building before, so scroll up to the _CoreTest technique you did earlier in this thread, and use that as your template for this. it's the same type of item, so it's the same type of process.

Instead of a #GroupList to create a list, we'll use a #BuildCharItemList, like this one:

#BuildCharItemList(skills where cat includes "Affinity", template(%ListItem%))

Code:
		#ChoiceList(_
				name(ExistingSkill),
				title(Skill),
				text(Please select a skill to base off of:),
				picksallowed(1),
				method(bynumber),
				default(1),
				list(_
					#BuildCharItemList(skills where cat includes "Affinity", template(%ListItem%))_
					)_
				)_
The final result should be something like this example:

Code:
_Example Technique, type(Tech/A), default(SK:%ExistingSkill% - 6), needs(SK:%ExistingSkill%), upto(SK:%ExistingSkill%),
	x(_
		#ChoiceList(_
				name(ExistingSkill),
				title(Skill),
				text(Please select a skill to base off of:),
				picksallowed(1),
				method(bynumber),
				default(1),
				list(_
					#BuildCharItemList(skills where cat includes "Affinity", template(%ListItem%))_
					)_
				)_
	)
I have not tested this. But this should provide a decent template for what you're trying to accomplish.

What that does is use the #BuildCharItemList to get a list of all the existing traits on the character that have "Affinity" in the cat() tag, and put that list into the #ChoiceList for the user to pick one. Once the user picks one, it puts that choice into the technique definition.

Note: if there aren't any appropriate skills already on the character, the list will be empty and no selection can be made, so you should probably put some kind of default suggestion in there, so the user gets something to pick as you'd expect.
__________________
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 11-24-2018, 02:55 PM   #37
Refplace
 
Refplace's Avatar
 
Join Date: Nov 2008
Location: Yukon, OK
Default Re: Making Pick lists

Thanks Armin, Ill test it in an hour or so (on errands).
Edit: Tried it and it worked, now trying to integrate it into the main code.
Also answered my other question that I just deleted. TY
__________________
My GURPS publications GURPS Powers: Totem and Nature Spirits; GURPS Template Toolkit 4: Spirits; Pyramid articles. Buying them lets us know you want more!
My GURPS fan contribution and blog:
REFPLace GURPS Landing Page
My List of GURPS You Tube videos (plus a few other useful items)
My GURPS Wiki entries

Last edited by Refplace; 11-24-2018 at 04:59 PM.
Refplace is offline   Reply With Quote
Old 11-24-2018, 08:31 PM   #38
Refplace
 
Refplace's Avatar
 
Join Date: Nov 2008
Location: Yukon, OK
Default Re: Making Pick lists

Ok, finally got it working! Only thing it wont do is work properly with upto() but Ill try a few more attempts tomorrow. If not I can live with this code as it does everything I need and I think I can use it as a base for the other spell technique with few changes.
In case anyone is interested in the final product I include it below.
It Looks at the Affinity Skills (which could be Book/Path or Ritual Magic colleges) asks for the casting cost, default penalty, and spell type (Kind of like Regular, Area, etc or the Effects in RPM) and displays a title that shows
"spell name" Skill its based off of and FP cost.
Code:
<%NewSpellList%>
_New Mandela2 (%newspelllist%, %ExistingSkill%, [castingcost] FP), type(Tech/A), default("SK:%ExistingSkill%" + ([penalty])), mods(Spells), cat(%newspelllist%, Affinity), shortcat(%newspellaliaslist%, AF), class(Affinity), time(var), duration(var), castingcost([castingcost]),
	x(#InputToTagReplace("Please enter the name of this spell:", name, , "New Spell"),
	  #InputReplace("Please enter the Casting Cost of this spell:", "[castingcost]", "1"),
          #InputReplace("Please enter the skill penalty:", "[penalty]", "-2"),
          #ChoiceList(_
				name(ExistingSkill),
				title(Skill),
				text(Please select a skill to base off of:),
				picksallowed(1),
				method(bynumber),
				default(1),
				list(_
					#BuildCharItemList(skills where cat includes "Affinity", template(%ListItem%)),
                                        )_
		   )_
	  #ChoiceList(_
			name(newspell),
			title(New Spell: Choose a Spell Type),
			text(Chose the Spell Type from the list below),
			picksallowed(1),
			method(bynumber),
			list(_
				"Attack",
				"Barrier",
				"Binding",
				"Bonus and Penalties",
                                "Calling",
				"Communication",
                                "Concealment and Observation",
                                "Control and Shape",
                                "Create",
                                "Healing and Restoration",
                                "Information",
                                "Movement",
                                "Protection",
                                "Purify and Refinement",
                                "Seek and Identification",
                                "Special Effects",
                                "Summoning",
                                "Transformation",
                                "Work",
				"User Defined" _
				),
			
			),
		#edit _
	), noresync(yes)
I really want to thank both Armin and Eric for your help, I definitely have not mastered GCA with this exercise but I know a lot more of it than when I started!
__________________
My GURPS publications GURPS Powers: Totem and Nature Spirits; GURPS Template Toolkit 4: Spirits; Pyramid articles. Buying them lets us know you want more!
My GURPS fan contribution and blog:
REFPLace GURPS Landing Page
My List of GURPS You Tube videos (plus a few other useful items)
My GURPS Wiki entries

Last edited by Refplace; 11-24-2018 at 08:39 PM.
Refplace is offline   Reply With Quote
Old 11-24-2018, 09:52 PM   #39
Armin
GCA Prime
 
Armin's Avatar
 
Join Date: Aug 2004
Location: Portland, OR
Default Re: Making Pick lists

You're welcome!

For techniques, you should be able to do upto(prereq + 4) or such a similar construction. GCA should replace the prereq bit internally with the skill from needs(), which for techniques is usually also the skill being defaulted from. I have found it to be a bit finicky in practice, but lots of techniques are built with it, and it generally seems to work for them, so you may want to try that, if you want to put a needs() back into your technique and see if it that works.
__________________
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 11-24-2018, 11:16 PM   #40
Refplace
 
Refplace's Avatar
 
Join Date: Nov 2008
Location: Yukon, OK
Default Re: Making Pick lists

Quote:
Originally Posted by Armin View Post
You're welcome!

For techniques, you should be able to do upto(prereq + 4) or such a similar construction. GCA should replace the prereq bit internally with the skill from needs(), which for techniques is usually also the skill being defaulted from. I have found it to be a bit finicky in practice, but lots of techniques are built with it, and it generally seems to work for them, so you may want to try that, if you want to put a needs() back into your technique and see if it that works.
I tried %value% [value] and both with and without quotation marks, it just does not seem to work for me. I got it working the other day but broke it changing something and never have been able to get it working reliably.
__________________
My GURPS publications GURPS Powers: Totem and Nature Spirits; GURPS Template Toolkit 4: Spirits; Pyramid articles. Buying them lets us know you want more!
My GURPS fan contribution and blog:
REFPLace GURPS Landing Page
My List of GURPS You Tube videos (plus a few other useful items)
My GURPS Wiki entries
Refplace 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 12:30 AM.


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