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.

Solar Panels with different grid sizes

Discussion in 'Programming Questions and Suggestions' started by fusurugi, Jan 5, 2015.

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

    Messages:
    521
    Can you differentiate between a small grid solar panel and a big grid solar panel inside the script?
     
  2. Malakeh Trainee Engineer

    Messages:
    29
    The only thing i can think of is that the small solar panel would have a maximum output of 30KW so you could try to sort them out by checking their detailed info.

    In the same way though a large solar panel could produce 30KW if its shaded a lot or at a wrong angle. So i think for now this method should get u through at least until they add something else that you can distinguish them easier

    OR

    I don't know if there is a way to search also Subtypeids then you would be able to distinguish them exactly. Since one is stated in cubeblocks.sbc as:

    <TypeId>SolarPanel</TypeId>
    <SubtypeId>LargeBlockSolarPanel</SubtypeId>

    and the small ones as:

    <TypeId>SolarPanel</TypeId>
    <SubtypeId>SmallBlockSolarPanel</SubtypeId>
     
  3. Cuber Apprentice Engineer

    Messages:
    262
    You can use the block's CubeGrid's GridSizeEnum which returns a MyCubeSize enumeration.
    MyCubeSize has three members: Small, Medium and Large.

    Code:
    if (block.CubeGrid.GridSizeEnum == Sandbox.Common.ObjectBuilders.MyCubeSize.Small)
    {
        // ...
    }
    
     
Thread Status:
This last post in this thread was made more than 31 days old.