Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game

Notices

Reply
 
Thread Tools Display Modes
AllusiveMan
Member
 
Join Date: Sep 2018
Posts: 30

Old July 29th, 2022, 04:04 PM
Hi all. I'm looking to create a new adjustment, similar to "Equipment Don't Count in Gear Value," except instead of allowing you to select one item from a picklist of your gear, it would loop through all of your gear and assign the Helper.Free tag to all potions (so they aren't counted in your Total Gear Value calculation).

Then I want to create an adjustment that does the exact same thing for scrolls.

I'm guessing this wouldn't take more than 6-10 lines of code, but it's beyond me. Help?
AllusiveMan is offline   #1 Reply With Quote
ploturo
Member
 
Join Date: May 2021
Posts: 84

Old July 30th, 2022, 07:28 PM
You can duplicate that adjustment using the editor, and make the following two changes:

1. Get rid of the text in the "Custom Expression" entry in the details, to remove the item selection menu.

2. Replace the script with this (for potions).
Code:
   ~ If we're not enabled, get out now
   doneif (field[pIsOn].value = 0)

   ~ iterate over picks in hero container and tag all potions as free
   foreach pick in hero from MyGear where "gType.OilPotion"
      perform eachpick.assign[Helper.Free]
   nexteach
For scrolls, the relevant tag would be "gType.Scroll" instead.
ploturo is offline   #2 Reply With Quote
AllusiveMan
Member
 
Join Date: Sep 2018
Posts: 30

Old July 31st, 2022, 12:54 AM
Beautiful. This worked perfectly. Thank you!
AllusiveMan is offline   #3 Reply With Quote
AllusiveMan
Member
 
Join Date: Sep 2018
Posts: 30

Old August 1st, 2022, 09:28 PM
Follow up question. If I wanted to exclude wands--but only those that have a "Cure" spell or "Restoration" spell on them, how do I test for that?
AllusiveMan is offline   #4 Reply With Quote
ploturo
Member
 
Join Date: May 2021
Posts: 84

Old August 3rd, 2022, 10:53 AM
It's a little more complicated if you want to get more specific.

I'm going to limit it to spells of the Healing subschool in the script below, because that is relatively simple.

Code:
   ~ If we're not enabled, get out now
   doneif (field[pIsOn].value = 0)

   ~ iterate over picks in hero container and check wands for conjuration (healing) tags
   foreach pick in hero from MyGear where "gType.Wand"
   
      if (eachpick.tagis[thingid.sCustomWnd] <> 0) then
          
          ~ this is a custom wand, so check the spell inside
          if (eachpick.gizmo.firstchild["portal.iwSpells"].tagis[sSubschool.Healing] <> 0) then
                perform eachpick.assign[Helper.Free]
          endif
          
      elseif (eachpick.tagis[iSubschool.Healing] <> 0) then
      
          ~ this wand is a predefined item (the school/subschool should be tagged directly on the item)
          perform eachpick.assign[Helper.Free]
            
      endif
      
   nexteach
(Note that the school/subschool tag groups are different for items and spells, prefixed with i and s respectively.)

If you wanted to limit it to a different set of spells, you would need to figure out a tag that they all have in common, or use extendthing to add a tag to all the spells you want (and any pre-made wand items with those spells). Then change the script to use that tag instead of the healing subschool tags used above.
ploturo is offline   #5 Reply With Quote
AllusiveMan
Member
 
Join Date: Sep 2018
Posts: 30

Old August 3rd, 2022, 04:35 PM
This is awesome. Thank you so much!
AllusiveMan is offline   #6 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 06:30 AM.


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