Lone Wolf Development Forums  

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

Notices

Reply
 
Thread Tools Display Modes
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321

Old December 2nd, 2021, 09:45 AM
Howdy!

Is there a substitute for gearlist that includes the quantity of an item (stackQty) in the output?

If not, how does gearlist build the returned value? I'd like to create a procedure to return the list of items in a container with the number of them included (use stkName instead of just name in the return).

Working on -
  • (SWADE) WIP Savage Rifts
  • Savage Rifts (Deluxe): Update link in This post
  • Star Trek Adventures: Update link in This post
TCArknight is offline   #1 Reply With Quote
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,502

Old December 2nd, 2021, 02:48 PM
Are you talking about the container function (also in a few other places)?

Last edited by Duggan; December 2nd, 2021 at 03:02 PM.
Duggan is offline   #2 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321

Old December 2nd, 2021, 07:49 PM
Quote:
Originally Posted by Duggan View Post
Are you talking about the container function (also in a few other places)?
Yes. To get the list of all items contained in the container.

Working on -
  • (SWADE) WIP Savage Rifts
  • Savage Rifts (Deluxe): Update link in This post
  • Star Trek Adventures: Update link in This post
TCArknight is offline   #3 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old December 3rd, 2021, 09:09 AM
gearlist operates on holders, like backpacks, not containers (like adding a weapon power to a magic weapon in PF1).


foreach gear in [path to what you're checking] where "candidate expression"


If you're running it from the container, and just looking for all held gear, it'll just be:


foreach gear in this
somestring = splice(somestring, eachpick.field[stkName].text,", ")
nexteach
Mathias is offline   #4 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321

Old December 3rd, 2021, 06:49 PM
Ah, I did forget that there was really was a difference with using container.

I have a top_holder component.gear item called eqCargoSpace which is bootstrapped to a vehicle as a place to put gear for the vehicle (like spare ammo, tents, medical supplies, etc.).

If I had something like (2x) Tents, (300x) Ammo X in the cargo space, I could to something like this?

Code:
 foreach gear in this
somestring = splice(somestring, eachpick.field[stkName].text,", ")
nexteach

MyContainString = “Contains: “ & somestring
Where MyContainString would be “Contains: (300x) Ammo X, (2x) Tent” ?

Working on -
  • (SWADE) WIP Savage Rifts
  • Savage Rifts (Deluxe): Update link in This post
  • Star Trek Adventures: Update link in This post
TCArknight is offline   #5 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old December 3rd, 2021, 07:48 PM
That looks like it should work. Of course "somestring" was a suggestion to find a better variable name - something more specific to the usage.
Mathias is offline   #6 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321

Old December 10th, 2021, 10:54 AM
Thanks Mathias.

This worked perfectly.

Working on -
  • (SWADE) WIP Savage Rifts
  • Savage Rifts (Deluxe): Update link in This post
  • Star Trek Adventures: Update link in This post
TCArknight is offline   #7 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 03:27 AM.


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