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)
-   -   Gearlist substitute? (http://forums.wolflair.com/showthread.php?t=66588)

TCArknight December 2nd, 2021 09:45 AM

Gearlist substitute?
 
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).

Duggan December 2nd, 2021 02:48 PM

Are you talking about the container function (also in a few other places)?

TCArknight December 2nd, 2021 07:49 PM

Quote:

Originally Posted by Duggan (Post 297627)
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. :)

Mathias 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

TCArknight 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” ?

Mathias 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.

TCArknight December 10th, 2021 10:54 AM

Thanks Mathias. :)

This worked perfectly.


All times are GMT -8. The time now is 11:17 PM.

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