User Tools

Site Tools


prpl:getshipfromslot

<- PRPL reference <- Ships

GetShipFromSlot

ArgumentsResultNotation
Slot ID Ship ID [ int - int ]

Description

Returns the Ship ID for any built ship associated with a given build slot. Valid slot IDs are 0 to 23 inclusive. (Note: -1 may be the HQ slot.) -1 is returned if the ship is not placed (an unconstructed build outline counts) or if the slot ID is invalid. -2 is returned when there is no ship build button at the given slot.

Examples

CreateList ->PlayerFleet
 
24 -1 do
    I GetShipFromSlot ->Ship
    <-Ship 0 gte if
        <-PlayerFleet <-Ship AppendToList
    endif
loop
#Congratulations, we now have a list of the player-controlled ships. Not blue or red ships, however.
prpl/getshipfromslot.txt · Last modified: 2017/09/14 11:47 by kajacx