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.

(SOLVED) How to get value of UseConveyorSystem?

Discussion in 'Programming Questions and Suggestions' started by Sirhan Blixt, Aug 5, 2017.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. Sirhan Blixt Apprentice Engineer

    Messages:
    449
    I would like to be able to determine if the "Use Conveyor System" property is true for a given block. I can't use the IMyInventoryOwner interface, as that is obsolete.
    Using the static method IMyTerminalBlock.GetUseConveyorSystem() is also not an option.

    Neither the MyEntity class nor the IMyEntity interface have a 'UseConveyorSystem' member. MyReactor, MyProductionBlock, and any other class or interface with a UseConveyorSystem member has that because they implement IMyInventoryOwner. Which is obsolete.

    I could try to unbox it as a Sandbox.ModAPI.Ingame.IMyTerminalBlock and call GetProperties on it, but it appears that actual Properties are pretty rare, and that while the Action to set UseConveyorSystem true or false is exposed, there does not appear to be a way to get it by this route. My reference was mexmer's block evaluation thread (https://forums.keenswh.com/threads/block-evaluation.7358840/).

    What do?
     
    Last edited: Aug 5, 2017
  2. Malware Master Engineer

    Messages:
    9,507
    You have to look at the actual block type, not a base type. Both IMyAssembler and IMyRefinery, for instance, has the UseConveyorSystem property.

    If you need a more generic system I believe you can check for the existence of - and after that the value of - a Terminal property. My guess would be that this would be named "UseConveyorSystem".
     
  3. Sirhan Blixt Apprentice Engineer

    Messages:
    449
    So you're saying that mexmer's list of exposed properties is incomplete?

    Edit: I was also hoping to not have to check against four or five different block types.

    Edit the Second: I feel compelled to point out, again, that those other blocks only have the UseConveyorSystem property because they have inherited it from an interface that has been marked obsolete.
    --- Automerge ---
    Mystery solved. I guess I should trust a guide written in 2015 less and my own experimental observation more.

    [​IMG]
     
    Last edited: Aug 6, 2017
  4. Krougal Senior Engineer

    Messages:
    1,012
    NM, I'm an idiot, it is right there in front of me, UseConveyor not UseConveyorSystem
     
    Last edited: Jan 5, 2018
Thread Status:
This last post in this thread was made more than 31 days old.