Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Authoring Kit

Notices

Reply
 
Thread Tools Display Modes
AndrewD2
Senior Member
 
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975

Old October 23rd, 2014, 05:51 PM
And this is the component I'm working with

Code:
<component
      id="Trait2"
      name="Trait"
      autocompset="no">
      <field
        id="trCharCost"
        name="Character Point Cost"
        type="derived"
        defvalue="0">
        </field>
      <field
        id="trStorCost"
        name="Story Point Cost"
        type="derived"
        defvalue="0">
        </field>
        <field
          id="trMax"
          name="Selector Max"
          type="derived">
          </field>
      <field
        id="trMin"
        name="Selector Min"
        type="derived">
        </field>
      <field
        id="trSelect"
        name="Type Selector"
        type="user"
        maxfinal="3">
          <!-- Bound the user value to the limits established for the trait -->
      <bound phase="Traits" priority="1000" name="Bound trtUser">
        <before name="Calc trtFinal"/><![CDATA[
        @minimum = field[trMin].value
        @maximum = field[trMax].value
        ]]></bound>
        <finalize><![CDATA[
          if (field[trSelect].value = 1) then
            @text=" (Minor"
          elseif (field[trSelect].value = 2) then
            @text = " (Major"
          else
            @text = " (Special"
            endif
            
          if (tagis[Trait.gbGood] <> 0) then
            @text &= " Good)"
          else
            @text &=" Bad)"
          endif
        ]]></finalize>
        </field>
      <identity group="HasTrait"/>
      <identity group="Opposite"/>
     <!-- Each trait that is added by the user costs the story and/or character point cost -->
    <eval index="1" phase="Setup" priority="5000"><![CDATA[
      
      ~we must ignore bootstrapped abilities from races and abilities added via advances
      if (isuser + origin.ishero >= 2) then
        if (tagis[Trait.gbBad]  <> 0) then
          #resmax[resStory] += field[trStorCost].value
          #resmax[resCP] += field[trCharCost].value
        else      
          hero.child[resStory].field[resSpent].value += field[trStorCost].value
          hero.child[resCP].field[resSpent].value += field[trCharCost].value
        endif
      endif
      ]]></eval>
      
      <eval index="2" phase="Setup" priority="5000"><![CDATA[
        perform forward[HasTrait.?]
        ]]></eval>
        
      <eval index="3" phase="Setup" priority="2500"><![CDATA[
      ~ set the default values of the traits if the values are left blank

       if (tagis[User.UserSelect] = 0) then
        if (tagis[Trait.mmMinor] <> 0) then
          field[trCharCost].value = 1
          field[trStorCost].value = 0
        elseif (tagis[Trait.mmMajor] <> 0) then
          field[trCharCost].value = 2
          field[trStorCost].value = 0
        elseif (tagis[Trait.mmSpecial] <> 0) then
          field[trCharCost].value = field[trCharCost].value
          field[trStorCost].value = field[trStorCost].value
        else
          if (tagis[Trait.mmMinor] + tagis[Trait.mmSpecial] = 2) then
            field[trMin].value = 1
            field[trMax].value = 3
          elseif (tagis[Trait.mmMinor] + tagis[Trait.mmMajor] = 2) then
            field[trMin].value = 1
            field[trMax].value = 2
          else
            field[trMin].value = 2
            field[trMax].value = 3
            endif
          endif
          if (field[trSelect].value = 1) then
            field[trCharCost].value = 1
          elseif (field[trSelect].value = 2) then
            field[trCharCost].value = 2
          else
            field[trCharCost].value = field[trCharCost].value
            field[trStorCost].value = field[trStorCost].value
            endif
          endif
          
      ]]></eval>
      
      <eval index="4" phase="Setup" priority="2000"><![CDATA[
      if (tagcount[Trait.mm?] > 1) then
        perform assign[User.UserSelect]
        endif
        ]]></eval>
      </component>
AndrewD2 is offline   #11 Reply With Quote
AndrewD2
Senior Member
 
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975

Old October 23rd, 2014, 06:52 PM
Well I figured out a work around that actually looks cleaner than what I was trying to do. I actually shrunk the incrementer and eliminated the text so it just showed the two arrows, then based on the value it filled in the label that I was already using for I didn't have the incrementer. Now it looks like this attachment.

I'm noticing another problem, involving the values, but I'll do a little more troubleshooting before posting a new thread.
Attached Images
File Type: jpg trait2.JPG (25.0 KB, 3 views)
AndrewD2 is offline   #12 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old October 24th, 2014, 08:20 AM
Could you post the code of the incrementer portal you're using?
Mathias is offline   #13 Reply With Quote
AndrewD2
Senior Member
 
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975

Old October 24th, 2014, 08:54 AM
Code:
   <style
    id="incrTrait">
    <style_incrementer
      textcolorid="clrnormal"
      font="fntincrsim"
      textleft="13" texttop="0" textwidth="5" textheight="20"
      fullwidth="30" fullheight="20"
      plusup="incplusup" plusdown="incplusdn" plusoff="incplusof"
      plusx="20" plusy="0"
      minusup="incminusup" minusdown="incminusdn" minusoff="incminusof"
      minusx="0" minusy="0">
      </style_incrementer>
    </style>
It'd be nice if there was a way to set the text as blank in the style instead of in the finalize script for the field.
AndrewD2 is offline   #14 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old October 24th, 2014, 08:58 AM
This portal:

Code:
    <portal
      id="value"
      style="incrSimple">
      <incrementer
        field="trtUser">
        </incrementer>
      <mouseinfo mousepos="middle+above"><![CDATA[
        call SkillHist
        ]]></mouseinfo>
      </portal>
Mathias is offline   #15 Reply With Quote
AndrewD2
Senior Member
 
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975

Old October 24th, 2014, 09:39 AM
oh Sorry

Code:
    <portal
      id="select"
      style="incrTrait">
      <incrementer
        field="trSelect">
        </incrementer>
      
      </portal>
AndrewD2 is offline   #16 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old October 24th, 2014, 10:55 AM
I can't see any reason this isn't working. The style you posted earlier should have worked - it's constructed just like some of the wide incrementers I've got in Shadowrun.

At this point, my recommendation is to start looking for the type of errors that will make you facepalm when you find them - not saving before you re-compile HL, saving to the wrong folder, having HL set to a different folder, etc.

Here's a set of incrementers that are used in Shadowrun, in case this helps:
Code:
  <!-- style used on 'narrow incrementers'
        -identical to the "simple" incrementer, except a bit narrower in width
  -->
  <style
    id="incrNarrow">
    <style_incrementer
      textcolorid="clrnormal"
      font="fntincrsml"
      textleft="12" texttop="0" textwidth="16" textheight="20"
      fullwidth="40" fullheight="20"
      plusup="incplusup" plusdown="incplusdn" plusoff="incplusof"
      plusx="29" plusy="0"
      minusup="incminusup" minusdown="incminusdn" minusoff="incminusof"
      minusx="0" minusy="0">
      </style_incrementer>
    </style>

  <!-- style used on 'somewhat wide incrementers'
        -identical to the "simple" incrementer, except a bit wider in width
        (displaying 3 digits and a slash is the goal for this one)
  -->
  <style
    id="incrSWide">
    <style_incrementer
      textcolorid="clrnormal"
      font="fntincrsim"
      textleft="13" texttop="0" textwidth="30" textheight="20"
      fullwidth="56" fullheight="20"
      plusup="incplusup" plusdown="incplusdn" plusoff="incplusof"
      plusx="45" plusy="0"
      minusup="incminusup" minusdown="incminusdn" minusoff="incminusof"
      minusx="0" minusy="0">
      </style_incrementer>
    </style>

  <!-- style used on 'wide incrementers'
        -identical to the "simple" incrementer, except a bit wider in width
  -->
  <style
    id="incrWide">
    <style_incrementer
      textcolorid="clrnormal"
      font="fntincrsim"
      textleft="13" texttop="0" textwidth="44" textheight="20"
      fullwidth="70" fullheight="20"
      plusup="incplusup" plusdown="incplusdn" plusoff="incplusof"
      plusx="59" plusy="0"
      minusup="incminusup" minusdown="incminusdn" minusoff="incminusof"
      minusx="0" minusy="0">
      </style_incrementer>
    </style>

  <!-- style used on 'very wide incrementers'
        -identical to the "simple" incrementer, except about 3x as much text space
  -->
  <style
    id="incrVWide">
    <style_incrementer
      textcolorid="clrnormal"
      font="fntincrsim"
      textleft="13" texttop="0" textwidth="75" textheight="20"
      fullwidth="100" fullheight="20"
      plusup="incplusup" plusdown="incplusdn" plusoff="incplusof"
      plusx="90" plusy="0"
      minusup="incminusup" minusdown="incminusdn" minusoff="incminusof"
      minusx="0" minusy="0">
      </style_incrementer>
    </style>

  <!-- style used on 'extra wide incrementers'
        -identical to the "simple" incrementer, except about 3x as much text space
  -->
  <style
    id="incrXWide">
    <style_incrementer
      textcolorid="clrnormal"
      font="fntincrsim"
      textleft="13" texttop="0" textwidth="80" textheight="20"
      fullwidth="105" fullheight="20"
      plusup="incplusup" plusdown="incplusdn" plusoff="incplusof"
      plusx="95" plusy="0"
      minusup="incminusup" minusdown="incminusdn" minusoff="incminusof"
      minusx="0" minusy="0">
      </style_incrementer>
    </style>
Mathias is offline   #17 Reply With Quote
AndrewD2
Senior Member
 
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975

Old October 24th, 2014, 11:16 AM
Sadly I've double checked all that, it just seems that with the finalize script it wouldn't show more than 2-3 characters in an incrementer, but I'm actually pretty happy with the way it currently looks, but I've approached another problem. Is there a way to set an incrementer interval with a field?

I've found some Special Traits have a Variable cost associated with them, usually no more than 2 values, it might be 1/3 or 2/4, in fact I think there are a whole 3 do that, I guess since they all seem to be incremented in 2s I could setup an incrementer that has an interval of 2 and set the minimum/maximum based on a value entered.

Although I did just come across a since trait that is Minor/Special, which kinda makes the incrementer not work with 1 being mindor, 2 being Major and 3 being Special because of that one trait, is there a work around for this, or am I not making any sense?
AndrewD2 is offline   #18 Reply With Quote
Reply

Thread Tools
Display Modes

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 09:28 PM.


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