Senior Member
Volunteer Data File Contributor
Join Date: Nov 2009
Posts: 1,502
|
As I have covered before, I have a situation where Skills in my system (Planet Mercenary) can have Specialties added to them under certain circumstances (namely, specialties are particular to a given skill, most specialties are unique and can only be added once, and you can't have more specialties than you have ranks in the skill). At the time, it seemed the easiest way to do it was by borrowing some code from the Doctor Who implementation and setting up a Gizmo on the skills so that I could set up field that limited the Specialty choices to those that match up to the skill.
Code:
<portal id="prtSpec" style="tblNormal"> <table_dynamic component="Specialty" showtemplate="SpecPick" choosetemplate="SpecPick2" scrollable="yes" alwaysupdate="yes" candidatepick="SpecHelp" candidatefield="SpecExpr" addpick="SpecHelp"> <titlebar><![CDATA[ @text = "Add a Specialty" ]]></titlebar> <!--headertitle><![CDATA[ @text = "Specialty" ]]></headertitle--> <additem><![CDATA[ @text = "Add Specialty" ]]> </additem> </table_dynamic> </portal> Code:
<procedure id="SetSpcExpr" context="pick"><![CDATA[ ~make sure there's a gizmo to travel to doneif (isgizmo = 0) ~set up our tag expression for selecting appropriate specialty var expr as string var myId as string expr = "component.Specialty & " & myId debug "expr: " & expr gizmo.childfound[SpecHelp].field[SpecExpr].text = expr ]]></procedure> TL;DR: Is there any way to set the "target" of the table to be the Hero instead of the Skill? Since skills are never deleted, there should never be a situation where it matters where the Specialty resides. I can also provide more code. I'm trying to only quote the relevant bits. |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
This is why, for Shadowrun, we didn't use gizmos for its skill specialties - all the specialties are in the hero container, and use tags and careful control of the visual elements to set things up so that the user only ever sees them attached to the correct skill.
You can shadow things down to a lower-level container, but there's no way to reverse-shadow, and get them to appear up a container level. |
#2 |
Senior Member
Volunteer Data File Contributor
Join Date: Nov 2009
Posts: 1,502
|
{nods} So I might have to change where the items are stored... is there any way to at least keep the link so that the user selects Specialties for a given skill rather than from a grand list?
|
#3 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
Never mind - I was totally mis-remembering things.
It's that the normal specialties for a skill are added as child picks in the skill's gizmo, but then for specialties added from outside, those live in the hero pick. They use a script to add their name to a text field on the skill, and for the final display of that skill's name, with the specialties included, that list of external specialties is combined with the list of specialties inside the gizmo, in a way that makes it look to the user like everything is together. When you look at the customization form for a skill, since in Shadowrun, external specialties can only be added in advancement mode, not in creation mode, in advancement mode, the table for adding specialties is not shown - instead, a text portal displays the combined list of specialties. |
#4 |
Thread Tools | |
Display Modes | |
|
|