Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
Valdacil
Senior Member
 
Join Date: Feb 2017
Posts: 119

Old April 11th, 2017, 05:21 PM
Ok, I have it hiding now using the following at Post-Attributes/10000:

Code:
      ~ Get a count of how many selection options there are
      var SelOptions as number

      SelOptions = 0
      foreach pick in hero from Ability where "Helper.ShowSpec & (abCategory.RogDebInj|abCategory.RogSnAtt)"
        SelOptions += 1
      nexteach

      If (SelOptions > 0) Then
        perform assign[User.Activation]
        perform assign[Helper.ShowSpec]
      Else
        perform delete[User.Activation]
        perform delete[Helper.ShowSpec]
      EndIf
There may be a simpler/more elegant way, but this way does work.

The only issue I have run into is if you select something, then later that something is no longer a valid selection, it stays selected until you select something else. Example: I leveled up to 4 the selected one of the Debilitating Injuries. Then removed level 4 (downgraded to 3) which hide the selection box. Then I added the rogue talent Bleeding Attack. This unhid the ability selector, but it still had Debilitating Injury selected even though that isn't in the list now.

Hmmm... maybe need a function to check if field[usrChosen1].chosen is in the list and if not reset the selection. I tried:

Code:
perform field[usrChosen1].reset
But that gave me a compile error.
Valdacil is offline   #11 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old April 11th, 2017, 05:28 PM
I avoid foreach loops unless I have no choice. Too much CPU.

The other issue you see is just how HL UI works. If you have selected something and then remove the Pick the selection stays.

Hero Lab Resources:
Pathfinder - d20pfsrd and Pathfinder Pack Setup
3.5 D&D (d20) - Community Server Setup
5E D&D - Community Server Setup
Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources.
Created by the community for the community
- Realm Works kickstarter backer (Alpha Wolf) and Beta tester.
- d20 HL package volunteer editor.
ShadowChemosh is offline   #12 Reply With Quote
Valdacil
Senior Member
 
Join Date: Feb 2017
Posts: 119

Old April 11th, 2017, 06:33 PM
Yeah, the foreach was just the way I could figure out how to do it. I'm open to better ways if you can point me in the right direction.

You mentioned the issue with HL UI selecting picks, is there anything that can be done about that? Realistically speaking, the case shouldn't happen often since one typically won't delevel or remove a rogue talent once chosen... but the OCD programmer side of me likes to button up all the possibilities.
Valdacil is offline   #13 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 02:25 AM.


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