Does that mean, that you only want to create the equipment array, if you actually try to equip that ship?It's only there when the menu is open. So... once I try to equip ship 1, I need an array called, say Equip1. Then for ship 2, Equip2, etc.
In any case, why not simply create an array of arrays:
Code: Select all
$ships = ... (your ships, array stays the same as long as the script runs)
$equipments = array alloc: size=$sizeOfShipArray
$selectedShip = ... (a ship you selected in the menu)
$index = get index of $selectedShip in $ships
$equipment = $equipments[$index]
if not $equipment
* build $equipment array
$equipments[$index] = $equipment
end
* do something with $equipment
Greetings,
ScRaT