• 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

Menu select for a skill similar to Knowledge

Gumbytie

Well-known member
However, I need the selection box to pull from a list of things.

So I have some code which does not work, but only because I threw this together trying to figure out what pieces are missing and what needs to be added.
Code:
  <thing 
	id="skProfessi" 
	name="Profession" 
	description="A profession that earns your character money in-between sessions." 
	compset="Skill">
    <!-- If array-based menu selection is needed, make sure the compset includes
          "UserSelect" component and define these fields as appropriate.-->
    <fieldval field="trtAbbrev" value="Prof"/>
    <fieldval field="shortname" value="Prof"/>
    <fieldval field="UserSelect" value="(History | Law | Literature | component.Skill)"/>
    <arrayval field="usrArray" index="0" value="Whore"/>
    <arrayval field="usrArray" index="1" value="Shipwright"/>
    <arrayval field="usrArray" index="2" value="Bouncer"/>
    <arrayval field="usrArray" index="3" value="Carpenter"/>
    <arrayval field="usrArray" index="4" value="Innkeeper"/>
    <arrayval field="usrArray" index="5" value="Scribe"/>
    <usesource source="Test" parent="UserParent" name="Test"/>
    <tag group="User" tag="NeedDomain" name="NeedDomain" abbrev="NeedDomain"/>
    <tag group="DashTacCon" tag="NonCombat" name="NonCombat" abbrev="NonCombat"/>
    <tag group="User" tag="UserSelect"/>
    <link linkage="attribute" thing="attrSma"/>
    </thing>

It will generate two errors:

1. Thing 'skProfessi' - Field 'UserSelect' referenced but not defined

2. Thing 'skProfessi' - Attempt to initialize array-based field that is not defined with compset

I knew I would get errors, but just plugging in code to try and see what I can get. Any suggestions?

Cheers,
Gumbytie
 
Well, I figured out one side of of it but the menu array portion still kicking me hard.

So what works (version 1):
Code:
  <thing
    id="skFire"
    name="Firearms"
    compset="Skill"
    isunique="no"
    description="{i}Specialized skill{/i}\n\nAcademics represents...."
    summary="May choose a spcialization.">
    <fieldval field="trtAbbrev" value="Fir"/>
    <fieldval field="usrCandid1" value="(component.Skill)"/>
    <tag group="DashTacCon" tag="NonCombat"/>
    <tag group="ChooseSrc1" tag="Thing"/>
    <link linkage="attribute" thing="attrDex"/>
    </thing>

And on the Skill Tab we have:
Code:
    	<portal
      	id="menu1"
      	style="menuSmall">
      	<menu_things
        	field="usrChosen1"
        	component="none"
        	maxvisible="10"
        	usepicksfield="usrSource1"
        	candidatefield="usrCandid1">
        	</menu_things>
      	</portal>

Options for ChooseSrc1 are:
<tag group="ChooseSrc1" tag="Hero"/>
<tag group="ChooseSrc1" tag="Container"/>
<tag group="ChooseSrc1" tag="Thing"/>

Problem is, it needs to pull from an existing list of something. I have Skills and I have Sub-Skills (for lack of a better term). If I could figure out how to separate those two and pull from one into other, fine.

Now the Array version of skill (version 2):
Code:
  <thing 
	id="skAcad" 
	name="Academics" 
	compset="Skill"
    	isunique="no"
    	description="{i}Specialized skill{/i}\n\nAcademics represents...."
    	summary="Choose a discipline.">
    <fieldval field="usrLabelAr" value="Menu1"/>
    <arrayval field="usrArray" index="0" value="Archaeology"/>
    <arrayval field="usrArray" index="1" value="Anthropology"/>
    <arrayval field="usrArray" index="2" value="Biology"/>
    <arrayval field="usrArray" index="3" value="Chemistry"/>
    <arrayval field="usrArray" index="4" value="Physics"/>
    <link linkage="attribute" thing="attrInt"/>
    </thing>
  </document>

Seems to work in sense not kicking out any errors. Problem is I cannot get the selector to appear on Skill list like it does for version 1. I assume it has something to do with the portal for the Skill Tab, and here is where I run into problems. Can't get it to appear to see if code for version 2 is actually correct.

I tried:
Code:
    	<portal
      	id="array"
      	style="menuSmall">
      	<menu_things
        	field="usrSelect"
        	component="none"
        	maxvisible="10"
        	usepicksfield="usrArray"
        	candidatefield="usrCandid1">
        	</menu_things>
      	</portal>
That gets me an error:
Syntax error in 'position' script for Template 'skPick' on line 105
-> Attempt to access a field 'usrSelect' defined with an incompatible style. Expected 'menu'.

So down in my position script I have:
Code:
      perform portal[array].centervert

      ~position the menus to the right of the name in the available space
      perform portal[array].alignrel[ltor,name,10]
      portal[array].width = (portal[info].left - portal[array].left - 20) / 2

      ~determine whether our arrays are visible
      ~Note: Remember that a non-empty tagexpr field indicates array selection is used.
      if (field[usrCandid1].isempty <> 0) then
        portal[array].visible = 0
        endif

      ~if a array is visible, make sure it has a selection
      if (portal[array].visible <> 0) then
        if (field[usrSelect].ischosen = 0) then
          perform portal[array].setstyle[menuErrSm]
          endif
        endif

I also changed this one part:
Code:
          perform portal[array].setstyle[arrayErrSm]
And still same error.

Wish to heck I could crack open Shadowrun and look out how it handles skills :) In some ways I am trying to do sort of the same thing.

There are two types of Skills in the game:

Skill + Discipline
Skill + Specialization

Skill + Discipline:
Similar to Savage Worlds knowledge skills. A very broad skill that requires a discipline chosen everytime purchase the skill. So with Academics, very broad. Purchase Academics pick one of the choices from the Array and get:
Academics: Archaeology (Int 4 + Skill Level 4 = Skill Rating 8) Cost: 4 exp
Academics: Anthropology (Int 4 + Skill Level 2 = Skill Rating 6) Cost: 2 exp
etc.
Each one is now a unique skill that can be raised independently with experience points.

Skill + Specialization
You know a broad skill but have specialized in a subset that gives a bonus to the skill roll. Purchasing this Specialization will cost additional experience points. So we look at the Firearm skill:
Firearms (Dex 6 + Skill Level 2 = Skill Rating 8) Cost: 2 exp
Pistols (Firearms + Skill Level 2 = Skill Rating 10) Cost: 1 exp​

So the functionality is very different between the two needs and why I am trying to figure out both methods for menus/arrays.

Of course, after the array portion, I still need to figure out how to create that 'specialized' skill list to be pulled into regular skills and charge points for that.

But one hurdle at a time :)

Cheers,
Gumbytie
 
Back
Top