Discuss this page on this pages TalkPage

objCanInstallItem

Syntax (objCanInstallItem obj item [armorSeg, deviceSlot])
Arguments obj: The space object to check if the item can be installed
item: the item to check if can be installed
[armorSeg, deviceSlot]: Either armorSeg or deviceSlot (or 0/1).
Returns True if succesful, Nil resultCode resultString [itemToReplace] otherwise
Category spaceObject functions
Description Evaluates if the given space object can have the given item installed. Incompatible items return a resultCode; as such this is useful particularly in dockscreens where you can generate an error message for the player.

resultCode

'ok
'armorTooHeavy
'cannotInstall
'noDeviceSlotsLeft
'noNonWeaponSlotsLeft
'noWeaponSlotsLeft
'notInstallable
'notCompatible
'reactorIncompatible
'reactorOverloaded
'reactorTooWeak
'replacementRequired

Example

 (objCanInstallItem gPlayerShip theItem armorSeg) 

Checks if the playership can support theItem as an armor segment.

Return to Space Object functions list

Return to functions list