Lone Wolf Development Forums  

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

Notices

Reply
 
Thread Tools Display Modes
Gumbytie
Senior Member
 
Join Date: Jun 2010
Location: Florida
Posts: 235

Old June 18th, 2014, 04:33 PM
So I have a similar question posted awhile back and a few others have asked something similar as well.

I have been unable to get "usrCandid1" and "ChooseSrc1" to work with a list of content not already defined in SW.

My example would be this edge, where I tired an Array instead:

Code:
  <thing 
	id="edgMilRank" 
	name="Military Rank" 
	description="" 
	compset="Edge" 
	summary="Select a rank" 
	uniqueness="unique">
    <fieldval field="usrLabelAr" value="Menu1"/>
    <arrayval field="usrArray" index="0" value="Ensign"/>
    <arrayval field="usrArray" index="1" value="Lieutenant"/>
    <arrayval field="usrArray" index="2" value="Lt. Commander"/>
    <arrayval field="usrArray" index="3" value="Commander"/>
    <arrayval field="usrArray" index="4" value="Captain"/>    
    <usesource source="Travel"/>
    <tag group="MinRank" tag="0"/>
    <tag group="User" tag="Activation"/>
    <tag group="EdgeType" tag="Background"/>
	<eval phase="PreTraits" priority="5000"><![CDATA[      if (field[abilActive].value <> 0) then
        perform #traitadjust[trCharisma,+,1,"Air NCO"]
        endif]]>
      <before name="Calc trtFinal"/>
      </eval>
    </thing>
The obvious intent is to purchase the Edge, then select the appropriate "rank". I know I could just use a domain and they could fill in the box, I just wanted to limit selection to pre-defined lists. If this is even possible. I have other use cases if I can get this to work

The above code spits out no errors, you just get the Edge and no menu to select choices from.
Gumbytie is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old June 18th, 2014, 04:46 PM
Looking at the code for the editor tab for edges, usrArray is commented out, so this is not currently available for Edges. If you want to use this, I'd recommend putting it in the enhancement request thread.
Mathias is offline   #2 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old June 18th, 2014, 04:54 PM
In order to get that sort of selection with a selection-based menu, I'd create items on the Simple tab to represent each of the selections. Manually create some tag (I think the User group looks like a good group to use), and assign it to all of them. Then, you can write a candidate expression that covers all the items you've created.
Mathias is offline   #3 Reply With Quote
Gumbytie
Senior Member
 
Join Date: Jun 2010
Location: Florida
Posts: 235

Old June 18th, 2014, 05:01 PM
Well, with "usrCandid1" I had this:

Code:
  <thing 
	id="edgMiRank2" 
	name="Military Rank" 
	description="" 
	compset="Edge" 
	summary="Select a rank" 
	uniqueness="unique">
    <fieldval field="usrCandid1" value="Ensign | Lieutenant | Commander | Captain"/>
    <usesource source="Travel"/>
    <tag group="MinRank" tag="0"/>
    <tag group="User" tag="Activation"/>
    <tag group="EdgeType" tag="Background"/>
    <tag group="ChooseSrc1" tag="Hero"/>
    <eval phase="PreTraits" priority="5000"><![CDATA[      if (field[abilActive].value <> 0) then
        perform #traitadjust[trCharisma,+,1,"Air NCO"]
        endif]]>
      <before name="Calc trtFinal"/>
      </eval>
    </thing>
I tried ChooseSrc1 = Thing and Container but neither worked either.

I got lost beyond that trying to figure out how to write an expression that pulled the list into the selection box.
Gumbytie is offline   #4 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old June 19th, 2014, 07:50 AM
usrCandid1 = "component.Simple & User.The tag you created to distinguish these items"
Mathias is offline   #5 Reply With Quote
Gumbytie
Senior Member
 
Join Date: Jun 2010
Location: Florida
Posts: 235

Old June 19th, 2014, 04:12 PM
You rock Mathias!!

For everyone else, this is how I applied his suggestions:

Simple Items:

Code:
  <thing id="valTREnsig" name="O1 Ensign" compset="Simple">
    <usesource source="Travel"/>
    <tag group="User" tag="Rank" name="Rank" abbrev="Rank"/>
    </thing>
  <thing id="valTRLieut" name="O2 Lieutenant" compset="Simple">
    <usesource source="Travel"/>
    <tag group="User" tag="Rank" name="Rank" abbrev="Rank"/>
    </thing>
etc.
Now my Military Rank Edge:

Code:
  <thing id="edgMiRank" name="Military Rank" compset="Edge" summary="Select a rank" uniqueness="unique">
    <fieldval field="usrCandid1" value="component.Simple &amp; User.Rank"/>
    <usesource source="Travel"/>
    <tag group="User" tag="Activation"/>
    <tag group="EdgeType" tag="Background"/>
    <tag group="ChooseSrc1" tag="Thing"/>
    <tag group="MinRank" tag="0"/>
    <eval phase="PreTraits" priority="5000"><![CDATA[      if (field[abilActive].value <> 0) then
        perform #traitadjust[trCharisma,+,1,"Military Rank"]
        endif]]>
      <before name="Calc trtFinal"/>
      </eval>
    </thing>
Gumbytie is offline   #6 Reply With Quote
zarlor
Senior Member
 
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819

Old June 20th, 2014, 04:45 AM
So basically what does that do? Just give a select list with the Edge that simply displays text (the rank chosen, in this case?) I could add it to the Common Codes thread if you like, but I want a good way to explain what it's doing to someone reading this for the first time and trying to decide if this code will help them do what they want to do.

Lenny Zimmermann
Metairie, LA, USA

Data files authored (please let me know if you see any issues with any of these if you have/use them):
Official (In the downloader)
50 Fathoms, Deadlands: Hell On Earth, Deadlands: Noir, East Texas University, Necessary Evil (requires Super Powers Companion), Pirates of the Spanish Main, Space 1889 (original file by Erich), Tour of Darkness, Weird War II, Weird Wars: Rome
Coming Eventually
Evernight (LWD has completed their review but I have some fixes to make first... although Pinnacle mentioned this might get an overhaul to SWADE so I may just wait for that first. If you just HAVE to have this now, though, just PM me)
zarlor is offline   #7 Reply With Quote
SeeleyOne
Senior Member
 
Join Date: Nov 2009
Posts: 891

Old June 20th, 2014, 08:21 AM
Quote:
Originally Posted by Mathias View Post
Looking at the code for the editor tab for edges, usrArray is commented out, so this is not currently available for Edges. If you want to use this, I'd recommend putting it in the enhancement request thread.
I wonder if a Knowledge Array could be made so that we can have a list of predefined Knowledge skills.

Evil wins because good rolls poorly .... or the players are not paying enough attention to the game.
SeeleyOne is offline   #8 Reply With Quote
Gumbytie
Senior Member
 
Join Date: Jun 2010
Location: Florida
Posts: 235

Old June 20th, 2014, 11:17 AM
To answer Zarlor.

I used this because I wanted an 'established' series of Military Ranks in place of a generic Domain-filled box.

Other examples might be:

Knowledge-based languages, you could create a list of the languages for your world, use this as the selection option when they pick new Knowledge (Language). I am actually going to use this for a setting of mine.

Heck, even for some of the Hindrances (Allergies, Quirks, Phobias, etc.). For some settings, the GM just might want a finite list for his characters to choose from.

I tried finding some threads with similar needs for something like this:

http://forums.wolflair.com/showthread.php?t=30863

http://forums.wolflair.com/showthread.php?t=21113

Which made me think of Skill Specializations or Preset Knowledge lists, seeming to get most use out of something like this.

Hope that helps you out with phrasing for Common Code examples. BTW, I love that immensely, thank you very much.
Gumbytie is offline   #9 Reply With Quote
zarlor
Senior Member
 
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819

Old June 21st, 2014, 03:22 AM
My pleasure. It's largely personal notes for myself from when I was first learning these things and I figured I'd share in case anyone else might find it useful.

One last question... I'm assuming that doing it this way forces the selection only to what is on the list. Is there a way to allow the selection from a list like this but then also allow a blank box for manual entry?

Lenny Zimmermann
Metairie, LA, USA

Data files authored (please let me know if you see any issues with any of these if you have/use them):
Official (In the downloader)
50 Fathoms, Deadlands: Hell On Earth, Deadlands: Noir, East Texas University, Necessary Evil (requires Super Powers Companion), Pirates of the Spanish Main, Space 1889 (original file by Erich), Tour of Darkness, Weird War II, Weird Wars: Rome
Coming Eventually
Evernight (LWD has completed their review but I have some fixes to make first... although Pinnacle mentioned this might get an overhaul to SWADE so I may just wait for that first. If you just HAVE to have this now, though, just PM me)
zarlor is offline   #10 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 07:35 PM.


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