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.

Adding control panel to custom block

Discussion in 'Modding' started by mooviies, Apr 21, 2017.

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

    Hi :)

    I finally managed to create my first block. It's a block that has the same functionality as the Programmable Block but with a different model and texture. Now my block does not have a panel, so I followed Harag's instructions about adding an empty named detector_terminal_1 and surround the section that I want the player to look at to activate it. Now, I tried everything I could think of and it just won't work! I even activated debug draw in the game and I can't see the bounding box of the detector_terminal_1. I can see it on other blocks.

    So, I'm wondering if I'm missing something here. Am I doing something wrong or is it something to do with the add-on in blender? I tried putting the detector at the root, as a child of the screen. I tried the button "configure as volumetric handle" with and without. Tried to add the Highlight mesh, etc. Nothing seems to work. It seems the game don't even see the empty since it doesn't show it in debug. I tried looking a the Programmable Block model and also its definition file. I saw that the model only have an empty at the right place and the definition file doesn't mention anything about an empty. The rest is practically the same since I based my definition file on that one.

    Is it the mwmbuilder maybe?

    Do anyone know why it doesn't work? Thanks a lot :)
  2. Digi Senior Engineer

    If your definition is the one from this thread: https://forum.keenswh.com/threads/custom-model-error-loaded-only-3-5-phases.7394397/#post-1287051092

    Then you're using the wrong definition TypeId because CubeBlock is a decorative block that can't have terminal dummies.
    The simpliest way to ensure you're using the needed things is to open the vanilla CubeBlocks.sbc and look at the programmable block definition, copy it entirely in your sbc and then edit the things you want (subtypeId and BlockPairName are critical to adding a new block instead of replacing an existing one).
  3. mooviies Trainee Engineer

    I'm not. It looks like this now and it has the functionality of the Progammable Block when I look in an other control panel. The block shows fine. I'm just unable to activate the empty to access the terminal. (The empty doesn't show up. I'll go fetch some screenshot.

    <?xml version="1.0" encoding="utf-8"?>
    <Definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            <Definition xsi:type="MyObjectBuilder_ProgrammableBlockDefinition">
                <DisplayName>Server Rack Console Large</DisplayName>
                <Size x="1" y="1" z="1" />
                <Center x="0" y="0" z="0" />
                <ModelOffset x="0" y="0" z="0" />
                    <Component Subtype="SteelPlate" Count="8" />
                    <Component Subtype="Construction" Count="16" />
                    <Component Subtype="SmallTube" Count="16" />
                    <Component Subtype="Construction" Count="20" />
                    <Component Subtype="Computer" Count="16" />
                    <Component Subtype="InteriorPlate" Count="10" />
                    <Component Subtype="BulletproofGlass" Count="4" />
                    <Component Subtype="Display" Count="2" />
                <CriticalComponent Subtype="Computer" Index="0" />
                    <Model BuildPercentUpperBound="0.66" File="Models\ServerRack_Large_Constr1.mwm" />
                    <Model BuildPercentUpperBound="0.90" File="Models\ServerRack_Large_Constr2.mwm" />
                    <Model BuildPercentUpperBound="1.00" File="Models\ServerRack_Large_Constr3.mwm" />
                    <MountPoint Side="Bottom" StartX="0.20" StartY="0.20" EndX="0.80" EndY="0.80" />
                    <MountPoint Side="Top" StartX="0.20" StartY="0.20" EndX="0.80" EndY="0.80" />
    Last edited: Apr 21, 2017
  4. Digi Senior Engineer

    Did you restart the game between tests ? Because the game doesn't reload dummies, collisions and animations on world reload.

    I also have a PB mod and I use detector_terminal_1 as well and it worked fine last time I tested.

    I'm not sure what else could be the issue... if you want, send the .blend file via PM and I'll see if I can figure out the issue.

    It also seems you copied some stuff that have nothing to do with the PB:
    They won't cause any issues but they can mislead future you or other readers.
  5. mooviies Trainee Engineer

    Oh, no I didn't restart the game. I did reload the model in the world and restart the world though. I have to restart the whole game? I'll give it a try.
    --- Automerge ---
    Welp that did the trick. I though I only needed to restart the world. Good to know :) Thanks man
    --- Automerge ---
    @Digi One more itty-bitty little question. Do you know how to highlight a mesh when looking at the dummy? So that it highlight the terminal like the vanilla blocks?
    I saw a setting in the plugin in blender but it doesn't seem to do anything. Do I have to set something else? All it those right now it that the empty flash when I look at it.

    --- Automerge ---
    Nevermind! Found what to do Here
Thread Status:
This last post in this thread was made more than 31 days old.