Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - Authoring Kit (http://forums.wolflair.com/forumdisplay.php?f=58)
-   -   Selector on Trait (http://forums.wolflair.com/showthread.php?t=51123)

AndrewD2 October 23rd, 2014 02:24 PM

Selector on Trait
 
I've got a component called "Traits" (named Trait2 to avoid messing with the Trait that comes in the skeleton file).

Traits can be Good/Bad and can be Major/Minor/Special.

I've got 5 tags covering this: Trait.gbGood, Trait.gbBad, Trait.mmMajor, Trait.mmMinor, Trait.mmSpecial.

Minor Traits cost 1 CP
Major Traits cost 2 CP
Special Traits cost something else. Sometimes CP, sometimes Story Points or Both.

I have field: trStorCost, and trCharCost

Currently the internal logic sets those fields to either 1, 2, or whatever the value set in the field is.

Some traits can be Minor/Major/Special and I want to have it put a selector on it to select which it is based on the tags on it. So if it has the Minor/Major tags, the selector would just give those options, if you had Major/Special, just those, if you had all 3, all three would show up. I have a script that assigns the tag User.UserSelect if more than 1 of those tags are found on the trait.

I was originally going to have a different copy for each version and then put prereqs in that prohibited taking the same grouping twice, but doing like the "Bad Eyes" hindrance in Savage Worlds seemed like a better way to go. That uses a preset array, which obviously wouldn't work for this, I figure it needs candidate expression. But I wasn't sure if I could do an expression wit just tags or if I needed things attached to them. I know in Pathfinder the usrChosen fields use things, even in the ones that are pre-done (All Weapons, Energy Type, etc). Do I need to make a basic thing that can attack to this? Or is there some better way to do this?

Mathias October 23rd, 2014 02:42 PM

Will you ever have a Minor/Special, that doesn't allow Major?

AndrewD2 October 23rd, 2014 02:48 PM

At least in the Core Rules there are no examples of Minor/Special, just Minor/Major, Major/Special, or Minor/Major/Special

Mathias October 23rd, 2014 03:25 PM

In that case, would an incrementer work? 1 = minor, 2 = major, 3 = special?

You'd use a finalize script to display a name instead of a number, and depending on what options were available, you can set the minimum and maximum values of the field that the incrementer is displaying.

Mathias October 23rd, 2014 03:27 PM

Also, I recommend changing the name of the core Trait component, if your system uses that name to mean something else.

AndrewD2 October 23rd, 2014 05:10 PM

1 Attachment(s)
Well I've got an incrementer setup there the min and max is set based on the tags The display I want it to say is the type and good/bad for example "(Minor Good)" but all I'm able to get to show in the text is "(M".

Attached is an image of how it looks. I'm trying to modify the incrSimple style, created a copy of it called incrTrait. I've been adjusting the textwidth and fullwidth to give more room but nothing but the first 2 characters seems to show up.

AndrewD2 October 23rd, 2014 05:22 PM

Also I am going to change the base trait, but I wanted to work on the system while I was in a good working mood and not spending a lot of time renaming fields and references in a whole folder worth of files.

Mathias October 23rd, 2014 05:27 PM

Also change the plusx by the same amount - that's the left-hand edge of the > arrow.

AndrewD2 October 23rd, 2014 05:41 PM

Doesn't seem to matter, still just displays the 2 characters and the gap gets wider

AndrewD2 October 23rd, 2014 05:48 PM

In case it helps this is my position script and the style.

Code:


      ~set up our height based on our tallest portal
      height = portal[info].height

      ~if this is a "sizing" calculation, we're done
      doneif (issizing <> 0)

      ~position our tallest portal at the top
      portal[info].top = 0

      ~center the other portals vertically
      perform portal[name].centervert
      perform portal[delete].centervert

      ~position the delete portal on the far right
      perform portal[delete].alignedge[right,0]

      ~position the info portal to the left of the delete button
      perform portal[info].alignrel[rtol,delete,-8]
     

      ~position the name on the left and let it use all available space
      portal[name].left = 0
     
      var edge as number
      if (tagis[User.UserSelect] = 0) then
        portal[select].visible = 0
        edge = portal[name].right
       
      else
        perform portal[select].alignrel[ltor,name,15]
        edge = portal[select].right
        endif
       
    if (tagis[User.NeedDomain] = 0) then
      portal[lbldomain].visible = 0
      portal[domain].visible = 0
     
    else
      portal[lbldomain].left = edge + 15
      perform portal[domain].alignrel[ltor,lbldomain,5]
      portal[domain].width = minimum(150,portal[info].left - portal[domain].left - 10)
      endif
      ~position the trait rank
      perform portal[rank].alignrel[ltor,name,8]
      portal[name].width = minimum(portal[name].width,portal[info].left - 5)

      ~if the ability is auto-added, change its font to indicate that fact
      if (candelete = 0) then
        perform portal[name].setstyle[lblAuto]
        endif

Code:

  <style
    id="incrTrait">
    <style_incrementer
      textcolorid="clrnormal"
      font="fntincrsim"
      textleft="13" texttop="0" textwidth="84" textheight="20"
      fullwidth="110" fullheight="20"
      plusup="incplusup" plusdown="incplusdn" plusoff="incplusof"
      plusx="99" plusy="0"
      minusup="incminusup" minusdown="incminusdn" minusoff="incminusof"
      minusx="0" minusy="0">
      </style_incrementer>
    </style>



All times are GMT -8. The time now is 06:04 AM.

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