Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Authoring Kit
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
SAbel
Senior Member
 
Join Date: Jul 2007
Location: Walbridge, Ohio
Posts: 767

Old July 17th, 2009, 08:04 PM
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?
SAbel is offline   #41 Reply With Quote
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old July 18th, 2009, 01:41 PM
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.
rob is offline   #42 Reply With Quote
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old July 18th, 2009, 01:51 PM
Quote:
Originally Posted by SAbel View Post
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.
rob is offline   #43 Reply With Quote
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old July 18th, 2009, 02:09 PM
Quote:
Originally Posted by SAbel View Post
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 by rob; July 18th, 2009 at 04:12 PM. Reason: Overlooked the need for a fourth Heritage section
rob is offline   #44 Reply With Quote
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old July 18th, 2009, 02:18 PM
Quote:
Originally Posted by SAbel View Post
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.
rob is offline   #45 Reply With Quote
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old July 18th, 2009, 02:32 PM
Quote:
Originally Posted by SAbel View Post
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 by rob; July 18th, 2009 at 04:10 PM. Reason: Forgot to mention about needing a template
rob is offline   #46 Reply With Quote
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old July 18th, 2009, 02:37 PM
Quote:
Originally Posted by rob View Post
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.
rob is offline   #47 Reply With Quote
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old July 18th, 2009, 03:00 PM
Quote:
Originally Posted by rob View Post
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.
rob is offline   #48 Reply With Quote
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old July 18th, 2009, 03:56 PM
Quote:
Originally Posted by rob View Post
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.
rob is offline   #49 Reply With Quote
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old July 18th, 2009, 04:06 PM
Quote:
Originally Posted by rob View Post
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.
rob is offline   #50 Reply With Quote
Reply


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
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 01:27 AM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.