i have recently been learning (albeit) slowly about arrays and have a question.
Say if i create a seperate script and call it "Components Array", it contains all the "components" that a ship can use in this array. Also it contains the appropiate "prices" based on the "get max price" of ware.
It preforms all the correct calculations for the "ware/price" and "need/have" compared with the "selected" ship.
Currently i can pass the "total" required price back to my "call" script so I can tell what it will cost to upgrade my ship with the missing components.
I say all that to ask this:
Is it possible to "pass" from the array (being that it has done all the calculations already) the "needed" components back to the "call" Script so i can install the missing components based on the arrays info, or must I continue as below: (current setup)
Code: Select all
006 if $PackageNumber == 1
007 $total = 0
008 @ $cost = [THIS] -> call script 'plugin.BF.component.values' : Select Ship to Check=$Ship Selected Upgrade Package=$PackageNumber
Code: Select all
else
018 $Guild = $Ship -> install 1 units of Best Buys Locator
019 $Guild = $Ship -> install 1 units of Best Selling Price Locator
020 $Guild = $Ship -> install 1 units of Boost Extension
021 $Guild = $Ship -> install 1 units of Duplex Scanner
022 $Guild = $Ship -> install 1 units of Ecliptic projector
023 $Guild = $Ship -> install 1 units of Fight Command Software MK1
024 $Guild = $Ship -> install 1 units of Fight Command Software MK2
025 $Guild = $Ship -> install 1 units of Freight scanner
026 $Guild = $Ship -> install 1 units of Mineral Scanner
027 $Guild = $Ship -> install 1 units of Navigation Command Software MK1
028 $Guild = $Ship -> install 1 units of Special Command Software MK1
029 $Guild = $Ship -> install 1 units of Trade Command Software MK1
030 $Guild = $Ship -> install 1 units of Trade Command Software MK2
031 $Guild = $Ship -> install 1 units of Trading system extension
032 $Guild = $Ship -> install 1 units of Video Enhancement Goggles
from this example is it possible to make all those "installs" to just 1 install command via the array like:
Code: Select all
$Guild = $Ship -> install $requestedAmount units of $TheWare
Any help is greatly appreciated, Thanks for your time.