Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

IMyInventoryItem - TypeId / SubTypeId question

Discussion in 'Programming Questions and Suggestions' started by Casegard, Nov 29, 2017.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. Casegard Trainee Engineer

    Messages:
    23
    Hi mates,

    I try to get the inventory items in one of my scripts and can for the live of me not figure out what I'm doing wrong with the above mentioned properties:

    Code:
    foreach( IMyInventoryItem aItem in aItemList)
    {
    	// Error: IMyInventoryItem does not contain a definition ..
    	//  I thought this is supposed the new way
    	var aTypeId = aItem.TypeId; 
    
    	// Error: The type or member 'MyObjectBuilderType' is prohibited
    	// This is the old way I guess
    	var aTypeId = aItem.Content.TypeId;
    
    
      // A general output of aItem.ToString() gives
      // for example: <amount>x MyObjectBuilder_Ore/Scrap
      // so the type and subtype is somewhere within the object I guess
    }
    Can somebody help we with this? I clearly do something wrong here :( but I spend almost an hour not to figure it out and so I thought it is time to ask for help.

    Thanks
    Casegard
     
Thread Status:
This last post in this thread was made more than 31 days old.