User Tools

Site Tools


modding:function:objadditem

Discuss this page on this page's Talk Page

objAddItem

See objAddItem at Xelerus

Syntax (objAddItem obj item [count]) → True/Nil
Arguments obj: The spaceObject that you want to add the item to.
item: The itemStruct of the item you want to add.
[count]: An optional amount of items you want to add. It overrides the amount in the itemStruct
Returns boolean: True if successful, else Nil.
Category item, spaceObject
Description Adds the item to the space object. If number is there uses that many items otherwise uses the number of items in the itemStruct.

Example

(objAddItem gplayerShip (itmCreate 0x4001 2))

Adds two segments of light titanium armor to the player ship.

(objAddItem gplayerShip (itmCreate 0x4001 3) 3)

Adds three segments of light titanium armor to the player ship.

(objAddItem gplayerShip (itmCreate 0x4001 2) 5)

Adds five segments of light titanium armor to the player ship. Remember the optional number over rides the number in the item struct.

Return to Functions list

modding/function/objadditem.txt · Last modified: 2014/12/27 04:40 by 127.0.0.1