Modding Help Trouble creating new ship

Discussion in 'Starbound Modding' started by I Said No, Feb 26, 2018.

  1. I Said No

    I Said No Cosmic Narwhal

    I'm currently in the middle of creating a new ship for a race mod, and I seem to be having a pretty nasty problem I could use help with since I don't know how to parse the error log it throws at me.

    I've been using the upgradeship command to test out each tier of the ship - Tiers 0, 1, 2, 3, and 4 work fine, but when I try to upgrade to tiers 5, 6, 7 or 8, my character falls through the ship to the bottom of the world, and going by the log the game seems to completely freak out, spamming the same error over and over until the game is forcibly closed in Task Manager since hitting Quit Game or the X in the corner of the window just causes the game to freeze up and not close. I initially had Tier 5 working and was working on aligning the image with the tilespace, but I have no idea what I changed to cause the game to go completely berserk.

    Enclosed below is the text of the error in the log, my blockkey, and the structure file for T5.


    [10:34:35.879] [Error] UniverseServer: exception caught: (OutOfRangeException) first() called on empty list
    [0] 140007153 Star::captureStack
    [1] 140005ede Star::StarException::StarException
    [2] 1405bd502 Star::ListMixin<std::vector<Star::Vector<int,2>,std::allocator<Star::Vector<int,2> > > >::first
    [3] 1405c9a50 Star::WorldServer::setCentralStructure
    [4] 1404d8ba5 <lambda_7c87a9681ac35703aef0ee9e526123d6>::eek:perator()
    [5] 1405d307f Star::WorldServerThread::executeAction
    [6] 1404f4039 Star::UniverseServer::updateShips
    [7] 1404ef5f6 Star::UniverseServer::run
    [8] 140003c5e Star::ThreadImpl::runThread
    [9] 773559cd BaseThreadInitThunk
    [10] 7758b891 RtlUserThreadStart

    (This error rapidly repeats without stopping until the game is forcibly closed)



    {
    "blockKey" : [
    {
    "value" : [255, 255, 255, 255],
    "foregroundBlock" : false,
    "backgroundBlock" : false
    },

    {
    "value" : [0, 0, 255, 255],
    "foregroundBlock" : false,
    "backgroundBlock" : true
    },

    {
    "value" : [255, 0, 0, 255],
    "foregroundBlock" : true,
    "backgroundBlock" : true
    },

    {
    "value" : [0, 255, 0, 255],
    "foregroundBlock" : false,
    "backgroundBlock" : true,
    "backgroundMat" : "shojiscreenpanel",
    "flags" : [ "shipLockerPosition" ],
    "object" : "sarasinorstoragelocker",
    "objectParameters" : {
    "treasurePools" : [ "starterTreasure" ],
    "level" : 0.5,
    "unbreakable" : false
    },
    "objectResidual" : true
    },

    {
    "value" : [0, 128, 0, 255],
    "foregroundBlock" : false,
    "backgroundBlock" : true,
    "backgroundMat" : "shojiscreenpanel",
    "object" : "sarasinorstoragelocker",
    "objectParameters" : {
    "unbreakable" : true
    }
    },

    {
    "value" : [142, 255, 142, 255],
    "foregroundBlock" : false,
    "backgroundBlock" : true,
    "backgroundMat" : "shojiscreenpanel",
    "object" : "sarasinortechstation",
    "objectParameters" : {
    "unbreakable" : true
    },
    "objectResidual" : true
    },

    {
    "value" : [255, 87, 81, 255],
    "foregroundBlock" : false,
    "backgroundBlock" : true,
    "object" : "brokenavianfuelhatch",
    "objectParameters" : {
    "unbreakable" : true
    }
    },

    {
    "value" : [255, 90, 90, 255],
    "foregroundBlock" : false,
    "backgroundBlock" : true,
    "object" : "avianfuelhatch",
    "objectParameters" : {
    "unbreakable" : true
    },
    "objectResidual" : true
    },

    {
    "value" : [255, 255, 0, 255],
    "foregroundBlock" : false,
    "backgroundBlock" : true,
    "backgroundMat" : "ornateflooring",
    "object" : "apexshiplight",
    "objectResidual" : true
    },

    {
    "value" : [191, 191, 0, 255],
    "foregroundBlock" : false,
    "backgroundBlock" : true,
    "backgroundMat" : "ornateflooring",
    "object" : "apexshiplightBroken",
    "objectParameters" : {
    "unbreakable" : true
    }
    },

    {
    "value" : [128, 128, 0, 255],
    "foregroundBlock" : false,
    "backgroundBlock" : true,
    "backgroundMat" : "ornateflooring",
    "object" : "apexshiplight",
    "objectParameters" : {
    "unbreakable" : true,
    "defaultLightState" : false
    }
    },

    {
    "value" : [174, 137, 81, 255],
    "foregroundBlock" : false,
    "backgroundBlock" : true,
    "object" : "shipengine",
    "objectParameters" : {
    "unbreakable" : true
    }
    },

    {
    "value" : [156, 0, 255, 255],
    "anchor" : true,
    "foregroundBlock" : false,
    "backgroundBlock" : true,
    "backgroundMat" : "shojiscreenpanel",
    "object" : "avianteleporter",
    "flags" : [ "playerSpawn" ],
    "objectParameters" : {
    "unbreakable" : true
    }
    },

    {
    "value" : [79, 0, 128, 255],
    "anchor" : true,
    "foregroundBlock" : false,
    "backgroundBlock" : true,
    "backgroundMat" : "shojiscreenpanel",
    "object" : "avianteleporterTier0",
    "flags" : [ "playerSpawn" ],
    "objectParameters" : {
    "unbreakable" : true
    }
    },

    {
    "value" : [167, 167, 255, 255],
    "foregroundBlock" : false,
    "backgroundBlock" : true,
    "object" : "boosterflame",
    "objectParameters" : {
    "unbreakable" : true
    }
    },

    {
    "value" : [150, 150, 255, 255],
    "foregroundBlock" : false,
    "backgroundBlock" : true,
    "object" : "bigboosterflameavian",
    "objectParameters" : {
    "unbreakable" : true
    }
    },

    {
    "value" : [168, 168, 168, 255],
    "foregroundBlock" : false,
    "backgroundBlock" : true,
    "object" : "smallboosterflame",
    "objectParameters" : {
    "unbreakable" : true
    }
    },

    {
    "value" : [0, 255, 255, 255],
    "foregroundBlock" : false,
    "backgroundBlock" : true,
    "object" : "sarasinorcaptainschair",
    "objectDirection" : "right",
    "objectParameters" : {
    "unbreakable" : true
    }
    },

    {
    "value" : [122, 122, 122, 255],
    "foregroundBlock" : false,
    "backgroundBlock" : true,
    "object" : "invisiblelight",
    "objectParameters" : {
    "unbreakable" : true
    }
    },

    {
    "value" : [255, 232, 128, 255],
    "foregroundBlock" : false,
    "backgroundBlock" : true,
    "object" : "invisiblesparker",
    "objectParameters" : {
    "unbreakable" : true
    }
    },

    {
    "value" : [255, 255, 144, 255],
    "foregroundBlock" : false,
    "backgroundBlock" : true,
    "backgroundMat" : "shojiscreenpanel"
    },

    {
    "value" : [255, 117, 144, 255],
    "foregroundBlock" : false,
    "backgroundBlock" : true,
    "backgroundMat" : "ornateflooring"
    },

    {
    "value" : [255, 117, 255, 255],
    "foregroundBlock" : false,
    "backgroundBlock" : true,
    "backgroundMat" : "ornatewood"
    },

    {
    "value" : [51, 51, 51, 255],
    "foregroundBlock" : true,
    "backgroundBlock" : false,
    "foregroundMat" : "hazard",
    "foregroundResidual" : true
    },

    {
    "value" : [255, 200, 220, 255],
    "foregroundBlock" : true,
    "backgroundBlock" : true,
    "foregroundMat" : "hazard",
    "foregroundResidual" : true,
    "backgroundMat" : "ornateflooring"
    },

    {
    "value" : [0, 0, 0, 255],
    "anchor" : true,
    "foregroundBlock" : true,
    "backgroundBlock" : false
    }
    ]
    }




    {
    "config" : {
    "shipUpgrades" : {
    "capabilities" : ["teleport", "planetTravel", "systemTravel"],
    "crewSize" : 6
    }
    },

    "backgroundOverlays" : [
    {
    "image" : "sarasinorT5.png",
    "position" : [4.63, 0.27],
    "fullbright" : true
    },
    {
    "image" : "sarasinorT5lit.png",
    "position" : [4.63, 0.27]
    }
    ],

    "blockKey" : "blockKey.config:blockKey",
    "blockImage" : "sarasinorT5blocks.png"
    }



    I'm honestly stumped on this one so any help would be greatly appreciated.
     
  2. bk3k

    bk3k Oxygen Tank

    What is probably happening is that tier5's blockImage file is mssing something required. From my experience that's the teleporter. Even if you already have a teleporter placed from a previous tier. The color for the teleporter (in your case 79, 0, 128, 255 ) must be present in your blockImage. Even if you think you see it, verify this matches perfectly with your chosen image program's color picker. Just because it looks right to the human eye doesn't mean anything to the code.

    edit:

    A few extra things to know. I don't know what you ship would look like, but you can also draw select things in front of the player because this is supported too in the .structure files. And with "fullbright" you don't really need the invisible lights per say. It will light up that entire image.

    Code:
    "foregroundOverlays" : [ ]
    You make use of "objectResidual" already. "backgroundResidual" and "foregroundResidual" are also supported so that gives people the option to remove blocks and not have them replaced next time. Essentially acting like blocks the player had placed.
     
    Last edited: Feb 26, 2018
  3. I Said No

    I Said No Cosmic Narwhal

    That seems to have done the trick. For some reason known neither to man nor beast, the teleporter pixel had decided to change itself from #9c00ff to #9900ff when I saved the file. Thanks a ton!
    I'm still a bit confused as to why the error manifests itself like that, though. Shouldn't it just throw an exception about it having an invalid pixel or something rather than have a giant tantrum and freezing up?

    Most everything in the blockKey file is just copied over from the Avian one with stuff changed out here and there. I had no idea player-overlapping foreground stuff was supported though, that's pretty interesting. Can that be leveraged anywhere outside of shipworlds?
     
  4. bk3k

    bk3k Oxygen Tank

    I think I've had such issues before with default settings on programs. In my case I use Paint.net. I think I had to change "Rasterization" settings to avoid this trouble. The anti-aliasing to off for one. it wants to "blend" pixels together. That's fine for art I suppose, but not so great when you need a literal RGBA match!

    I don't believe undefined RGBA maps won't cause an error - you just get nothing there. In this case it is actually looking for your teleporter. Or should I say looking for the player's start position. Where do they beam up, where do they respawn, etc. It apparently won't accept the old position.

    And yes that very error has frustrated me before. It is anything but clear. At least now I know what it is! But not without a good amount of "throwing things at the wall to see what sticks."

    You can do similar things with "renderLayer" for many things. That and more is explained well here. While that is about objects, "renderLayer" is used in vanilla for other things like a few projectiles and monsters.
     

Share This Page