Author Topic: How to get the contents of the ship inventory and cargo space  (Read 1360 times)

loudent

  • Full Member
  • ***
  • Posts: 141
    • View Profile
I've looked through the API for the ships and there's a way to see if it has a specific item and there's a way to see what the ship has equipped, but I'm interested in the contents of both the cargo and the inventory of the ship.

Any way to do that?

ai_enabled

  • AtomicTorch Founder
  • Hero Member
  • *****
  • Posts: 1025
    • View Profile
Re: How to get the contents of the ship inventory and cargo space
« Reply #1 on: April 17, 2015, 12:07:36 am »
"ship.HasCargoAmount" look for the cargo at player's ship cargo and (if docked) at player's station cargo storage.
"ship.HasItemOfType" is do the same, but for items + it checks equipment also.
If you need some new functions - we could add them with the next patch.

loudent

  • Full Member
  • ***
  • Posts: 141
    • View Profile
Re: How to get the contents of the ship inventory and cargo space
« Reply #2 on: April 17, 2015, 12:46:54 am »
I realize my original post was unclear. I'm aware of the two functions you mentioned.

What I'm looking for is something like ship.GetCargo(ship_id) which returns all the contents of the cargo in a list (id, count). Same thing with the ship storage space ship.GetStorage(ship_id) which also returns a list of items in a ships storage space.

ai_enabled

  • AtomicTorch Founder
  • Hero Member
  • *****
  • Posts: 1025
    • View Profile
Re: How to get the contents of the ship inventory and cargo space
« Reply #3 on: April 17, 2015, 07:25:40 am »
I see. So you need the functions to get the items list/cargo list of the specific container (which can be ship items/cargo/equipment, station storage items/cargo, station shop container and flying in the space crate container).
Sounds useful. Will be available with the next patch, it's planned on Monday.
Regards!

jeeplaw

  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: How to get the contents of the ship inventory and cargo space
« Reply #4 on: April 17, 2015, 10:48:44 am »
Awesome, so I think where he's going with that request is to include some kind of ship scanner? That way you can scan merchants for illegal trade activity and hunt them down and get bounties? I like it! ;)