AtomicTorch Studio Forums

VoidExpanse => Bug reports => Topic started by: ninekorn on July 26, 2017, 08:31:50 PM

Title: Scripting API items.RemoveItem not recognized as a function!
Post by: ninekorn on July 26, 2017, 08:31:50 PM
Hi,

The Scripting API doesnt seem to recognize items.RemoveItem not recognized as a function! I've also tried station.RemoveItem or generator.RemoveItem or game.RemoveItem but none seem to work. items.RemoveCargo won't work because im trying to remove items from the station shop container. This is for my galaxy market mod.

Thank you in advance.
nine
Title: Re: Scripting API items.RemoveItem not recognized as a function!
Post by: ai_enabled on July 26, 2017, 09:54:47 PM
Hello,

I don't know who wrote API :-)  but it's really unexpected API method name:

items.RemoveItemQuantity(int container_id, int item_id, int quantity);

(if the quantity is zero - remove item completely).
Title: Re: Scripting API items.RemoveItem not recognized as a function!
Post by: ninekorn on July 26, 2017, 11:45:35 PM
Ok! Tested it and it works! Thanks. I can now buy items in the whole galaxy. The items go in the player storage Inside the station where the item was bought and 1 item is removed from the station themselves.
Title: Re: Scripting API items.RemoveItem not recognized as a function!
Post by: ai_enabled on July 27, 2017, 01:00:33 AM
That sounds cool :-).