• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Still not getting the Make a Tab to work

Okay I noticed that Savage worlds does not use "classes" for characters so I have a question on building the following:
I would like to have a Tab (before the basic in the line up) this tab would be called the Clan Tab
its purpose is to do the following in character creation
1. the player picks a clan
this starts the player towards the character build, once the clan is selected
2. the Player picks a family from with the groups that belong to the picked Clan
3. then the player picks the school which the character is trained in.

Clan sets up for family choices, family gives player bouns to trait (+1 to specific w/ a few that allow free choice by player), the school is the big build. Schools also give a +1 bonus to trait (+1 to specific w/ a few that allow free choice by player) but it also gives the characters starting skills (free for CP cost), equipment and money, starting score in Honor (rank) special techniques (abilities/powers) the character can use at each rank (gaining new techniques each rank (aka Level).

4. After that the character has one heritage roll for free (to help build background) and may take 2 more for 1 CP each (these give sometimes extras such as advantages/disadvantages, skills, +/- to honor, status, glory or sometimes items.

I have put in families (for now was races) but I do not know how to make the above "tab" work or if it should be in the first panel that pops up before you get into the system. I am including examples of the Family (they are pretty simple to add) and what a base school would look like but it is not code ready just an outline.

From the Crab Clan a family
<thing
id="racHida"
name="Crab Clan Hida Family"
compset="Race"
isunique="yes"
description="The Hida family are the leaders of the Crab. Their family motto is; I will not fail. No other family holds their duty in such high regard as the Hida. It is the largest family in the Crab, and dominate the political life of the clan. They plan military tactics, lead the armies and co-ordinate the defenses of the clan. (Trait Bonus +1 Strenght)">
<eval value="1" phase="PreTraits" priority="5000">
<before name="Calc trtFinal"/><![CDATA[
~apply whatever adjustment(s) are needed here
~hero.child[resAbility].field[resMax].value += 1
#traitbonus[attrStr] += 1
]]></eval>

</thing>

What I would like to have from a school (my working outline) also from the Crab family

# Yasuki Courtier

<thing
id="schYasuki"
name="Yasuki Courtier School"
compset="School"
isunique="yes"
*** need to tie in for character creation***
clan = "Crab"
type = "courtier"
honor = "1.5"
skills = ["Commerce (Merchant)",
"Courtier",
"Deceit (Lying)",
"Etiquette (Bureaucracy)",
"Stealth",
"1|Any (Low)",
"1|Any (Bugei)"]
outfit = [ "Wakizashi",
"Courtly Dress",
"Finger of Jade",
"Kimono",
"Sandals",
"Traveling Pack",
"10|Koku" ]
technique for each Rank 1-5
technique[1] = technique("Way of the Carp")
technique[1].description = ""
technique[1].effect = ""
technique[2] = technique("Shimmering Scales")
technique[2].description = ""
technique[2].effect = ""
technique[3] = technique("Wiles of the Carp")
technique[3].description = ""
technique[3].effect = ""
technique[4] = technique("Treasures of the Carp")
technique[4].description = ""
technique[4].effect = ""
technique[5] = technique("All That You Have is Mine")
technique[5].description = ""
technique[5].effect = ""
description="description Goes here. (Trait Bonus +1 perception)">
<eval value="1" phase="PreTraits" priority="5000">
<before name="Calc trtFinal"/><![CDATA[
~apply whatever adjustment(s) are needed here
~hero.child[resAbility].field[resMax].value += 1
#traitbonus[attrPerc] += 1

]]></eval>
</thing>

Now once a Clan is picked the character can pick any family and any school with in the clan, the multi school or different school advantages allow training outside of the clan picked at creation, also once a character reaches rank (lvl) 6 the character must move to an advanced school (but this is something that I would think should be handled later unless it is better to do in the mechanics at the start?
 
That's a *lot* of material to address. I'm going to try answering in pieces, just to keep everything compartmentalized better. Otherwise, we're *both* going to end up confused on this stuff, and that's not going to end up very well. :-)

Since there will be a number of different sub-topics that I'm about to create, please be sure to quote liberally so I've got full context for follow-up questions.
 
I would like to have a Tab (before the basic in the line up) this tab would be called the Clan Tab

Positioning a new tab is easy. Simply set the "order" attribute appropriately. All tabs are shown based on the "order" assigned to them. To make things easier in this regard, the Skeleton files use numbering with gaps. You can slot in a new first tab by simply assigning it a value of, say, 50. Or you can change the numbering of multiple tabs to sequence them the way you want.
 
I would like to have a Tab (before the basic in the line up) this tab would be called the Clan Tab
its purpose is to do the following in character creation
1. the player picks a clan
this starts the player towards the character build, once the clan is selected
2. the Player picks a family from with the groups that belong to the picked Clan
3. then the player picks the school which the character is trained in.

Since you are very visual person, it's probably best for you to start out with the visual elements and then slot the behaviors into the visual framework. So you should start out by creating a tab and then populating it with content.

Let's think about how it would look. This new tab would contain four sections in it, with each corresponding to the three steps listed above, plus one for heritage. I would envision using four separate layouts for the tab, one for each section.

Each section would have a title across the top (e.g. "Clan", "Family", etc.). On the left would be a chooser where the user selects the appropriate option. On the right would be a description area where pertinent details about the selected option would be shown. This would *not* be just the description text. It would be a summary of important aspects of the selection, such as the +1 Strength for Crab.

Note: Please initially leave the "description" area I refer to above as an empty area or just a big multiline text portal with nothing in it for now. Don't complicate things by trying to implement everything at once. Figure out where everything will go, but only implement the pieces you truly need, then iteratively evolve what you do.

When first adding the tab, start with a single layout for the clan. Once that's in place and working, you can then add the family section/layout. Then you can add the school section/layout. Remember, small incremental steps are your friend. They ensure that any problems that arise are known to occur within only the few things you actually changed since the last step. :-)

When creating the initial layout, it will consist of three elements. The title across the top is a simple portal. The chooser is another portal. And the description text is a third portal. You don't need to display any templates. At this point, the chooser doesn't actually have to *do* anything useful. We'll worry about that later.

Once the initial layout is showing up properly, then you can add the remaining layouts. Just setup the layouts with the same basic structure and contents (i.e. title, chooser, and label). Set their respective heights properly within the panel's Position script to one-fourth of the overall panel height. Once they are all appearing correctly, you can start working on the mechanics.
 
Last edited:
1. the player picks a clan
this starts the player towards the character build, once the clan is selected

The clan chooser will be simple. It just lists the various clans and allows the user to pick one. No special handling is needed. So all you need to do is assign the proper component restriction and it should just work. You can use the "LargeItem" template for selecting the clan.
 
2. the Player picks a family from with the groups that belong to the picked Clan

family gives player bouns to trait (+1 to specific w/ a few that allow free choice by player)

The family chooser will be a little more complex. You need to limit the family to only those for the selected clan. To start with, though, keep it simple. Setup the chooser just like you did for the family. The only problem with this is that you'll be able to pick *any* family initially - not just the ones for the selected clan. That's fine for an initial start.

You'll also need to add a menu portal beneath the chooser. This menu will allow the user to pick the trait when the family allows choosing it. For the menu, the user will select one of the traits, so just allow the user to select any trait right now. As above, we'll add the restriction logic later.

The menu must be placed within a template, so you'll also need to add a template that contains the menu. You can have the layout assign the appropriate size to the template and then have the template dictate its size to the menu. Alternately, you can have the template determine the size and then have the layout use that size. The only thing to worry about is when you invoke the Render of the template relative to the sizing logic. The template should be associated with the "Actor" pick when defining the reference within the layout.

The menu will need to be hidden unless the family allows selection. This should be controlled via tags. If a family allows selection of the trait, it should be assigned tags that specify which traits are allowed.

For that, you'll need to define a new tag group called "AllowTrait" (or something similar). You'll need one of these tags for every trait, so you can define them all by hand or let HL do it for you. The latter is easier and accomplished by defining an "identity" tag group. All you need to do is assign an "identity" element to the Trait component and an "AllowTrait" tag is auto-defined for every trait.

Now back to the menu. The visibility of the menu depends on whether there are any traits that can be selected for the family. You can simply check for whether the character has any "AllowTrait" tags. If so, then the menu is visible. This is accomplished via the following line of code.
portal[menuid].visible = hero.tagis[AllowTrait.?]

NOTE! The above won't actually work yet! The problem is that the "AllowTrait" tags are *not* on the actor. They are only on the family. So we have to handle that next.
 
Last edited:
The problem is that the "AllowTrait" tags are *not* on the actor. They are only on the family. So we have to handle that next.

So how do we get the tags from the family to the actor? We need to write a script that copies them. Since we want all families to do this automatically, we'll add an Eval script to the Family component.

All we need to do is have each family that is selected copy its "AllowTrait" tags to the actor. This is achieved through a single line of script code. We want to do this early so that other mechanisms can base their logic on the presence of the tags. So we end up with the following Eval script.

<eval value="1" phase="Initialize" priority="4000"><![CDATA[
perform forward[AllowTrait.?]
]]></eval>

At this point, the visibility of the menus should now behave correctly, since the tags will now exist on the actor itself.
 
The only problem with this is that you'll be able to pick *any* family initially - not just the ones for the selected clan.

Let's fix this problem now. We need to limit the family choices to only be those for the selected clan. We can accomplish this by assigning each family a suitable tag to identify which clan they belong to. So we need a separate tag for each clan. As we did above, we can let HL do all the work and define an "identity" tag group on the "Clan" component. We'll give the tag group an id of "Clan".

Once the tags are defined, we can assign the appropriate tag to every family. Then we can only show the family things for selection that possess the proper "Clan" tag. The problem is that the "Clan" tag is on the clan and we can't do anything with it there. The solution is the same thing we did above for the "AllowTrait" tags. We need to have the clan forward the tag to the actor, so a simple Eval script on the "Clan" component is all we need.

<eval value="1" phase="Initialize" priority="4000"><![CDATA[
perform forward[Clan.?]
]]></eval>

At this point, the "Clan" tag is on the actor, where we can actually test it.

By default, the list of choices presented in a table is limited only to the items belonging to the component specified. Normally, we would restrict the list of choices further by using the "List" tag expression. The problem is that the List tagexpr is statically defined. In our case, we want to change the list of choices dynamically based on what clan is chosen by the user. That means that the List tagexpr won't work and we have to use a different mechanism.

For situations like this, the "needtags" and "denytags" mechanisms are used. These mechanisms go through the list of things that can be shown as choices and dynamically compare tags on the thing to tags on the actor. Based on whether there is a match, the thing is either included or omitted from the list.

NOTE! This mechanism is not utilized in the Savage Worlds walk-through, so you won't find it discussed there. However, it is documented in the reference material in the wiki.

What we need to do is only show families that have the same "Clan" tag as is assigned to the actor. This means we should use the "needtags" mechanism. The resulting XML element that must be added to our chooser ends up looking like below.

<needtag container="Clan" thing="Clan" usehero="yes"/>

In the above, we want to match the "Clan" tags of the thing against the "Clan" tags of the container. In more complex situations, the tag groups can differ and only the tag ids need to match. We also want to ensure that we always compare tags against the actor/hero, so we force that state.

Once you add the above to the chooser, it should now limit the list of choices to only the families possessing the "Clan" tag of the selected clan.
 
For the menu, the user will select one of the traits, so just allow the user to select any trait right now. As above, we'll add the restriction logic later.

Restricting the contents of the traits menu will work differently, because menus don't behave the same way as choosers. With choosers, you are adding a new thing to the actor. With menus, you are selecting a thing or pick that is referenced but not otherwise modified by the selection process.

In principle, we need to use the same basic logic of comparing tags on the traits against tags on the actor. It's just the implementation approach that will differ. However, in order to compare tags, we have to first make sure that every trait has a suitable "Trait" tag assigned. As before, we assign the tag to all traits by defining an "identity" tag group on the "Trait" component. We can now compare the "Trait" tag on the trait against the "AllowTrait" tags on the actor.

There are examples of setting up menus appropriately for situations like this within the Savage Worlds walk-through. The Professional and Scholar edges come to mind. The key difference here is that we aren't going to be using the "UserSelect" component to handle this stuff, so we have to adapt the logic.

In order to make all this stuff work, we need to add a few fields to limit what can be selected from the menu and to store the actual selection. We can either add this material to the Actor itself or the select Clan. Either is perfectly acceptable, and neither is really "better", although the actor is a bit easier to retrieve info from within scripts, so we'll store the info on the actor.

For the menu mechanism, we need to specify a total of three new fields. We need one field in which to store the selected result, plus two fields to control how the menu selects its contents for display. For a description of these various fields, see the code comments and discussion of the "UserSelect" component in the walk-through. We'll add the new fields to the Actor and they should look like below:

<field
id="acTrtBonus"
name="Chosen Bonus Trait"
type="user"
style="menu">
</field>

<field
id="acTrtExpr"
name="Candidate TagExpr for Bonus Trait"
type="derived"
maxlength="200"
defvalue="">
</field>

<field
id="acTrtSrc"
name="Source for Bonus Trait"
type="static"
defvalue="2">
</field>

The default value of the "acTrtSrc" field is set to 2 and it's made static. This presets the value to select existing Trait picks from the actor.

We need to synthesize the "acTrtExpr" field via an Eval script, because it will change based on the selected family. Since the only place the tagexpr is used is within the menu, it's not relied upon by anything else during the evaluation cycle and we can schedule it during the "Render" phase. The script needs to build the tagexpr to select traits that are allowed by the selected family. This results in the following script.

<eval value="1" phase="Render" priority="5000"><![CDATA[
~get the list of allowed traits from the actor; splice the list together with a separator
~that we can instantly use within the tagexpr
var allowed as string
allowed = hero.tagids[AllowTrait.?," | "]
~if we have no allowed traits, use something safe for below
if (empty(allowed) <> 0) then
allowed = "FALSE"
endif
~our tagexpr is all traits that possess one of the allowed tags
herofield[acTrtExpr].text = "component.Trait & (" & allowed & ")"
]]></eval>

The above will synthesize a tagexpr that selects all the appropriate traits. If no traits are allowed, the tagexpr will select no traits. Our menu should be hidden in that case.
 
Restricting the contents of the traits menu will work differently, because menus don't behave the same way as choosers. With menus, you are selecting a thing or pick that is referenced but not otherwise modified by the selection process.

We can now look at displaying the menu appropriately. The menu portal definition should look similar to the one below.

<portal
id="menu"
style="menuSmall">
<menu_things
field="acTrtBonus"
component="none"
maxvisible="10"
usepicksfield="acTrtSrc"
candidatefield="acTrtExpr">
</menu_things>
</portal>

This will store the selection in the "acTrtBonus" field and pull the tagexpr and source designation out of the "acTrtExpr" and "acTrtSrc" fields, respectively.

Once that's done, the final step is to actually do something with the selected trait. For this, we'll need an Eval script that retrieves the selection trait and properly confers the +1 bonus to it. This should be added to the Actor component and look similar to the following.

<eval index="1" phase="PreTraits" priority="5000">
<before name="Calc trtFinal"/><![CDATA[
if (field[acTrtBonus].ischosen <> 0) then
field[acTrtBonus].chosen.field[trtBonus].value += 1
endif
]]></eval>

When the user selects one of the available traits, you should now see the appropriate traits be granted the +1 bonus.
 
4. After that the character has one heritage roll for free (to help build background) and may take 2 more for 1 CP each (these give sometimes extras such as advantages/disadvantages, skills, +/- to honor, status, glory or sometimes items.

The heritage section will be comprised of three choosers, one for each heritage selected. The first one should be required, while the others are optional. Consequently, the second and third choosers should be disabled if the first one has nothing selected within it.

Selecting each heritage is simple and you should have no trouble setting that up at this point. All of the logic for heritages can be readily handled via Eval scripts on the particular heritage.

The one special behavior you need to deal with is the 1 CP each cost for the extras. To do this, you should have the free heritage chooser assign an autotag to the heritage it chooses. For example, you can define a "Helper.Free" tag and then have the free chooser assign it. Then, you'll write an Eval script on the Heritage component that charges 1CP for each heritage, with the charge being exempted if the "Helper.Free" tag is present. The script might look something like below, although you'll need to adjust it for your own ids.

<eval index="1" phase="Traits" priority="10000">
<before name="Calc resLeft"/>
<after name="Bound trtUser"/><![CDATA[
if (tagis[Helper.Free] = 0) then
hero.child[resCP].field[resSpent].value += 1
endif
]]></eval>
 
the school is the big build. Schools also give a +1 bonus to trait (+1 to specific w/ a few that allow free choice by player) but it also gives the characters starting skills (free for CP cost), equipment and money, starting score in Honor (rank) special techniques (abilities/powers) the character can use at each rank (gaining new techniques each rank (aka Level).

Schools are definitely the biggest can of worms. However, all of the above should give you a reasonable handle on most of the mechanisms you'll need to tackle schools. I'm going to stop for today and let you digest all of the preceding material. When you've got this stuff working, start thinking about how you'll handle schools and outline your strategy. Mathias and I can then comment on it here. Just be sure to map it out in small, incremental steps to keep it manageable. :-)
 
Making a New Tab (hopefully)

Ok Rob thank you for your time.
I know that Gen-Con is right around the corner and you time is thin at best I am sure. I have started small (and got hung up right out the door). I find that at times when my brain is about to push out through my skull with high velocity force I sit down and just try and do some data info which I save in the Doc file so that it does not mess with the program, and I have it for later or can pull information off of it.
Here is what I have done since 1:30 am Sunday (I did take a small nap around 4 am until 10 am) and a little family time then back at it here you all go!

When first adding the tab, start with a single layout for the clan. Once that's in place and working, you can then add the family section/layout. Then you can add the school section/layout. Remember, small incremental steps are your friend. They ensure that any problems that arise are known to occur within only the few things you actually changed since the last step. :-)
.

Okay I have started and have several files, but here are the steps I have taken to make a new tab
Making a new tab (hopefully)

Okay here is what I have done so far:
Step 1:
Copied the tab_abilities.dat and renamed it tab_clans.dat
Step 2:
Proceeded with the modifications to tab_clans.dat, changing everything over to use clans.
Step 3:
Went into the tags.1st file
added in the “hide tab”
<value id=”clan”/>
Then added in the “hide”
<value id=”clan”/>
Step 4:
Went into the traits.str
Added
<component
id="Clan"
name="Clan"
autocompset="no">

<!-- Each clan needs its own identity tag to configure the hero appropriately -->
<identity group="Clan"/>

<!-- Track the race on the actor by assigning the appropriate tag -->
<eval index="1" phase="Setup" priority="5000"><![CDATA[
perform forward[Clan.?]
]]></eval>
Step 5:
Next to the thing_miscellaneous.dat file
Added
<thing
id="resClan"
name="Clan Slot"
compset="Resource">
<fieldval field="resObject" value="Clan"/>
<!-- Automatically add the resource to every actor -->
<tag group="Helper" tag="Bootstrap"/>
</thing>
Step 6:
Load HL data set
!!!! when I load the data set I have an error

The data files could not be loaded due to the following errors:

Template 'clPick' - Reference to non-existent component set 'Clan'
Tab Panel 'clan' - Reference to non-existent layout 'clan'
One or more timing errors were identified. Please review the timing report and correct the errors. You can access the report under the 'Develop' menu or by clicking this link.

the timing errors have been there for some time LOL its me somewhere, the first two lines are what is hanging me up.

I have attached txt files with all my information to try and help out.
 

Attachments

Step 4:
Went into the traits.str
Added
<component
id="Clan"
name="Clan"
autocompset="no">

Template 'clPick' - Reference to non-existent component set 'Clan'

In the component definition, please note the "autocompset=no" attribute. This tells the compiler to *not* automatically generate a component set for the "Clan" component. However, your template specifically references the "Clan" compset. So either you need to manually add the missing compset or you need to allow the compiler to auto-generate one for you by eliminating the attribute that disables that behavior.
 
Tab Panel 'clan' - Reference to non-existent layout 'clan'

In your tab definition, the "panel" references a layout named "clan". However, you define the layout with the id "clans" (plural). Consequently, the layout "clan" doesn't exist, so the error message is reported.
 
Thank you Rob!
I set the autocompset="yes" (in traits.str)
and fixed the <layout id="clan"> (in the tab_clan.dat){which is the tab I made}
I have to set up the clans so that they appear in the "pick your clan" area. the step after that will be to have the clan picked work as a jump point to selecting only families and schools from that clan (until I have advantages working so that a person could take different school advantage, but baby steps) :)

Thank you all again for the help I would never have made it past the headaches to this point without your guidance.
 
Okay so here is what I have now. I have a tab that allows the player to pick a clan (but I need it to only let you pick one clan, as it is you can just keep picking clans (not good))
Next step is to make the clans choice key the families and then schools, but first I must make a place for these to appear in the clan tab starting with families.

I am including the text file of clans and a screen shot with the tab.
 

Attachments

Yippy I have a families spot and it works (both in the fact that I have families to pick from and they give correct bonuses to abilities)
They are a bit small and to set up the tab layout I used the defualt basic tab layout

<layout
id="clan">
<portalref portal="clClan" taborder="10"/>
<portalref portal="famFamily" taborder="20"/>
<!--<portalref portal="baSkill" taborder="30"/>-->
<portalref portal="Horizontal"/>

<!-- This script sizes and positions the layout and its child visual elements. -->
<position><![CDATA[
~size and position the attributes table in the top left; we set the height to
~the full layout height, but the table will only use the space it needs
portal[clClan].width = width / 2 - 5
portal[clClan].left = 0
portal[clClan].height = height


~set the separator width and position it beneath the attributes
portal[Horizontal].width = portal[clClan].width - 30
portal[Horizontal].top = portal[clClan].bottom + 15
portal[Horizontal].left = portal[clClan].left + (portal[clClan].width - portal[Horizontal].width) / 2

~size and position the traits table beneath the separator; we set the height
~the the full layout height, but the table will only use the space it needs
portal[famFamily].width = portal[clClan].width
portal[famFamily].left = portal[clClan].left
portal[famFamily].top = portal[Horizontal].bottom + 15
portal[famFamily].height = height - portal[famFamily].top
]]></position>
</layout>
I have a screen shot also :)
 

Attachments

  • screen2.jpg
    screen2.jpg
    105.9 KB · Views: 5
portal[clClan].width = width / 2 - 5
portal[clClan].left = 0
portal[clClan].height = height

The clan portal's width is half the width of the template (the whole Clan panel in this case), - 5 pixels.
It's left-most point is at the far left.
It can have all the height it needs.

portal[famFamily].width = portal[clClan].width
portal[famFamily].left = portal[clClan].left
portal[famFamily].top = portal[Horizontal].bottom + 15
portal[famFamily].height = height - portal[famFamily].top

The family portal has the same width as the clan portal.
And they are left-aligned.
It's top is 15 pixels below the clan portal's bottom.
It's height is the height of the window minus the space the clan portal takes up.
 
Hey mgehl,
I reset the the size now its a lot bigger :)
portal[clClan].width = 475
portal[clClan].left = 0
portal[clClan].height = height
 
Back
Top