Modding Help Can't figure out what is causing crash with container object

Discussion in 'Starbound Modding' started by jakecool19, Jan 26, 2019.

  1. jakecool19

    jakecool19 Pangalactic Porcupine

    Hello I'm trying to make a custom container, but whenever I add the objectType to it, it causes the game to crash on interaction with the error Improper conversion to int from null. It doesn't tell me what line number, and I've ran both my object code and the frames code through JSON Lint and there are no errors. I'm using the stone furnace config as a test interface. Please help me.


    [16:00:37.281] [Info] Root: Preparing Root...
    [16:00:37.281] [Info] Root: Done preparing Root.
    [16:00:37.281] [Info] Client Version 1.3.4 (windows x86_64) Source ID: f468c99f113f3d44bb548367da9c9a1c6f4b031d Protocol: 745
    [16:00:37.281] [Info] Root: Scanning for asset sources in directory '..\assets\'
    [16:00:37.957] [Info] Root: Scanning for asset sources in directory '..\mods\'
    [16:00:37.958] [Info] Root: Detected asset source named 'base' at '..\assets\packed.pak'
    [16:00:37.958] [Info] Root: Detected asset source named 'Factoriobound' at '..\mods\Factoriobound'
    [16:00:37.958] [Info] Root: Detected unnamed asset source at '..\assets\user'
    [16:00:37.958] [Info] Loading assets from: '..\assets\packed.pak'
    [16:00:38.779] [Info] Loading assets from: '..\mods\Factoriobound'
    [16:00:38.780] [Info] Loading assets from: '..\assets\user'
    [16:00:39.552] [Info] Assets digest is 33d61c17a5ebb7aa5260f43be9a5c31439cc63a0bb6b482ab2a7aaafc0e7f579
    [16:00:39.552] [Info] Root: Loaded Assets in 2.27051 seconds
    [16:00:39.557] [Info] Application: Initializing SDL Video
    [16:00:39.596] [Info] Application: Initializing SDL Joystick
    [16:00:39.629] [Info] Application: Initializing SDL Sound
    [16:00:39.774] [Info] Failed to initialize Steam platform services
    [16:00:39.774] [Error] Failed to instantiate discord core (err 26)
    [16:00:39.774] [Info] Was not able to authenticate with Discord and create all components, Discord services will be unavailable
    [16:00:39.774] [Info] Application: Creating SDL Window
    [16:00:40.091] [Info] Application: Enabling VSync with late swap tearing
    [16:00:40.154] [Info] Application: Opened default audio device with 44.1khz / 16 bit stereo audio, 2048 sample size buffer
    [16:00:40.160] [Info] OpenGL version: '4.5.13542 Compatibility Profile Context 25.20.14011.5005' vendor: 'ATI Technologies Inc.' renderer: 'AMD Radeon(TM) RX 560 Series' shader: '4.50'
    [16:00:40.162] [Info] Application: initialization...
    [16:00:40.163] [Info] Root: Loaded Configuration in 0.001275 seconds
    [16:00:40.164] [Info] Application: Disabling VSync
    [16:00:40.168] [Info] Application: renderer initialization...
    [16:00:40.170] [Info] detected supported OpenGL texture size 16384, using atlasNumCells 128
    [16:00:40.170] [Info] detected supported OpenGL texture size 16384, using atlasNumCells 64
    [16:00:40.172] [Info] Root: Loaded ImageMetadataDatabase in 2.40002e-06 seconds
    [16:00:40.197] [Info] Application: main update loop...
    [16:00:40.229] [Info] Root: Loaded NameGenerator in 0.0161536 seconds
    [16:00:40.361] [Info] Root: Loaded PlantDatabase in 0.131658 seconds
    [16:00:40.607] [Info] Root: Loaded ObjectDatabase in 0.39339 seconds
    [16:00:40.810] [Info] Root: Loaded MonsterDatabase in 0.203275 seconds
    [16:00:40.855] [Info] Root: Loaded NpcDatabase in 0.0448333 seconds
    [16:00:40.857] [Info] Root: Loaded StagehandDatabase in 0.0011014 seconds
    [16:00:40.860] [Info] Root: Loaded VehicleDatabase in 0.0035564 seconds
    [16:00:40.864] [Info] Root: Loaded PlayerFactory in 0.003981 seconds
    [16:00:40.893] [Info] Root: Loaded ProjectileDatabase in 0.531436 seconds
    [16:00:40.894] [Info] Root: Loaded VersioningDatabase in 0.0010379 seconds
    [16:00:40.894] [Info] Root: Loaded EntityFactory in 0.0297868 seconds
    [16:00:40.938] [Info] Root: Loaded ParticleDatabase in 0.0438782 seconds
    [16:00:41.200] [Info] Root: Loaded MaterialDatabase in 0.305906 seconds
    [16:00:41.206] [Info] Root: Loaded TerrainDatabase in 0.0054768 seconds
    [16:00:41.242] [Info] Root: Loaded BiomeDatabase in 0.0362259 seconds
    [16:00:41.243] [Info] Root: Loaded LiquidsDatabase in 0.0007607 seconds
    [16:00:41.249] [Info] Root: Loaded StatusEffectDatabase in 0.0067379 seconds
    [16:00:41.583] [Info] Root: Loaded DamageDatabase in 0.333947 seconds
    [16:00:41.588] [Info] Root: Loaded EffectSourceDatabase in 0.0045771 seconds
    [16:00:41.593] [Info] Root: Loaded FunctionDatabase in 0.0049198 seconds
    [16:00:41.622] [Info] Root: Loaded TreasureDatabase in 0.028626 seconds
    [16:00:41.900] [Info] Root: Loaded DungeonDefinitions in 0.278594 seconds
    [16:00:41.900] [Info] Root: Loaded TilesetDatabase in 5.97e-05 seconds
    [16:00:41.903] [Info] Root: Loaded StatisticsDatabase in 0.0026404 seconds
    [16:00:41.903] [Info] Root: Loaded EmoteProcessor in 7.2e-05 seconds
    [16:00:41.910] [Info] Root: Loaded SpeciesDatabase in 0.0062455 seconds
    [16:00:41.925] [Info] Root: Loaded QuestTemplateDatabase in 0.0150153 seconds
    [16:00:41.927] [Info] Root: Loaded AiDatabase in 0.0015982 seconds
    [16:00:41.928] [Info] Root: Loaded TechDatabase in 0.0011168 seconds
    [16:00:41.934] [Info] Root: Loaded CodexDatabase in 0.0063009 seconds
    [16:00:42.255] [Info] Root: Loaded BehaviorDatabase in 0.32087 seconds
    [16:00:42.258] [Info] Root: Loaded DanceDatabase in 0.0032382 seconds
    [16:00:42.265] [Info] Root: Loaded SpawnTypeDatabase in 0.0063528 seconds
    [16:00:42.269] [Info] Root: Loaded RadioMessageDatabase in 0.004015 seconds
    [16:00:43.973] [Info] Root: Loaded ItemDatabase in 3.08054 seconds
    [16:00:44.110] [Info] Root: Loaded CollectionDatabase in 1.84108 seconds
    [16:00:44.556] [Info] Root: Writing runtime configuration to '..\storage\starbound.config'
    [16:00:44.653] [Info] detected supported OpenGL texture size 16384, using atlasNumCells 256
    [16:00:47.143] [Info] UniverseServer: Acquiring universe lock file
    [16:00:47.145] [Info] UniverseServer: Loading settings
    [16:00:47.147] [Info] UniverseServer: Starting UniverseServer with UUID: df6fa7cddaf94107be973aed6481138c
    [16:00:47.155] [Info] UniverseServer: Logged in player 'Vyakhar' locally
    [16:00:47.155] [Info] UniverseServer: Logged in account '<anonymous>' as player 'Vyakhar' from address local
    [16:00:47.167] [Info] UniverseServer: Loading system world (772705034, -497773360, -128633895) from disk storage
    [16:00:47.176] [Info] UniverseClient: Joined server as client 1
    [16:00:47.216] [Info] UniverseServer: Reviving player at ClientShipWorld:0139805ae56047b7c9522f14acfe121b
    [16:00:47.216] [Info] UniverseServer: Client 'Vyakhar' <1> (local) connected
    [16:00:47.266] [Info] UniverseServer: Loading client ship world ClientShipWorld:0139805ae56047b7c9522f14acfe121b
    [16:00:47.370] [Info] Protected dungeonIds for world set to (65524)
    [16:00:47.627] [Warn] Failed to deserialize entity: (JsonException) No such key in Json::get("opened")
    [0] 7ff6af7f78c3 Star::captureStack
    [1] 7ff6af7f664e Star::StarException::StarException
    [2] 7ff6af7961b9 Star::Json::get
    [3] 7ff6af796b8c Star::Json::getInt
    [4] 7ff6afe341ea Star::ContainerObject::readStoredData
    [5] 7ff6afaa8d05 Star::ObjectDatabase::diskLoadObject
    [6] 7ff6af93c165 Star::EntityFactory::diskLoadEntity
    [7] 7ff6af93d35c Star::EntityFactory::loadVersionedEntity
    [8] 7ff6afdcdc42 Star::WorldStorage::loadSectorToLevel
    [9] 7ff6afdcc8a5 Star::WorldStorage::generateSectorToLevel
    [10] 7ff6afdcac44 Star::WorldStorage::activateSector
    [11] 7ff6afdaebf9 Star::WorldServer::generateRegion
    [12] 7ff6afdb2e51 Star::WorldServer::init
    [13] 7ff6afd9898a Star::WorldServer::WorldServer
    [14] 7ff6afcbd6b0 std::make_shared<Star::WorldServer,Star::MapMixin<Star::FlatHashMap<Star::ByteArray,Star::Maybe<Star::ByteArray>,Star::hash<Star::ByteArray,void>,std::equal_to<Star::ByteArray>,std::allocator<std::pair<Star::ByteArray const ,Star::Maybe<Star::ByteArray> > > > > & __ptr64>
    [15] 7ff6afcc9996 <lambda_b7d664bc5694634169a6e275ccf1e4a2>::eek:perator()
    [16] 7ff6afcb242f std::_Invoker_functor::_Call<<lambda_b7d664bc5694634169a6e275ccf1e4a2> & __ptr64>
    [17] 7ff6afcb9076 std::invoke<<lambda_b7d664bc5694634169a6e275ccf1e4a2> & __ptr64>
    [18] 7ff6afcb53d9 std::_Invoke_ret<std::shared_ptr<Star::WorldServerThread>,<lambda_b7d664bc5694634169a6e275ccf1e4a2> & __ptr64>
    [19] 7ff6afccb706 std::_Func_impl<<lambda_b7d664bc5694634169a6e275ccf1e4a2>,std::allocator<int>,std::shared_ptr<Star::WorldServerThread> >::_Do_call
    [20] 7ff6afbab5b7 std::_Func_class<std::shared_ptr<Star::DungeonDefinitions> >::eek:perator()
    [21] 7ff6afcc8802 <lambda_770d99c769b4950d94783c330804382d>::eek:perator()
    [22] 7ff6af7ef202 Star::WorkerPool::WorkerThread::run
    [23] 7ff6af7f440e Star::ThreadImpl::runThread
    [24] 7ff87f2b7e94 BaseThreadInitThunk
    [25] 7ff8813ea251 RtlUserThreadStart
    [16:00:47.684] [Info] detected supported OpenGL texture size 16384, using atlasNumCells 64
    [16:00:47.684] [Info] detected supported OpenGL texture size 16384, using atlasNumCells 128
    [16:00:47.692] [Info] detected supported OpenGL texture size 16384, using atlasNumCells 256
    [16:00:47.692] [Info] detected supported OpenGL texture size 16384, using atlasNumCells 256
    [16:00:47.872] [Info] UniverseServer: Warping player 1 to ClientShipWorld:0139805ae56047b7c9522f14acfe121b=1038.49.1024
    [16:01:02.134] [Error] Exception caught in client main-loop
    (JsonException) Improper conversion to int from null
    [0] 7ff6af7f78c3 Star::captureStack
    [1] 7ff6af7f664e Star::StarException::StarException
    [2] 7ff6af78e04a Star::JsonException::format<Star::String>
    [3] 7ff6af79cc61 Star::Json::toInt
    [4] 7ff6afe32215 Star::ContainerObject::containerOpen
    [5] 7ff6b000d67a Star::ContainerInteractor::eek:penContainer
    [6] 7ff6b0043f11 Star::MainInterface::handleInteractAction
    [7] 7ff6af73e915 Star::ClientApplication::updateRunning
    [8] 7ff6af73cfb0 Star::ClientApplication::update
    [9] 7ff6aff3cc24 Star::SdlPlatform::run
    [10] 7ff6aff3cddd Star::runMainApplication
    [11] 7ff6af7404a1 WinMain
    [12] 7ff6b013849f __scrt_common_main_seh
    [13] 7ff87f2b7e94 BaseThreadInitThunk
    [14] 7ff8813ea251 RtlUserThreadStart
    [16:01:02.136] [Info] UniverseClient: Client disconnecting...
    [16:01:02.239] [Info] Client received world stop packet, leaving: Removed
    [16:01:02.341] [Info] UniverseServer: Client 'Vyakhar' <1> (local) disconnected for reason:
    [16:01:02.342] [Info] UniverseServer: Stopping idle world ClientShipWorld:0139805ae56047b7c9522f14acfe121b
    [16:01:02.582] [Info] UniverseServer: Stopping UniverseServer
    [16:01:07.009] [Info] detected supported OpenGL texture size 16384, using atlasNumCells 256
    [16:01:18.745] [Info] Application: quit requested
    [16:01:18.745] [Info] Application: quitting...
    [16:01:18.745] [Info] Application: shutdown...
    [16:01:18.865] [Info] Root: Shutting down Root
    [16:01:19.150] [Error] OpenGL errors during shutdown: GL_INVALID_VALUE
    [16:01:19.151] [Info] Application: Destroying SDL Window
    [16:01:19.167] [Info] Application: stopped gracefully




    {
    "objectName" : "mk1assembler",
    "colonyTags" : ["automation"],
    "rarity" : "Common",
    "category" : "automation",
    "price" : 500,
    "objectType" : "container",
    "slotCount" : 2,
    "uiConfig" : "/interface/objectcrafting/stonefurnace.config",

    "description" : "A crude assembler.",
    "shortdescription" : "Assembler",
    "race" : "generic",

    "inventoryIcon" : "mk1assemblericon.png",
    "orientations" : [
    {
    "dualImage" : "mk1assembler.png:<color>.<frame>",
    "imagePosition" : [-8, 0],
    "frames" : 3,
    "animationCycle" : 0.5,

    "spaceScan" : 0.1,
    "anchors" : ["bottom"]
    }
    ]
    }
     
  2. bk3k

    bk3k Oxygen Tank

    The old stone furnace interface isn't used nor supported anymore. There really isn't any reason for it to be in the assets anymore. As far as working as a container, start with this example vanilla container and edit as needed.

    Code:
    {
      "objectName" : "gunchest",
      "colonyTags" : ["storage","combat"],
      "rarity" : "Common",
      "objectType" : "container",
      "tooltipKind" : "container",
    
      "category" : "storage",
      "price" : 115,
      "description" : "A hi-tech container for guns.",
      "shortdescription" : "Gun Chest",
      "race" : "generic",
      "health" : 1.5,
    
      "apexDescription" : "I've seen many a Miniknog guard store their guns in chests like this.",
      "avianDescription" : "I believe these chests are used to store firearms.",
      "floranDescription" : "Ugly fishmen put guns in this chesst.",
      "glitchDescription" : "Reassured. A hi-tech chest universally recognised for gun storage.",
      "humanDescription" : "A storage container for guns. I've seen people on TV use these.",
      "hylotlDescription" : "A chest for gun storage. I've seen one of these before somewhere.",
      "novakidDescription" : "This is some fancy way to store guns.",
    
      "inventoryIcon" : "gunchesticon.png",
      "lightColor" : [100, 0, 30],
      "orientations" : [
        {
          "imageLayers" : [ { "image" : "gunchest.png:<color>.<key>", "fullbright" : true }, { "image" : "gunchestlit.png:<color>.<key>" } ],
          "imagePosition" : [-8, 0],
          "direction" : "left",
          "flipImages" : true,
    
          "spaces" : [ [-1, 0], [0, 0], [-1, 1], [0, 1], [-1, 2], [0, 2], [-1, 3], [0, 3] ],
          "anchors" : [ "bottom" ]
        },
        {
          "imageLayers" : [ { "image" : "gunchest.png:<color>.<key>", "fullbright" : true }, { "image" : "gunchestlit.png:<color>.<key>" } ],
          "imagePosition" : [-8, 0],
          "direction" : "right",
    
          "spaces" : [ [-1, 0], [0, 0], [-1, 1], [0, 1], [-1, 2], [0, 2], [-1, 3], [0, 3] ],
          "anchors" : [ "bottom" ]
        }
      ],
    
      "openSounds" : [ "/sfx/objects/gunchest_open.ogg" ],
      "closeSounds" : [ "/sfx/objects/gunchest_close.ogg" ],
      "frameCount" : 5,
      "slotCount" : 16,
      "uiConfig" : "/interface/chests/chest<slots>.config",
      "frameCooldown" : 5,
      "openFrameIndex" : 4,
      "autoCloseCooldown" : 3600
    }
    
    Assuming you wanted old style crafting where you put things in the object to process... the engine doesn't do that anymore sadly. The solution will require plenty of LUA scripting. You will need to build an entire crafting system from scratch (bypassing the vanilla system). Doing just that is technically on my "to do list" but I've been totally demotivated for a while. Although I'm messing with Starbound somewhat today so I might possibly get back on that. Maybe.
     
    jakecool19 likes this.
  3. jakecool19

    jakecool19 Pangalactic Porcupine

    Wow thank you for the super fast reply, I'll try this as soon as I get back to my pc. I've already got a basic automation lua script ready to go. I just need the container and the interface, and if your solution works all I'll have left to worry about is making an interface. Unfortunately not much documentation for making a custom interface but I can have so fun figuring it out. Anyways thank you so much.
     
  4. bk3k

    bk3k Oxygen Tank

    Interface wise - you'll have to spend a lot of time staring at vanilla interfaces. You can probably see from objects that parts of the interface can be added/replaced/etc via objects. That works well with more generic interfaces, with the details filled in by the object.

    But you can go further. You can build your interface itself in LUA and pass that along to the engine. An example would be the Tabula Rasa mod. Or you can do something more minor and modify specific things about it via LUA. You can also pass custom recipes - IIRC Frog's Furnishings does this.
     
    jakecool19 likes this.
  5. jakecool19

    jakecool19 Pangalactic Porcupine

    Update: Turns out frameCooldown and autoClosecooldown are both necessary for a container. Thanks again @bk3k
     
    Errors4l likes this.

Share This Page