Download
Both FileFront
Library Script
Example Menu Script
What this does...
Returns an array of the selected type of wares on board a ship as well as several arrays with various information.
What this can do...
Returns thirteen arrays for use in any script or for a menu script.
- The Ware Array
- Returns a list of the wares on a ship. If you were to look at the array when being used for a menu, it would be broken up by [FALSE] values where the ware type changes. This null value corresponds with the second array....
- The Description Array
- Returns the headers for a menu. If you were to look at the array, it would be broken up by [TRUE] where there is a ware in the Ware Array.
- Ware Amount Array
- Returns an array of the amount that the target ship is carrying of the wares. [FALSE] corresponds with a header in the Description Array
- Ware Amount Free Array
- Returns an array of the free amount that the target ship can carry of the wares. [FALSE] corresponds with a header in the Description Array
- Ware Amount True Array
- Returns an array of the true amount that the target ship is carrying of the wares. [FALSE] corresponds with a header in the Description Array
- Ware Amount Max Array
- Returns an array of the maximum amount that the target ship can carry of the wares. [FALSE] corresponds with a header in the Description Array
- Ware Price Average Array
- Returns an array of the average prices of the wares. [FALSE] corresponds with a header in the Description Array
- Ware Price Max Array
- Returns an array of the maximum prices of the wares. [FALSE] corresponds with a header in the Description Array
- Ware Price Min Array
- Returns an array of the minimum prices of the wares. [FALSE] corresponds with a header in the Description Array
- Ware Volume Array
- Returns an array of the volume of the wares. [FALSE] corresponds with a header in the Description Array
- Ware Volume Free Array
- Returns an array of the free volume of a ware in the ship. [FALSE] corresponds with a header in the Description Array
- Ware Volume True Array
- Returns an array of the true volume of a ware in the ship. [FALSE] corresponds with a header in the Description Array
- Ware Transport Class Array
- Returns an array of the transport class of the wares. [FALSE] corresponds with a header in the Description Array
How to use...
- Call the script "lib.wob.ship.getwares".
- Set the first parameter to the target ship.
- Set the second parameter an array of the ware types. Each position is set to either [TRUE] or [FALSE]
- 0th Position is Bio.
- 1st Position is Energy.
- 2nd Position is Food.
- 3rd Position is Minerals.
- 4th Position is Natural.
- 5th Position is Tech.
- 6th Position is Lasers.
- 7th Position is Missiles.
- 8th Position is Shields.
Code: Select all
[TRUE], [FALSE], [TRUE], [TRUE], [FALSE], [FALSE], [FALSE], [FALSE], [FALSE]
- Set the third parameter to [TRUE] to sort the ware array alphanumerically. Set to [FALSE] to leave the array unsorted.
- Set the fourth parameter to [TRUE] if you are going to use the ware array to create a menu. Set to [FALSE] to use the array normally.
- Set the fifth parameter to [TRUE] to return upgrades in the Ware Array. Set to [FALSE] to exclude upgrades.
- Set the sixth parameter to [TRUE] to return equipment in the Ware Array. Set to [FALSE] to exclude equipment.
- The returned value is an array with thirteen indexes.
This is what the calling and return should look like:Code: Select all
001 $Target = get player tracking aim 002 003 * ***** SET EACH VALUE TO [TRUE] TO USE OR [FALSE] TO NOT USE***** 004 005 $Ware.Array.Types = array alloc: size=9 006 * 0 = Bio 007 $Ware.Array.Types[0] = [TRUE] 008 * 1 = Energy 009 $Ware.Array.Types[1] = [TRUE] 010 * 2 = Food 011 $Ware.Array.Types[2] = [TRUE] 012 * 3 = Minerals 013 $Ware.Array.Types[3] = [TRUE] 014 * 4 = Natural 015 $Ware.Array.Types[4] = [TRUE] 016 * 5 = Tech 017 $Ware.Array.Types[5] = [TRUE] 018 * 6 = Lasers 019 $Ware.Array.Types[6] = [TRUE] 020 * 7 = Missiles 021 $Ware.Array.Types[7] = [TRUE] 022 * 8 = Shields 023 $Ware.Array.Types[8] = [TRUE] 024 025 026 @ $Ware.Array.Super = [THIS] -> call script 'lib.wob.ship.getwares' : Ship=$Target Return Ware Types=$Ware.Array.Types Sort Ware Array T/F?=[TRUE] For Menu?=[TRUE] Return Upgrades?=[TRUE] Return Equipment=[TRUE] 027 028 if not $Ware.Array.Super 029 |return null 030 end 031 032 $Ware.Array = $Ware.Array.Super[0] 033 $Ware.Array.Description = $Ware.Array.Super[1] 034 $Ware.Array.Amount = $Ware.Array.Super[2] 035 $Ware.Array.Amount.Free = $Ware.Array.Super[3] 036 $Ware.Array.Amount.True = $Ware.Array.Super[4] 037 $Ware.Array.Amount.Max = $Ware.Array.Super[5] 038 $Ware.Array.Price.Average = $Ware.Array.Super[6] 039 $Ware.Array.Price.Max = $Ware.Array.Super[7] 040 $Ware.Array.Price.Min = $Ware.Array.Super[8] 041 $Ware.Array.Volume = $Ware.Array.Super[9] 042 $Ware.Array.Volume.Free = $Ware.Array.Super[20] 043 $Ware.Array.Volume.True = $Ware.Array.Super[11] 044 $Ware.Array.Class = $Ware.Array.Super[12]
Example of Menu Usage
If you are going to use the ware array in a menu, I suggest that you either use my example script to start with or at least look at it.
- I suggest that you download the example script too just to see how to call the library properly.
Enjoy
The North Wind