1. justacoder

    justacoder Member

    Messages:
    2
    Hello,

    I am trying to script a bit using .NET and I am having some problems to get the items of the cargohold of my active ship when I am docked. I have managed to open the combined inventory and I am able to switch the active child window. If I am in space i can get the the cargo of my ship using Me.Ship.xxx methods, but when I am docked all the methods to get cargo from the classes Ship, Character or Station seem to return NULL.

    It would be great if someone could give me a hint or even a code snippet.

    Thank you in advance
    JustACoder
  2. stealthy

    stealthy ISX Specialist

    Messages:
    100
    As long as the unified inventory is open and your ship cargo is active, you should be able to get cargo using the GetCargo method of the Ship object.
    You may wish to check that your Ship reference is still valid, e.g. ship.IsValid == true. This reference should be gotten fresh every frame in which it's used.
  3. justacoder

    justacoder Member

    Messages:
    2
    Thank you stealthy for the fast help ,the getCargo function ot the ship instance works fine, with your tip to use the isValid() function I found out that the object was not valid, because i messed up the initialization ....

Share This Page