Author Topic: Scripting API items.RemoveItem not recognized as a function!  (Read 332 times)

ninekorn

  • Newbie
  • *
  • Posts: 41
    • View Profile
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

ai_enabled

  • AtomicTorch Founder
  • Hero Member
  • *****
  • Posts: 989
    • View Profile
Re: Scripting API items.RemoveItem not recognized as a function!
« Reply #1 on: July 26, 2017, 09:54:47 pm »
Hello,

I don't know who wrote API :-)  but it's really unexpected API method name:
Code: [Select]
items.RemoveItemQuantity(int container_id, int item_id, int quantity);
(if the quantity is zero - remove item completely).

ninekorn

  • Newbie
  • *
  • Posts: 41
    • View Profile
Re: Scripting API items.RemoveItem not recognized as a function!
« Reply #2 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.

ai_enabled

  • AtomicTorch Founder
  • Hero Member
  • *****
  • Posts: 989
    • View Profile
Re: Scripting API items.RemoveItem not recognized as a function!
« Reply #3 on: July 27, 2017, 01:00:33 am »
That sounds cool :-).