PDA

View Full Version : Dynamic tab names


BoomerET
November 19th, 2013, 04:08 PM
Is it possible to create a tab where the name= is dynamic.

I tried using CDATA, without any success.

As it stands right now, I have multipe tab_xxx files, one for each class and race, but was wondering if I could somehow use a dynamic name so I can have one tab configuration file instead of 20.

It's easy enough to create each one, as it's just copy/paste, but all the information is duplicated.


BoomerET

Mathias
November 19th, 2013, 04:28 PM
This is an advanced topic that's not currently covered in the wiki, I'm sorry to say - there's a mechanism called agent linkages that allows you to create a single tab that gets re-used for any specific thing that's derived from a particular component.

Mathias
November 19th, 2013, 04:38 PM
Here are some pieces from Pathfinder's panel_class.dat file that will hopefully help you figure out how to implement this:



<!-- Class panel -->
<panel
id="Class"
name="Class"
order="150"
marginhorz="5"
marginvert="5"
agentcompset="Class"
agentlive="ClsTabLive"
agentname="shortname">


agentlive must be an <identity> tag on the compset, and it's tested in the hero context to determine whether to show this tab or not.

And here's how it looks in an individual table:



<!-- SPELLBOOK FORM - list of spells in the spellbook for this class -->
<portal
id="ClsBook"
style="Table">
<table_dynamic
component="BaseSpell"
showtemplate="sPick"
choosetemplate="sThing"
descwidth="300"
addspace="3"
showsortset="Spell"
choosesortset="Spell"
useagentadd="yes"
useagentcandidate="yes"
agentlist="Spellbook"
agentautotag="Spellbook"
useagentlinkage="yes"
candidatefield="cSplBkExpr"
columns="3"> <!-- Note - NOT linked to helper object -->
<list><![CDATA[
!Helper.CustomItem & !Hide.Spell & !Helper.Obsolete
]]></list> <!-- Don't want to see the custom spell -->
<restriction>TRUE</restriction> <!-- Only learn spells once -->
<titlebar><![CDATA[
@text = "Choose your " & lowercase(agent.field[cSpBkName].text) & " " & lowercase(agent.field[cSpellName].text) & "."
]]></titlebar>

BoomerET
November 19th, 2013, 04:51 PM
Zoiks, I've got a lot to learn obviously.

Thanks Mathias for your help, I appreciate it.


BoomerET

RavenX
March 21st, 2014, 01:33 PM
Mathias, what compset is the "shortname" field defined in?

Mathias
March 21st, 2014, 02:04 PM
Find the wiki page that covers how components are defined - take a look through all the settings there.

RavenX
March 21st, 2014, 02:07 PM
I figured out that I needed a hasshortname="yes" in the component. Do I have to define the shortname field on each class or is it automatically defined?

Mathias
March 21st, 2014, 03:33 PM
shortname defaults to = name if nothing else is entered. In d20/Pathfinder, most classes don't set a different shortname - the only exceptions are the ones with really long names, who use an abbreviation or other way of shortening the name.