Modding Help Help with .lua please?

Discussion in 'Starbound Modding' started by Nujuju299, May 16, 2016.

  1. Nujuju299

    Nujuju299 Big Damn Hero

    Same mod from the previous two topics just onto another issue at least. I want to say really quickly that I'm not familiar with lua and tried to pick it up, but it's not easy. I figure that it should be working right now, because non-lua eyes are telling me it should be working, but I figure I overlooked something because I'm not fluent in the language yet.
    -Tried the docs.starbound.com but it said it was down or inaccessible right now.
    -Tried the lua page and can't afford to go out and buy a book just to learn lua for one topic and the free learn lua page is the entirety of lua while I need functions to also relate specifically to Starbound, aside from my goal being what should be a simple five line task.
    -The tutorial page by OmnipotentEntity is useful for getting specifically to the points I need, but is hard to understand it's use due to only referencing the functions.

    If someone could point me towards another source to figure this out that would certainly help, but.... I've already spent a bit of time on this and want to know where I went wrong in the first place too. All the same thank you.

    Again I figure it's something I overlooked and didn't see because it's spitting out a null value can't be variable or something. I would love to know which one it is too if possible, but I dunno. :/ So, what I have so far is as follows.

    I ran the .jsons through JsonLint and the Lua script through the lua demo, both of which are saying it works, but I know that only means I'm syntax free, and my log is only saying "DO IT AGAIN!"

    My log:
    Code:
    Start logging at: 2016-05-15 19:10:44.422
    [19:10:44.424] Info: Star::Root using bootstrap file 'C:\Valve\Steam\steamapps\common\Starbound\win64\sbboot.config'
    [19:10:44.424] Info: Star::Root using storage directory 'C:\Valve\Steam\steamapps\common\Starbound\giraffe_storage\'
    [19:10:44.424] Info: Preparing Star::Root...
    [19:10:44.424] Info: Detected mod 'Crystal Weapons' at '../giraffe_storage/mods\Crystal Weapons\.'
    [19:10:44.424] Info: Loading Configuration with config file: 'starbound.config'
    [19:10:44.424] Info: Loading Star::Configuration from 'Just (.\..\giraffe_storage\starbound.config)'
    [19:10:44.425] Info: Writing Star::Configuration to '.\..\giraffe_storage\starbound.config'
    [19:10:44.430] Info: Initializing Star::Root with 3 assets sources
    [19:10:44.430] Info: Done preparing Star::Root.
    [19:10:44.430] Info: Client Version 'Beta v. Glad Giraffe - Update 3' Revision: 30555b17a491c2a97ab0afbff3b848a1fd937dbd Protocol: 711
    [19:10:44.430] Info: Initialized SDL
    [19:10:44.986] Info: Initialized SDL Video
    [19:10:44.998] Info: Initialized SDL Joystick
    [19:10:45.000] Info: Initialized SDL Sound
    [19:10:45.026] Info: Opened default audio device with 44khz / 16 bit stereo audio, 2048 sample size buffer
    [19:10:45.027] Info: Loading Assets
    [19:10:45.027] Info: Loading assets from: '../assets/packed.pak'
    [19:10:45.027] Info: Loading assets from: '../assets/user'
    [19:10:45.027] Info: Loading assets from: '../giraffe_storage/mods\Crystal Weapons\.'
    [19:10:45.279] Info: Done loading Assets in 0.252 seconds
    [19:10:45.283] Info: Loading NameGenerator
    [19:10:45.283] Info: Initializing SDL Window
    [19:10:45.287] Info: Done loading NameGenerator in 0.00399995 seconds
    [19:10:45.287] Info: Loading ObjectDatabase
    [19:10:45.765] Info: Done loading ObjectDatabase in 0.478 seconds
    [19:10:45.765] Info: Loading PlantDatabase
    [19:10:45.856] Info: Done loading PlantDatabase in 0.0909998 seconds
    [19:10:45.856] Info: Loading ProjectileDatabase
    [19:10:46.048] Info: OpenGL version: '4.5.0 NVIDIA 365.10' vendor: 'NVIDIA Corporation' renderer: 'GeForce GTX 680/PCIe/SSE2' shader: '4.50 NVIDIA'
    [19:10:46.048] Info: Created initial window 1920x1080
    [19:10:46.057] Info: Renderer initialized
    [19:10:46.059] Info: Renderer destroyed
    [19:10:46.060] Info: Initializing SDL Window
    [19:10:46.385] Info: Done loading ProjectileDatabase in 0.529 seconds
    [19:10:46.385] Info: Loading MonsterDatabase
    [19:10:46.399] Info: OpenGL version: '4.5.0 NVIDIA 365.10' vendor: 'NVIDIA Corporation' renderer: 'GeForce GTX 680/PCIe/SSE2' shader: '4.50 NVIDIA'
    [19:10:46.400] Info: Re-created window 1920x1080
    [19:10:46.400] Info: Renderer initialized
    [19:10:46.401] Info: Loading ImageMetadataDatabase
    [19:10:46.401] Info: Done loading ImageMetadataDatabase in 0 seconds
    [19:10:46.670] Info: Done loading MonsterDatabase in 0.285 seconds
    [19:10:46.670] Info: Loading NpcDatabase
    [19:10:46.718] Info: Done loading NpcDatabase in 0.0479999 seconds
    [19:10:46.718] Info: Loading StagehandDatabase
    [19:10:46.718] Info: Done loading StagehandDatabase in 0 seconds
    [19:10:46.718] Info: Loading VehicleDatabase
    [19:10:46.720] Info: Done loading VehicleDatabase in 0.00200009 seconds
    [19:10:46.721] Info: Loading PlayerFactory
    [19:10:46.724] Info: Done loading PlayerFactory in 0.00300002 seconds
    [19:10:46.724] Info: Loading EntityFactory
    [19:10:46.724] Info: Loading VersioningDatabase
    [19:10:46.725] Info: Done loading VersioningDatabase in 0.00100017 seconds
    [19:10:46.725] Info: Done loading EntityFactory in 0.00100017 seconds
    [19:10:46.725] Info: Loading ItemDatabase
    [19:10:50.156] Info: Loading FunctionDatabase
    [19:10:50.171] Info: Done loading FunctionDatabase in 0.0149999 seconds
    [19:10:50.173] Info: Loading ParticleDatabase
    [19:10:50.245] Info: Done loading ParticleDatabase in 0.0709999 seconds
    [19:10:52.585] Info: Done loading ItemDatabase in 5.86 seconds
    [19:10:52.585] Info: Loading MaterialDatabase
    [19:10:52.686] Info: Done loading MaterialDatabase in 0.101 seconds
    [19:10:52.686] Info: Loading TerrainDatabase
    [19:10:52.718] Info: Done loading TerrainDatabase in 0.0319998 seconds
    [19:10:52.718] Info: Loading BiomeDatabase
    [19:10:52.764] Info: Done loading BiomeDatabase in 0.046 seconds
    [19:10:52.764] Info: Loading LiquidsDatabase
    [19:10:52.765] Info: Done loading LiquidsDatabase in 0.00100017 seconds
    [19:10:52.765] Info: Loading StatusEffectDatabase
    [19:10:52.780] Info: Done loading StatusEffectDatabase in 0.0149999 seconds
    [19:10:52.780] Info: Loading DamageDatabase
    [19:10:52.925] Info: Done loading DamageDatabase in 0.145 seconds
    [19:10:52.925] Info: Loading EffectSourceDatabase
    [19:10:52.936] Info: Done loading EffectSourceDatabase in 0.0110002 seconds
    [19:10:52.936] Info: Loading TreasureDatabase
    [19:10:52.968] Info: Done loading TreasureDatabase in 0.0319998 seconds
    [19:10:52.968] Info: Loading DungeonDefinitions
    [19:10:53.241] Info: Done loading DungeonDefinitions in 0.273 seconds
    [19:10:53.241] Info: Loading TilesetDatabase
    [19:10:53.241] Info: Done loading TilesetDatabase in 0 seconds
    [19:10:53.241] Info: Loading EmoteProcessor
    [19:10:53.241] Info: Done loading EmoteProcessor in 0 seconds
    [19:10:53.241] Info: Loading SpeciesDatabase
    [19:10:53.246] Info: Done loading SpeciesDatabase in 0.00500011 seconds
    [19:10:53.246] Info: Loading QuestTemplateDatabase
    [19:10:53.263] Info: Done loading QuestTemplateDatabase in 0.017 seconds
    [19:10:53.263] Info: Loading AiDatabase
    [19:10:53.274] Info: Done loading AiDatabase in 0.0109999 seconds
    [19:10:53.275] Info: Loading TechDatabase
    [19:10:53.277] Info: Done loading TechDatabase in 0.00199986 seconds
    [19:10:53.277] Info: Loading CodexDatabase
    [19:10:53.376] Info: Done loading CodexDatabase in 0.099 seconds
    [19:10:53.376] Info: Loading BehaviorDatabase
    [19:10:53.429] Info: Done loading BehaviorDatabase in 0.0530002 seconds
    [19:10:53.429] Info: Loading DanceDatabase
    [19:10:53.431] Info: Done loading DanceDatabase in 0.00199986 seconds
    [19:10:53.432] Info: Loading SpawnTypeDatabase
    [19:10:53.437] Info: Done loading SpawnTypeDatabase in 0.00500011 seconds
    [19:10:53.438] Info: Done fully loading Star::Root
    [19:10:53.440] Info: Renderer destroyed
    [19:10:54.770] Info: Renderer initialized
    [19:10:57.409] Info: Renderer destroyed
    [19:10:57.429] Info: UniverseServer: Acquiring universe lock file
    [19:10:57.434] Info: UniverseServer: Loading settings
    [19:10:57.435] Info: UniverseServer: No default world set; using randomized starter worlds
    [19:10:57.436] Info: UniverseServer: Starting UniverseServer with UUID: 9687e17e3a816f595a1b7f01b4ecc751
    [19:10:57.439] Info: UniverseServer: Logged in player 'Clem Dodger' locally
    [19:10:57.439] Info: UniverseServer: Logged in account '<anonymous>' as player 'Clem Dodger' from address local
    [19:10:57.444] Info: UniverseServer: Reviving player at ClientShipWorld:55f446c041a7c2fafe35754a4c560658
    [19:10:57.444] Info: UniverseServer: Client 'Clem Dodger' <1> (local) connected
    [19:10:57.444] Info: UniverseClient: Joined server as client 1
    [19:10:57.540] Info: UniverseServer: Loading client ship world ClientShipWorld:55f446c041a7c2fafe35754a4c560658
    [19:10:57.691] Info: Renderer initialized
    [19:10:58.073] Info: UniverseServer: Loading celestial world -472048208:502444686:11847332:5:1
    [19:11:00.241] Error: WorldServerThread exception caught: (JsonException) Cannot convert from null to string
    [0] 13fa81933
    [1] 13fa7e2c8
    [2] 13fa971d6
    [3] 13fa030ed
    [4] 13f7f9fb5
    [5] 13f829a23
    [6] 13f829892
    [7] 13fa95f0d
    [8] 77a65a4d BaseThreadInitThunk
    [9] 77b9b831 RtlUserThreadStart
    [19:11:00.329] Error: UniverseServer: World thread has stopped due to an error, removing world ClientShipWorld:55f446c041a7c2fafe35754a4c560658
    [19:11:00.507] Info: Client received world stop packet, leaving: Removed
    [19:11:00.591] Info: UniverseServer: Client 'Clem Dodger' <1> (local) disconnected
    [19:11:00.600] Error: You were disconnected from the server for the following reason:
    Client ship world has errored
    [19:11:00.600] Info: Renderer destroyed
    [19:11:00.691] Info: UniverseServer: Stopping UniverseServer
    [19:11:00.814] Info: Renderer initialized
    [19:11:01.673] Info: Renderer destroyed
    [19:11:01.707] Info: Renderer initialized
    [19:11:02.825] Info: Renderer destroyed
    [19:11:02.825] Info: Application quitting!
    [19:11:02.825] Info: Client shutdown gracefully
    [19:11:03.273] Info: Shutting down Star::Root
    


    My .lua:
    Code:
    function update(dt)
      local catalyst = world.containerItemAt(entity.id(),0)
      local weapon = world.containerItemAt(entity.id(),1)
      if catalyst and catalyst.name == "crystal" and weapon and weapon.tooltipKind == "sword" then
        weapon.level = weapon.level+1
      end
    end
    
    function consumecatalyst()
      local consumed = world.containerConsumeAt(entity.id(), 0,1)
      return consumed
    end
    


    If by chance you need my object and config which so far seems to be working otherwise, and goes into my two previous topics;

    .object:
    Code:
    {
      "objectName" : "NCW_crystalupgrade",
      "colonyTags" : ["crafting", "hoard", "valuable", "combat"],
      "rarity" : "rare",
      "printable" : false,
      "subtitle" : "Weapon upgrade",
      "objectType" : "container",
      "tooltipKind" : "container",
      "description" : "[PH]Refine Crystal Weapons.",
      "shortdescription" : "[PH]Crystal Whetstone",
      "race" : "generic",
      "statusEffects" : [],
      "category" : "crafting",
      "price" : 300,
      "inventoryIcon" : "crystalupgradeicon.png",
      "orientations" : [
        {
         "dualImage" : "crystalupgrade.png",
         "imagePosition" : [-16,0],
         "spaceScan" : 0.1,
         "anchors" : ["bottom"]
        }
      ],
      "scripts" : ["/objects/Crystal Upgrade/crystalupgrade.lua"],
      "slotCount" : 2,
      "uiConfig" : "/objects/Crystal Upgrade/crystalupgrade.config",
      "frameCooldown" : 5,
      "autoCloseCooldown" : 3600
    }
    


    .config:
    Code:
    {
      "gui" : {
        "background" : {
         "type" : "background",
         "fileHeader" : "/objects/Crystal Upgrade/Crystal_header.png",
         "fileBody" : "/objects/Crystal Upgrade/Crystal_body.png",
         "fileFooter" : "/objects/Crystal Upgrade/Crystal_footer.png"
        },
        "toggleCrafting" : {
         "type" : "button",
         "position" : [5, 39],
         "base" : "/interface/objectcrafting/cook.png",
         "hover" : "/interface/objectcrafting/cookover.png",
         "caption" : "Refine"
        },
        "itemGrid" : {
          "type" : "itemgrid",
         "position" : [74, 37],
         "dimensions" : [1,1],
         "spacing" : [10, 10],
         "backingImage" : "/interface/inventory/empty.png"
        },
        "outputItemGrid" : {
          "type" : "itemgrid",
         "slotOffset" : 1,
          "position" : [110,37],
          "dimensions" : [1,1],
          "spacing" : [19,19],
          "backingImage" : "/interface/inventory/empty.png"
        },
        "pointer" : {
         "type" : "image",
         "position" : [96,40],
         "file" : "/interface/objectcrafting/arrow.png"
        },
        "overlay" : {
          "type" : "image",
          "file" : "/interface/objectcrafting/campfire_shine.png",
          "position" : [-20, 20]
        }
      }
    }
    


    If it makes a difference, I get a crash to main menu whenever the update function in the lua script is called, from when I hit the button in the config I setup. This happens regardless of items being in the "container slots." :/
     
  2. v6ooo

    v6ooo Space Kumquat

    I've never actually used buttons but that sounds like the problem. I don't know if you can specify a callback function yet.
     
  3. Nujuju299

    Nujuju299 Big Damn Hero

    Shouldn't be, the button I took from the campfire object, the script is at Repairo where it consumes auto chips for repairing vehicles. I wanted the same idea for my object, but to level up weapons instead. Since the vehicle uses a variable for health, weapons use a variable for level, I figure the process is more or less the same, just change the functions from "is this a vehicle?" To "Is this a weapon?" I have confirmed that some of the functions were actually variables in some of the lua scripts when I compared the green hover bike.vehicle, lua, and Repairo lua.
     
  4. Nujuju299

    Nujuju299 Big Damn Hero

    I can test in the morning though, I don't know if I did officially confirm it not being the button, just that the camp fire has a button and no lua script. On that note, maybe I did make a mistake? I didn't figure it should have done anything. Unless someone confirms before me, we'll know in twelve hours.
     
  5. TheElderScroller

    TheElderScroller Pangalactic Porcupine

    The first thing I would test is giving the button "callback" : "null". Starbound needs all buttons to have this callback property to specified afaik.
    "null" will make it null, but it needs a string.
    Thats also just what the log says, null could be the missing value.
     
  6. Nujuju299

    Nujuju299 Big Damn Hero

    Alright, I'm still going to be busy, and I'd read the logs myself so sorry for not doing it myself. At least not yet. :/

    First test: Gave the button callback:null and as soon as the object was interacted with it crashed:
    Code:
    Start logging at: 2016-05-16 10:27:42.837
    [10:27:42.840] Info: Star::Root using bootstrap file 'C:\Valve\Steam\steamapps\common\Starbound\win64\sbboot.config'
    [10:27:42.841] Info: Star::Root using storage directory 'C:\Valve\Steam\steamapps\common\Starbound\giraffe_storage\'
    [10:27:42.841] Info: Preparing Star::Root...
    [10:27:42.842] Info: Detected mod 'Crystal Weapons' at '../giraffe_storage/mods\Crystal Weapons\.'
    [10:27:42.843] Info: Loading Configuration with config file: 'starbound.config'
    [10:27:42.843] Info: Loading Star::Configuration from 'Just (.\..\giraffe_storage\starbound.config)'
    [10:27:42.845] Info: Writing Star::Configuration to '.\..\giraffe_storage\starbound.config'
    [10:27:42.851] Info: Initializing Star::Root with 3 assets sources
    [10:27:42.851] Info: Done preparing Star::Root.
    [10:27:42.851] Info: Client Version 'Beta v. Glad Giraffe - Update 3' Revision: 30555b17a491c2a97ab0afbff3b848a1fd937dbd Protocol: 711
    [10:27:42.852] Info: Initialized SDL
    [10:27:43.565] Info: Initialized SDL Video
    [10:27:43.578] Info: Initialized SDL Joystick
    [10:27:43.581] Info: Initialized SDL Sound
    [10:27:43.609] Info: Opened default audio device with 44khz / 16 bit stereo audio, 2048 sample size buffer
    [10:27:43.611] Info: Loading Assets
    [10:27:43.612] Info: Loading assets from: '../assets/packed.pak'
    [10:27:43.615] Info: Loading assets from: '../assets/user'
    [10:27:43.615] Info: Loading assets from: '../giraffe_storage/mods\Crystal Weapons\.'
    [10:27:43.875] Info: Done loading Assets in 0.264 seconds
    [10:27:43.880] Info: Loading NameGenerator
    [10:27:43.887] Info: Initializing SDL Window
    [10:27:43.893] Info: Done loading NameGenerator in 0.013 seconds
    [10:27:43.893] Info: Loading ObjectDatabase
    [10:27:44.749] Info: OpenGL version: '4.5.0 NVIDIA 365.10' vendor: 'NVIDIA Corporation' renderer: 'GeForce GTX 680/PCIe/SSE2' shader: '4.50 NVIDIA'
    [10:27:44.749] Info: Created initial window 1920x1080
    [10:27:44.770] Info: Renderer initialized
    [10:27:44.772] Info: Renderer destroyed
    [10:27:44.772] Info: Initializing SDL Window
    [10:27:44.991] Info: OpenGL version: '4.5.0 NVIDIA 365.10' vendor: 'NVIDIA Corporation' renderer: 'GeForce GTX 680/PCIe/SSE2' shader: '4.50 NVIDIA'
    [10:27:44.991] Info: Re-created window 1920x1080
    [10:27:44.991] Info: Renderer initialized
    [10:27:44.992] Info: Loading ImageMetadataDatabase
    [10:27:44.992] Info: Done loading ImageMetadataDatabase in 0 seconds
    [10:27:45.947] Info: Done loading ObjectDatabase in 2.054 seconds
    [10:27:45.947] Info: Loading PlantDatabase
    [10:27:46.350] Info: Done loading PlantDatabase in 0.403 seconds
    [10:27:46.350] Info: Loading ProjectileDatabase
    [10:27:47.130] Info: Done loading ProjectileDatabase in 0.78 seconds
    [10:27:47.130] Info: Loading MonsterDatabase
    [10:27:47.737] Info: Done loading MonsterDatabase in 0.607 seconds
    [10:27:47.737] Info: Loading NpcDatabase
    [10:27:47.854] Info: Done loading NpcDatabase in 0.116 seconds
    [10:27:47.854] Info: Loading StagehandDatabase
    [10:27:47.854] Info: Done loading StagehandDatabase in 0 seconds
    [10:27:47.854] Info: Loading VehicleDatabase
    [10:27:47.858] Info: Done loading VehicleDatabase in 0.00399995 seconds
    [10:27:47.858] Info: Loading PlayerFactory
    [10:27:47.862] Info: Done loading PlayerFactory in 0.00399995 seconds
    [10:27:47.862] Info: Loading EntityFactory
    [10:27:47.862] Info: Loading VersioningDatabase
    [10:27:47.866] Info: Done loading VersioningDatabase in 0.00399995 seconds
    [10:27:47.866] Info: Done loading EntityFactory in 0.00399995 seconds
    [10:27:47.866] Info: Loading ItemDatabase
    [10:27:54.768] Info: Loading FunctionDatabase
    [10:27:54.785] Info: Done loading FunctionDatabase in 0.017 seconds
    [10:27:54.793] Info: Loading ParticleDatabase
    [10:27:54.955] Info: Done loading ParticleDatabase in 0.162 seconds
    [10:27:57.431] Info: Done loading ItemDatabase in 9.565 seconds
    [10:27:57.431] Info: Loading MaterialDatabase
    [10:27:58.372] Info: Done loading MaterialDatabase in 0.941 seconds
    [10:27:58.372] Info: Loading TerrainDatabase
    [10:27:58.406] Info: Done loading TerrainDatabase in 0.0340002 seconds
    [10:27:58.406] Info: Loading BiomeDatabase
    [10:27:58.461] Info: Done loading BiomeDatabase in 0.0549998 seconds
    [10:27:58.461] Info: Loading LiquidsDatabase
    [10:27:58.464] Info: Done loading LiquidsDatabase in 0.00300002 seconds
    [10:27:58.464] Info: Loading StatusEffectDatabase
    [10:27:58.489] Info: Done loading StatusEffectDatabase in 0.0250001 seconds
    [10:27:58.489] Info: Loading DamageDatabase
    [10:27:58.635] Info: Done loading DamageDatabase in 0.146 seconds
    [10:27:58.635] Info: Loading EffectSourceDatabase
    [10:27:58.652] Info: Done loading EffectSourceDatabase in 0.017 seconds
    [10:27:58.652] Info: Loading TreasureDatabase
    [10:27:58.686] Info: Done loading TreasureDatabase in 0.0340002 seconds
    [10:27:58.686] Info: Loading DungeonDefinitions
    [10:27:58.983] Info: Done loading DungeonDefinitions in 0.297 seconds
    [10:27:58.983] Info: Loading TilesetDatabase
    [10:27:58.984] Info: Done loading TilesetDatabase in 0.000999928 seconds
    [10:27:58.984] Info: Loading EmoteProcessor
    [10:27:58.984] Info: Done loading EmoteProcessor in 0 seconds
    [10:27:58.984] Info: Loading SpeciesDatabase
    [10:27:58.992] Info: Done loading SpeciesDatabase in 0.00800014 seconds
    [10:27:58.992] Info: Loading QuestTemplateDatabase
    [10:27:59.018] Info: Done loading QuestTemplateDatabase in 0.026 seconds
    [10:27:59.018] Info: Loading AiDatabase
    [10:27:59.031] Info: Done loading AiDatabase in 0.013 seconds
    [10:27:59.031] Info: Loading TechDatabase
    [10:27:59.034] Info: Done loading TechDatabase in 0.00299978 seconds
    [10:27:59.034] Info: Loading CodexDatabase
    [10:27:59.165] Info: Done loading CodexDatabase in 0.131 seconds
    [10:27:59.165] Info: Loading BehaviorDatabase
    [10:27:59.241] Info: Done loading BehaviorDatabase in 0.076 seconds
    [10:27:59.241] Info: Loading DanceDatabase
    [10:27:59.244] Info: Done loading DanceDatabase in 0.00200009 seconds
    [10:27:59.244] Info: Loading SpawnTypeDatabase
    [10:27:59.250] Info: Done loading SpawnTypeDatabase in 0.00600004 seconds
    [10:27:59.251] Info: Done fully loading Star::Root
    [10:27:59.257] Info: Renderer destroyed
    [10:28:00.639] Info: Renderer initialized
    [10:28:04.080] Info: Renderer destroyed
    [10:28:04.110] Info: UniverseServer: Acquiring universe lock file
    [10:28:04.115] Info: UniverseServer: Loading settings
    [10:28:04.117] Info: UniverseServer: No default world set; using randomized starter worlds
    [10:28:04.118] Info: UniverseServer: Starting UniverseServer with UUID: 9687e17e3a816f595a1b7f01b4ecc751
    [10:28:04.122] Info: UniverseServer: Logged in player 'Clem Dodger' locally
    [10:28:04.122] Info: UniverseServer: Logged in account '<anonymous>' as player 'Clem Dodger' from address local
    [10:28:04.127] Info: UniverseServer: Reviving player at ClientShipWorld:55f446c041a7c2fafe35754a4c560658
    [10:28:04.127] Info: UniverseServer: Client 'Clem Dodger' <1> (local) connected
    [10:28:04.127] Info: UniverseClient: Joined server as client 1
    [10:28:04.223] Info: UniverseServer: Loading client ship world ClientShipWorld:55f446c041a7c2fafe35754a4c560658
    [10:28:04.387] Info: Renderer initialized
    [10:28:04.761] Info: UniverseServer: Loading celestial world -472048208:502444686:11847332:5:1
    [10:28:06.069] Error: Exception caught loading asset: /objects/Crystal Upgrade/crystalupgrade.config, (AssetException) Could not read JSON asset /objects/Crystal Upgrade/crystalupgrade.config
    [0] 13fa11933
    [1] 13fa0e2c8
    [2] 13fa0e3f8
    [3] 13f46b8e0
    [4] 13fbc952e
    [5] 13fb5e910
    [6] 13fb5b8b4
    [7] 77bbd351 RtlRestoreContext
    [8] 13f46d6e2
    [9] 13f4652ef
    [10] 13f468d36
    [11] 13f466859
    [12] 13f46e8a6
    [13] 13f3baaa0
    [14] 13f464635
    [15] 13f463a68
    [16] 13f46384c
    [17] 13f463442
    [18] 13f4630fd
    [19] 13f45f936
    [20] 13f9927fd
    [21] 13f308724
    [22] 13f2ba431
    [23] 13f2bfdc0
    [24] 13f2ad51d
    [25] 13f28e743
    [26] 13f28b794
    [27] 13f9f9a6d
    [28] 13f2a1d70
    [29] 13fb9035b
    [30] 13fb900c3
    [31] 13fb58a1e
    [32] 77a65a4d BaseThreadInitThunk
    [33] 77b9b831 RtlUserThreadStart
    Caused by: (JsonParsingException) Cannot parse json file: /objects/Crystal Upgrade/crystalupgrade.config
    [0] 13fa11933
    [1] 13fa0e2c8
    [2] 13fa0e3f8
    [3] 13f46bb60
    [4] 13fbc7d32
    [5] 13fb5e910
    [6] 13fb5b8b4
    [7] 77bbd351 RtlRestoreContext
    [8] 13f4627e5
    [9] 13f46d6e2
    [10] 13f4652ef
    [11] 13f468d36
    [12] 13f466859
    [13] 13f46e8a6
    [14] 13f3baaa0
    [15] 13f464635
    [16] 13f463a68
    [17] 13f46384c
    [18] 13f463442
    [19] 13f4630fd
    [20] 13f45f936
    [21] 13f9927fd
    [22] 13f308724
    [23] 13f2ba431
    [24] 13f2bfdc0
    [25] 13f2ad51d
    [26] 13f28e743
    [27] 13f28b794
    [28] 13f9f9a6d
    [29] 13f2a1d70
    [30] 13fb9035b
    [31] 13fb900c3
    [32] 13fb58a1e
    [33] 77a65a4d BaseThreadInitThunk
    [34] 77b9b831 RtlUserThreadStart
    Caused by: (JsonParsingException) Error parsing json: bad object, should be ':' at 14:17
    [0] 13fa11933
    [1] 13fa0e2c8
    [2] 13f3e95a0
    [3] 13f4627e5
    [4] 13f46d6e2
    [5] 13f4652ef
    [6] 13f468d36
    [7] 13f466859
    [8] 13f46e8a6
    [9] 13f3baaa0
    [10] 13f464635
    [11] 13f463a68
    [12] 13f46384c
    [13] 13f463442
    [14] 13f4630fd
    [15] 13f45f936
    [16] 13f9927fd
    [17] 13f308724
    [18] 13f2ba431
    [19] 13f2bfdc0
    [20] 13f2ad51d
    [21] 13f28e743
    [22] 13f28b794
    [23] 13f9f9a6d
    [24] 13f2a1d70
    [25] 13fb9035b
    [26] 13fb900c3
    [27] 13fb58a1e
    [28] 77a65a4d BaseThreadInitThunk
    [29] 77b9b831 RtlUserThreadStart
    [10:28:06.077] Error: Exception caught in client main-loop: (AssetException) Error loading asset /objects/Crystal Upgrade/crystalupgrade.config
    [0] 13fa11933
    [1] 13fa0e2c8
    [2] 13f46b825
    [3] 13f468436
    [4] 13f4631b4
    [5] 13f45f936
    [6] 13f9927fd
    [7] 13f308724
    [8] 13f2ba431
    [9] 13f2bfdc0
    [10] 13f2ad51d
    [11] 13f28e743
    [12] 13f28b794
    [13] 13f9f9a6d
    [14] 13f2a1d70
    [15] 13fb9035b
    [16] 13fb900c3
    [17] 13fb58a1e
    [18] 77a65a4d BaseThreadInitThunk
    [19] 77b9b831 RtlUserThreadStart
    [10:28:06.078] Info: UniverseClient: Client disconnecting...
    [10:28:06.178] Info: Client received world stop packet, leaving: Removed
    [10:28:06.297] Info: UniverseServer: Client 'Clem Dodger' <1> (local) disconnected
    [10:28:06.397] Info: UniverseServer: Stopping UniverseServer
    [10:28:06.648] Info: Renderer destroyed
    [10:28:06.648] Info: Application quitting!
    [10:28:06.648] Info: Client shutdown gracefully
    [10:28:07.087] Info: Shutting down Star::Root
    

    Officially the first theory I tested second, by removing the button entirely but the items are also still in the object:
    Code:
    Start logging at: 2016-05-16 10:31:59.939
    [10:31:59.941] Info: Star::Root using bootstrap file 'C:\Valve\Steam\steamapps\common\Starbound\win64\sbboot.config'
    [10:31:59.941] Info: Star::Root using storage directory 'C:\Valve\Steam\steamapps\common\Starbound\giraffe_storage\'
    [10:31:59.941] Info: Preparing Star::Root...
    [10:31:59.941] Info: Detected mod 'Crystal Weapons' at '../giraffe_storage/mods\Crystal Weapons\.'
    [10:31:59.942] Info: Loading Configuration with config file: 'starbound.config'
    [10:31:59.942] Info: Loading Star::Configuration from 'Just (.\..\giraffe_storage\starbound.config)'
    [10:31:59.943] Info: Writing Star::Configuration to '.\..\giraffe_storage\starbound.config'
    [10:31:59.949] Info: Initializing Star::Root with 3 assets sources
    [10:31:59.949] Info: Done preparing Star::Root.
    [10:31:59.949] Info: Client Version 'Beta v. Glad Giraffe - Update 3' Revision: 30555b17a491c2a97ab0afbff3b848a1fd937dbd Protocol: 711
    [10:31:59.949] Info: Initialized SDL
    [10:32:00.509] Info: Initialized SDL Video
    [10:32:00.521] Info: Initialized SDL Joystick
    [10:32:00.524] Info: Initialized SDL Sound
    [10:32:00.551] Info: Opened default audio device with 44khz / 16 bit stereo audio, 2048 sample size buffer
    [10:32:00.551] Info: Loading Assets
    [10:32:00.551] Info: Loading assets from: '../assets/packed.pak'
    [10:32:00.551] Info: Loading assets from: '../assets/user'
    [10:32:00.552] Info: Loading assets from: '../giraffe_storage/mods\Crystal Weapons\.'
    [10:32:00.801] Info: Done loading Assets in 0.25 seconds
    [10:32:00.805] Info: Loading NameGenerator
    [10:32:00.806] Info: Initializing SDL Window
    [10:32:00.809] Info: Done loading NameGenerator in 0.00399995 seconds
    [10:32:00.809] Info: Loading ObjectDatabase
    [10:32:01.279] Info: Done loading ObjectDatabase in 0.47 seconds
    [10:32:01.279] Info: Loading PlantDatabase
    [10:32:01.369] Info: Done loading PlantDatabase in 0.0899999 seconds
    [10:32:01.369] Info: Loading ProjectileDatabase
    [10:32:01.451] Info: OpenGL version: '4.5.0 NVIDIA 365.10' vendor: 'NVIDIA Corporation' renderer: 'GeForce GTX 680/PCIe/SSE2' shader: '4.50 NVIDIA'
    [10:32:01.452] Info: Created initial window 1920x1080
    [10:32:01.461] Info: Renderer initialized
    [10:32:01.462] Info: Renderer destroyed
    [10:32:01.462] Info: Initializing SDL Window
    [10:32:01.701] Info: OpenGL version: '4.5.0 NVIDIA 365.10' vendor: 'NVIDIA Corporation' renderer: 'GeForce GTX 680/PCIe/SSE2' shader: '4.50 NVIDIA'
    [10:32:01.701] Info: Re-created window 1920x1080
    [10:32:01.702] Info: Renderer initialized
    [10:32:01.703] Info: Loading ImageMetadataDatabase
    [10:32:01.703] Info: Done loading ImageMetadataDatabase in 0 seconds
    [10:32:01.956] Info: Done loading ProjectileDatabase in 0.587 seconds
    [10:32:01.956] Info: Loading MonsterDatabase
    [10:32:02.158] Info: Done loading MonsterDatabase in 0.202 seconds
    [10:32:02.158] Info: Loading NpcDatabase
    [10:32:02.212] Info: Done loading NpcDatabase in 0.0540001 seconds
    [10:32:02.212] Info: Loading StagehandDatabase
    [10:32:02.213] Info: Done loading StagehandDatabase in 0.000999928 seconds
    [10:32:02.213] Info: Loading VehicleDatabase
    [10:32:02.215] Info: Done loading VehicleDatabase in 0.00199986 seconds
    [10:32:02.215] Info: Loading PlayerFactory
    [10:32:02.217] Info: Done loading PlayerFactory in 0.00200009 seconds
    [10:32:02.217] Info: Loading EntityFactory
    [10:32:02.217] Info: Loading VersioningDatabase
    [10:32:02.219] Info: Done loading VersioningDatabase in 0.00200009 seconds
    [10:32:02.219] Info: Done loading EntityFactory in 0.00200009 seconds
    [10:32:02.219] Info: Loading ItemDatabase
    [10:32:05.658] Info: Loading FunctionDatabase
    [10:32:05.674] Info: Done loading FunctionDatabase in 0.016 seconds
    [10:32:05.677] Info: Loading ParticleDatabase
    [10:32:05.749] Info: Done loading ParticleDatabase in 0.072 seconds
    [10:32:08.093] Info: Done loading ItemDatabase in 5.874 seconds
    [10:32:08.093] Info: Loading MaterialDatabase
    [10:32:08.196] Info: Done loading MaterialDatabase in 0.103 seconds
    [10:32:08.196] Info: Loading TerrainDatabase
    [10:32:08.231] Info: Done loading TerrainDatabase in 0.0349998 seconds
    [10:32:08.232] Info: Loading BiomeDatabase
    [10:32:08.283] Info: Done loading BiomeDatabase in 0.0509999 seconds
    [10:32:08.283] Info: Loading LiquidsDatabase
    [10:32:08.284] Info: Done loading LiquidsDatabase in 0.000999928 seconds
    [10:32:08.284] Info: Loading StatusEffectDatabase
    [10:32:08.299] Info: Done loading StatusEffectDatabase in 0.0150001 seconds
    [10:32:08.299] Info: Loading DamageDatabase
    [10:32:08.436] Info: Done loading DamageDatabase in 0.137 seconds
    [10:32:08.436] Info: Loading EffectSourceDatabase
    [10:32:08.447] Info: Done loading EffectSourceDatabase in 0.0109999 seconds
    [10:32:08.447] Info: Loading TreasureDatabase
    [10:32:08.475] Info: Done loading TreasureDatabase in 0.0280001 seconds
    [10:32:08.475] Info: Loading DungeonDefinitions
    [10:32:08.738] Info: Done loading DungeonDefinitions in 0.263 seconds
    [10:32:08.738] Info: Loading TilesetDatabase
    [10:32:08.738] Info: Done loading TilesetDatabase in 0 seconds
    [10:32:08.738] Info: Loading EmoteProcessor
    [10:32:08.738] Info: Done loading EmoteProcessor in 0 seconds
    [10:32:08.738] Info: Loading SpeciesDatabase
    [10:32:08.745] Info: Done loading SpeciesDatabase in 0.00700021 seconds
    [10:32:08.745] Info: Loading QuestTemplateDatabase
    [10:32:08.763] Info: Done loading QuestTemplateDatabase in 0.0179999 seconds
    [10:32:08.763] Info: Loading AiDatabase
    [10:32:08.777] Info: Done loading AiDatabase in 0.0139999 seconds
    [10:32:08.777] Info: Loading TechDatabase
    [10:32:08.779] Info: Done loading TechDatabase in 0.00200009 seconds
    [10:32:08.779] Info: Loading CodexDatabase
    [10:32:08.880] Info: Done loading CodexDatabase in 0.101 seconds
    [10:32:08.880] Info: Loading BehaviorDatabase
    [10:32:08.939] Info: Done loading BehaviorDatabase in 0.059 seconds
    [10:32:08.939] Info: Loading DanceDatabase
    [10:32:08.941] Info: Done loading DanceDatabase in 0.00199986 seconds
    [10:32:08.941] Info: Loading SpawnTypeDatabase
    [10:32:08.947] Info: Done loading SpawnTypeDatabase in 0.00600004 seconds
    [10:32:08.948] Info: Done fully loading Star::Root
    [10:32:08.952] Info: Renderer destroyed
    [10:32:10.270] Info: Renderer initialized
    [10:32:12.985] Info: Renderer destroyed
    [10:32:13.008] Info: UniverseServer: Acquiring universe lock file
    [10:32:13.013] Info: UniverseServer: Loading settings
    [10:32:13.014] Info: UniverseServer: No default world set; using randomized starter worlds
    [10:32:13.015] Info: UniverseServer: Starting UniverseServer with UUID: 9687e17e3a816f595a1b7f01b4ecc751
    [10:32:13.018] Info: UniverseServer: Logged in player 'Clem Dodger' locally
    [10:32:13.018] Info: UniverseServer: Logged in account '<anonymous>' as player 'Clem Dodger' from address local
    [10:32:13.023] Info: UniverseServer: Reviving player at ClientShipWorld:55f446c041a7c2fafe35754a4c560658
    [10:32:13.023] Info: UniverseServer: Client 'Clem Dodger' <1> (local) connected
    [10:32:13.024] Info: UniverseClient: Joined server as client 1
    [10:32:13.120] Info: UniverseServer: Loading client ship world ClientShipWorld:55f446c041a7c2fafe35754a4c560658
    [10:32:13.263] Info: Renderer initialized
    [10:32:13.644] Info: UniverseServer: Loading celestial world -472048208:502444686:11847332:5:1
    [10:32:15.174] Error: Exception caught loading asset: /objects/Crystal Upgrade/crystalupgrade.config, (AssetException) Could not read JSON asset /objects/Crystal Upgrade/crystalupgrade.config
    [0] 13fa91933
    [1] 13fa8e2c8
    [2] 13fa8e3f8
    [3] 13f4eb8e0
    [4] 13fc4952e
    [5] 13fbde910
    [6] 13fbdb8b4
    [7] 77bbd351 RtlRestoreContext
    [8] 13f4ed6e2
    [9] 13f4e52ef
    [10] 13f4e8d36
    [11] 13f4e6859
    [12] 13f4ee8a6
    [13] 13f43aaa0
    [14] 13f4e4635
    [15] 13f4e3a68
    [16] 13f4e384c
    [17] 13f4e3442
    [18] 13f4e30fd
    [19] 13f4df936
    [20] 13fa127fd
    [21] 13f388724
    [22] 13f33a431
    [23] 13f33fdc0
    [24] 13f32d51d
    [25] 13f30e743
    [26] 13f30b794
    [27] 13fa79a6d
    [28] 13f321d70
    [29] 13fc1035b
    [30] 13fc100c3
    [31] 13fbd8a1e
    [32] 77a65a4d BaseThreadInitThunk
    [33] 77b9b831 RtlUserThreadStart
    Caused by: (JsonParsingException) Cannot parse json file: /objects/Crystal Upgrade/crystalupgrade.config
    [0] 13fa91933
    [1] 13fa8e2c8
    [2] 13fa8e3f8
    [3] 13f4ebb60
    [4] 13fc47d32
    [5] 13fbde910
    [6] 13fbdb8b4
    [7] 77bbd351 RtlRestoreContext
    [8] 13f4e27e5
    [9] 13f4ed6e2
    [10] 13f4e52ef
    [11] 13f4e8d36
    [12] 13f4e6859
    [13] 13f4ee8a6
    [14] 13f43aaa0
    [15] 13f4e4635
    [16] 13f4e3a68
    [17] 13f4e384c
    [18] 13f4e3442
    [19] 13f4e30fd
    [20] 13f4df936
    [21] 13fa127fd
    [22] 13f388724
    [23] 13f33a431
    [24] 13f33fdc0
    [25] 13f32d51d
    [26] 13f30e743
    [27] 13f30b794
    [28] 13fa79a6d
    [29] 13f321d70
    [30] 13fc1035b
    [31] 13fc100c3
    [32] 13fbd8a1e
    [33] 77a65a4d BaseThreadInitThunk
    [34] 77b9b831 RtlUserThreadStart
    Caused by: (JsonParsingException) Error parsing json: bad object, should be ':' at 14:17
    [0] 13fa91933
    [1] 13fa8e2c8
    [2] 13f4695a0
    [3] 13f4e27e5
    [4] 13f4ed6e2
    [5] 13f4e52ef
    [6] 13f4e8d36
    [7] 13f4e6859
    [8] 13f4ee8a6
    [9] 13f43aaa0
    [10] 13f4e4635
    [11] 13f4e3a68
    [12] 13f4e384c
    [13] 13f4e3442
    [14] 13f4e30fd
    [15] 13f4df936
    [16] 13fa127fd
    [17] 13f388724
    [18] 13f33a431
    [19] 13f33fdc0
    [20] 13f32d51d
    [21] 13f30e743
    [22] 13f30b794
    [23] 13fa79a6d
    [24] 13f321d70
    [25] 13fc1035b
    [26] 13fc100c3
    [27] 13fbd8a1e
    [28] 77a65a4d BaseThreadInitThunk
    [29] 77b9b831 RtlUserThreadStart
    [10:32:15.177] Error: Exception caught in client main-loop: (AssetException) Error loading asset /objects/Crystal Upgrade/crystalupgrade.config
    [0] 13fa91933
    [1] 13fa8e2c8
    [2] 13f4eb825
    [3] 13f4e8436
    [4] 13f4e31b4
    [5] 13f4df936
    [6] 13fa127fd
    [7] 13f388724
    [8] 13f33a431
    [9] 13f33fdc0
    [10] 13f32d51d
    [11] 13f30e743
    [12] 13f30b794
    [13] 13fa79a6d
    [14] 13f321d70
    [15] 13fc1035b
    [16] 13fc100c3
    [17] 13fbd8a1e
    [18] 77a65a4d BaseThreadInitThunk
    [19] 77b9b831 RtlUserThreadStart
    [10:32:15.179] Info: UniverseClient: Client disconnecting...
    [10:32:15.207] Info: Client received world stop packet, leaving: Removed
    [10:32:15.328] Info: UniverseServer: Client 'Clem Dodger' <1> (local) disconnected
    [10:32:15.428] Info: UniverseServer: Stopping UniverseServer
    [10:32:15.664] Info: Renderer destroyed
    [10:32:15.664] Info: Application quitting!
    [10:32:15.664] Info: Client shutdown gracefully
    [10:32:16.153] Info: Shutting down Star::Root
    
     
  7. TheElderScroller

    TheElderScroller Pangalactic Porcupine

    now it looks like it cant read the file as JSON, propably because you forgot to remove something (like a comma, a quote, ect)
    Dont forget to post the uiconfig file & the log, the log alone is almost useless without the config.

    I thought this would do it...
    Code:
    {
      "gui" : {
        "background" : {
         "type" : "background",
         "fileHeader" : "/objects/Crystal Upgrade/Crystal_header.png",
         "fileBody" : "/objects/Crystal Upgrade/Crystal_body.png",
         "fileFooter" : "/objects/Crystal Upgrade/Crystal_footer.png"
        },
        "toggleCrafting" : {
         "type" : "button",
         "callback" : "null",       // callback added
         "position" : [5, 39],
         "base" : "/interface/objectcrafting/cook.png",
         "hover" : "/interface/objectcrafting/cookover.png",
         "caption" : "Refine"
        },
        "itemGrid" : {
          "type" : "itemgrid",
         "position" : [74, 37],
         "dimensions" : [1,1],
         "spacing" : [10, 10],
         "backingImage" : "/interface/inventory/empty.png"
        },
        "outputItemGrid" : {
          "type" : "itemgrid",
         "slotOffset" : 1,
          "position" : [110,37],
          "dimensions" : [1,1],
          "spacing" : [19,19],
          "backingImage" : "/interface/inventory/empty.png"
        },
        "pointer" : {
         "type" : "image",
         "position" : [96,40],
         "file" : "/interface/objectcrafting/arrow.png"
        },
        "overlay" : {
          "type" : "image",
          "file" : "/interface/objectcrafting/campfire_shine.png",
          "position" : [-20, 20]
        }
      }
    }
     
  8. v6ooo

    v6ooo Space Kumquat

    I haven't seen anyone been able to add custom buttons to the container ui. The callback functions are all hardcoded.
    There are just some buttons you can use, "close" is obvious and I think "clear" would take all items in a container. You'd have to test it though.

    Repairo doesn't use the button in the UI yet, it triggers on every Update (scriptDelta). It will most likely coded in when they consider it finished.

    @Nujuju299, for your 2nd log/spoiler, it's pretty obvious mistake. "Caused by: (JsonParsingException) Error parsing json: bad object, should be ':' at 14:17"
     
  9. Nujuju299

    Nujuju299 Big Damn Hero

    Sorry I had stuff to do quickly.
    That would explain why I saw Repairo with a line, "scriptDelta" : 20, so I'm guessing, every 20 frames? @v6ooo Also I was basing off Repairo because it was an object that consumed X to modify variable Z if object Y tag == A, more or less. Sorry for that being convoluted. However, I also wanted to add a button if I could so it wouldn't be just instant but, "If you're ready...."

    Don't need to point out that both errors are in the config file, and sorry to not post the information when I could again. :/

    According to the log, a colon should be on line 14, 17 points in. Well, looking at exactly that, there is a colon there. That entire line reads exactly;
    Code:
         "caption" : "Refine"
    That's unedited though, so that's the button itself which showed up previously just fine, so obviously it's not the caption.
    Having added a line which also didn't get through the .JsonLint found an error with "callback" : "null," for some reason, and was not the end of line, but I'll make a more detailed re-post in a minute now that I have the time.
    So, before I get there, adding a line, I forgot where, would have been another "No colon found but a colon was there?" Error on the callback null, or
    removing the button entirely makes line 14 "backingImage" : "/interface/inventory/empty.png"

    And now for the re-official tests:

    unedited config:
    Code:
    {
      "gui" : {
        "background" : {
         "type" : "background",
         "fileHeader" : "/objects/Crystal Upgrade/Crystal_header.png",
         "fileBody" : "/objects/Crystal Upgrade/Crystal_body.png",
         "fileFooter" : "/objects/Crystal Upgrade/Crystal_footer.png"
        },
        "toggleCrafting" : {
         "type" : "button",
         "position" : [5, 39],
         "base" : "/interface/objectcrafting/cook.png",
         "hover" : "/interface/objectcrafting/cookover.png",
         "caption" : "Refine"
        },
        "itemGrid" : {
          "type" : "itemgrid",
         "position" : [74, 37],
         "dimensions" : [1,1],
         "spacing" : [10, 10],
         "backingImage" : "/interface/inventory/empty.png"
        },
        "outputItemGrid" : {
          "type" : "itemgrid",
         "slotOffset" : 1,
          "position" : [110,37],
          "dimensions" : [1,1],
          "spacing" : [19,19],
          "backingImage" : "/interface/inventory/empty.png"
        },
        "pointer" : {
         "type" : "image",
         "position" : [96,40],
         "file" : "/interface/objectcrafting/arrow.png"
        },
        "overlay" : {
          "type" : "image",
          "file" : "/interface/objectcrafting/campfire_shine.png",
          "position" : [-20, 20]
        }
      }
    }
    

    adding callback, seems no error this time so I must have goofed somewhere earlier:
    Code:
    {
      "gui" : {
        "background" : {
         "type" : "background",
         "fileHeader" : "/objects/Crystal Upgrade/Crystal_header.png",
         "fileBody" : "/objects/Crystal Upgrade/Crystal_body.png",
         "fileFooter" : "/objects/Crystal Upgrade/Crystal_footer.png"
        },
        "toggleCrafting" : {
         "type" : "button",
         "position" : [5, 39],
         "base" : "/interface/objectcrafting/cook.png",
         "hover" : "/interface/objectcrafting/cookover.png",
         "callback" : "null",
         "caption" : "Refine"
        },
        "itemGrid" : {
          "type" : "itemgrid",
         "position" : [74, 37],
         "dimensions" : [1,1],
         "spacing" : [10, 10],
         "backingImage" : "/interface/inventory/empty.png"
        },
        "outputItemGrid" : {
          "type" : "itemgrid",
         "slotOffset" : 1,
          "position" : [110,37],
          "dimensions" : [1,1],
          "spacing" : [19,19],
          "backingImage" : "/interface/inventory/empty.png"
        },
        "pointer" : {
         "type" : "image",
         "position" : [96,40],
         "file" : "/interface/objectcrafting/arrow.png"
        },
        "overlay" : {
          "type" : "image",
          "file" : "/interface/objectcrafting/campfire_shine.png",
          "position" : [-20, 20]
        }
      }
    }
    

    No error, but also nothing happened so we must be on the right track here I guess? Log didn't even spit out errors!
    Code:
    Start logging at: 2016-05-16 11:40:15.596
    [11:40:15.598] Info: Star::Root using bootstrap file 'C:\Valve\Steam\steamapps\common\Starbound\win64\sbboot.config'
    [11:40:15.598] Info: Star::Root using storage directory 'C:\Valve\Steam\steamapps\common\Starbound\giraffe_storage\'
    [11:40:15.598] Info: Preparing Star::Root...
    [11:40:15.598] Info: Detected mod 'Crystal Weapons' at '../giraffe_storage/mods\Crystal Weapons\.'
    [11:40:15.598] Info: Loading Configuration with config file: 'starbound.config'
    [11:40:15.599] Info: Loading Star::Configuration from 'Just (.\..\giraffe_storage\starbound.config)'
    [11:40:15.600] Info: Writing Star::Configuration to '.\..\giraffe_storage\starbound.config'
    [11:40:15.605] Info: Initializing Star::Root with 3 assets sources
    [11:40:15.605] Info: Done preparing Star::Root.
    [11:40:15.606] Info: Client Version 'Beta v. Glad Giraffe - Update 3' Revision: 30555b17a491c2a97ab0afbff3b848a1fd937dbd Protocol: 711
    [11:40:15.606] Info: Initialized SDL
    [11:40:16.146] Info: Initialized SDL Video
    [11:40:16.158] Info: Initialized SDL Joystick
    [11:40:16.161] Info: Initialized SDL Sound
    [11:40:16.187] Info: Opened default audio device with 44khz / 16 bit stereo audio, 2048 sample size buffer
    [11:40:16.187] Info: Loading Assets
    [11:40:16.187] Info: Loading assets from: '../assets/packed.pak'
    [11:40:16.187] Info: Loading assets from: '../assets/user'
    [11:40:16.187] Info: Loading assets from: '../giraffe_storage/mods\Crystal Weapons\.'
    [11:40:16.438] Info: Done loading Assets in 0.251 seconds
    [11:40:16.442] Info: Loading NameGenerator
    [11:40:16.443] Info: Initializing SDL Window
    [11:40:16.446] Info: Done loading NameGenerator in 0.00400019 seconds
    [11:40:16.446] Info: Loading ObjectDatabase
    [11:40:16.904] Info: Done loading ObjectDatabase in 0.458 seconds
    [11:40:16.904] Info: Loading PlantDatabase
    [11:40:16.994] Info: Done loading PlantDatabase in 0.0899999 seconds
    [11:40:16.994] Info: Loading ProjectileDatabase
    [11:40:17.238] Info: OpenGL version: '4.5.0 NVIDIA 365.10' vendor: 'NVIDIA Corporation' renderer: 'GeForce GTX 680/PCIe/SSE2' shader: '4.50 NVIDIA'
    [11:40:17.238] Info: Created initial window 1920x1080
    [11:40:17.248] Info: Renderer initialized
    [11:40:17.249] Info: Renderer destroyed
    [11:40:17.249] Info: Initializing SDL Window
    [11:40:17.488] Info: OpenGL version: '4.5.0 NVIDIA 365.10' vendor: 'NVIDIA Corporation' renderer: 'GeForce GTX 680/PCIe/SSE2' shader: '4.50 NVIDIA'
    [11:40:17.489] Info: Re-created window 1920x1080
    [11:40:17.489] Info: Renderer initialized
    [11:40:17.490] Info: Loading ImageMetadataDatabase
    [11:40:17.491] Info: Done loading ImageMetadataDatabase in 0.000999928 seconds
    [11:40:17.500] Info: Done loading ProjectileDatabase in 0.506 seconds
    [11:40:17.500] Info: Loading MonsterDatabase
    [11:40:17.795] Info: Done loading MonsterDatabase in 0.295 seconds
    [11:40:17.795] Info: Loading NpcDatabase
    [11:40:17.838] Info: Done loading NpcDatabase in 0.043 seconds
    [11:40:17.838] Info: Loading StagehandDatabase
    [11:40:17.838] Info: Done loading StagehandDatabase in 0 seconds
    [11:40:17.838] Info: Loading VehicleDatabase
    [11:40:17.841] Info: Done loading VehicleDatabase in 0.00300002 seconds
    [11:40:17.841] Info: Loading PlayerFactory
    [11:40:17.843] Info: Done loading PlayerFactory in 0.00199986 seconds
    [11:40:17.843] Info: Loading EntityFactory
    [11:40:17.843] Info: Loading VersioningDatabase
    [11:40:17.845] Info: Done loading VersioningDatabase in 0.00200009 seconds
    [11:40:17.845] Info: Done loading EntityFactory in 0.00200009 seconds
    [11:40:17.845] Info: Loading ItemDatabase
    [11:40:21.262] Info: Loading FunctionDatabase
    [11:40:21.276] Info: Done loading FunctionDatabase in 0.0139999 seconds
    [11:40:21.279] Info: Loading ParticleDatabase
    [11:40:21.348] Info: Done loading ParticleDatabase in 0.069 seconds
    [11:40:23.717] Info: Done loading ItemDatabase in 5.872 seconds
    [11:40:23.717] Info: Loading MaterialDatabase
    [11:40:23.816] Info: Done loading MaterialDatabase in 0.099 seconds
    [11:40:23.816] Info: Loading TerrainDatabase
    [11:40:23.857] Info: Done loading TerrainDatabase in 0.0410001 seconds
    [11:40:23.857] Info: Loading BiomeDatabase
    [11:40:23.903] Info: Done loading BiomeDatabase in 0.046 seconds
    [11:40:23.903] Info: Loading LiquidsDatabase
    [11:40:23.904] Info: Done loading LiquidsDatabase in 0.000999928 seconds
    [11:40:23.904] Info: Loading StatusEffectDatabase
    [11:40:23.919] Info: Done loading StatusEffectDatabase in 0.0150001 seconds
    [11:40:23.919] Info: Loading DamageDatabase
    [11:40:24.047] Info: Done loading DamageDatabase in 0.128 seconds
    [11:40:24.047] Info: Loading EffectSourceDatabase
    [11:40:24.057] Info: Done loading EffectSourceDatabase in 0.00999999 seconds
    [11:40:24.057] Info: Loading TreasureDatabase
    [11:40:24.089] Info: Done loading TreasureDatabase in 0.0320001 seconds
    [11:40:24.089] Info: Loading DungeonDefinitions
    [11:40:24.366] Info: Done loading DungeonDefinitions in 0.277 seconds
    [11:40:24.366] Info: Loading TilesetDatabase
    [11:40:24.366] Info: Done loading TilesetDatabase in 0 seconds
    [11:40:24.366] Info: Loading EmoteProcessor
    [11:40:24.366] Info: Done loading EmoteProcessor in 0 seconds
    [11:40:24.366] Info: Loading SpeciesDatabase
    [11:40:24.372] Info: Done loading SpeciesDatabase in 0.00600004 seconds
    [11:40:24.372] Info: Loading QuestTemplateDatabase
    [11:40:24.394] Info: Done loading QuestTemplateDatabase in 0.0220001 seconds
    [11:40:24.395] Info: Loading AiDatabase
    [11:40:24.407] Info: Done loading AiDatabase in 0.0120001 seconds
    [11:40:24.407] Info: Loading TechDatabase
    [11:40:24.414] Info: Done loading TechDatabase in 0.00699997 seconds
    [11:40:24.414] Info: Loading CodexDatabase
    [11:40:24.517] Info: Done loading CodexDatabase in 0.103 seconds
    [11:40:24.517] Info: Loading BehaviorDatabase
    [11:40:24.577] Info: Done loading BehaviorDatabase in 0.0600002 seconds
    [11:40:24.577] Info: Loading DanceDatabase
    [11:40:24.579] Info: Done loading DanceDatabase in 0.00199986 seconds
    [11:40:24.579] Info: Loading SpawnTypeDatabase
    [11:40:24.585] Info: Done loading SpawnTypeDatabase in 0.00600004 seconds
    [11:40:24.586] Info: Done fully loading Star::Root
    [11:40:24.596] Info: Renderer destroyed
    [11:40:25.936] Info: Renderer initialized
    [11:40:30.189] Info: Renderer destroyed
    [11:40:30.215] Info: UniverseServer: Acquiring universe lock file
    [11:40:30.220] Info: UniverseServer: Loading settings
    [11:40:30.221] Info: UniverseServer: No default world set; using randomized starter worlds
    [11:40:30.222] Info: UniverseServer: Starting UniverseServer with UUID: 9687e17e3a816f595a1b7f01b4ecc751
    [11:40:30.225] Info: UniverseServer: Logged in player 'Clem Dodger' locally
    [11:40:30.225] Info: UniverseServer: Logged in account '<anonymous>' as player 'Clem Dodger' from address local
    [11:40:30.230] Info: UniverseServer: Reviving player at ClientShipWorld:55f446c041a7c2fafe35754a4c560658
    [11:40:30.230] Info: UniverseServer: Client 'Clem Dodger' <1> (local) connected
    [11:40:30.231] Info: UniverseClient: Joined server as client 1
    [11:40:30.327] Info: UniverseServer: Loading client ship world ClientShipWorld:55f446c041a7c2fafe35754a4c560658
    [11:40:30.476] Info: Renderer initialized
    [11:40:30.846] Info: UniverseServer: Loading celestial world -472048208:502444686:11847332:5:1
    [11:40:41.214] Info: UniverseServer: Stopping world CelestialWorld:-472048208:502444686:11847332:5:1 due to inactivity
    [11:40:41.314] Info: UniverseServer: World thread has stopped due to inactivity, removing world CelestialWorld:-472048208:502444686:11847332:5:1
    [11:40:49.847] Info: Renderer destroyed
    [11:40:49.848] Info: UniverseClient: Client disconnecting...
    [11:40:49.885] Info: Client received world stop packet, leaving: Removed
    [11:40:49.966] Info: UniverseServer: Client 'Clem Dodger' <1> (local) disconnected
    [11:40:50.066] Info: UniverseServer: Stopping UniverseServer
    [11:40:50.189] Info: Renderer initialized
    [11:40:51.930] Info: Renderer destroyed
    [11:40:51.930] Info: Application quitting!
    [11:40:51.930] Info: Client shutdown gracefully
    [11:40:52.366] Info: Shutting down Star::Root
    

    Removing button entirely has more or less the same effect, no error, no crash, no log spitting out errors, and no change to my item:
    Code:
    {
      "gui" : {
        "background" : {
         "type" : "background",
         "fileHeader" : "/objects/Crystal Upgrade/Crystal_header.png",
         "fileBody" : "/objects/Crystal Upgrade/Crystal_body.png",
         "fileFooter" : "/objects/Crystal Upgrade/Crystal_footer.png"
        },
        "itemGrid" : {
          "type" : "itemgrid",
         "position" : [74, 37],
         "dimensions" : [1,1],
         "spacing" : [10, 10],
         "backingImage" : "/interface/inventory/empty.png"
        },
        "outputItemGrid" : {
          "type" : "itemgrid",
         "slotOffset" : 1,
          "position" : [110,37],
          "dimensions" : [1,1],
          "spacing" : [19,19],
          "backingImage" : "/interface/inventory/empty.png"
        },
        "pointer" : {
         "type" : "image",
         "position" : [96,40],
         "file" : "/interface/objectcrafting/arrow.png"
        },
        "overlay" : {
          "type" : "image",
          "file" : "/interface/objectcrafting/campfire_shine.png",
          "position" : [-20, 20]
        }
      }
    }
    

    No button in .config log:
    Code:
    Start logging at: 2016-05-16 11:42:38.714
    [11:42:38.716] Info: Star::Root using bootstrap file 'C:\Valve\Steam\steamapps\common\Starbound\win64\sbboot.config'
    [11:42:38.716] Info: Star::Root using storage directory 'C:\Valve\Steam\steamapps\common\Starbound\giraffe_storage\'
    [11:42:38.716] Info: Preparing Star::Root...
    [11:42:38.716] Info: Detected mod 'Crystal Weapons' at '../giraffe_storage/mods\Crystal Weapons\.'
    [11:42:38.716] Info: Loading Configuration with config file: 'starbound.config'
    [11:42:38.716] Info: Loading Star::Configuration from 'Just (.\..\giraffe_storage\starbound.config)'
    [11:42:38.717] Info: Writing Star::Configuration to '.\..\giraffe_storage\starbound.config'
    [11:42:38.722] Info: Initializing Star::Root with 3 assets sources
    [11:42:38.722] Info: Done preparing Star::Root.
    [11:42:38.722] Info: Client Version 'Beta v. Glad Giraffe - Update 3' Revision: 30555b17a491c2a97ab0afbff3b848a1fd937dbd Protocol: 711
    [11:42:38.722] Info: Initialized SDL
    [11:42:39.274] Info: Initialized SDL Video
    [11:42:39.285] Info: Initialized SDL Joystick
    [11:42:39.288] Info: Initialized SDL Sound
    [11:42:39.314] Info: Opened default audio device with 44khz / 16 bit stereo audio, 2048 sample size buffer
    [11:42:39.314] Info: Loading Assets
    [11:42:39.314] Info: Loading assets from: '../assets/packed.pak'
    [11:42:39.314] Info: Loading assets from: '../assets/user'
    [11:42:39.314] Info: Loading assets from: '../giraffe_storage/mods\Crystal Weapons\.'
    [11:42:39.566] Info: Done loading Assets in 0.252 seconds
    [11:42:39.569] Info: Loading NameGenerator
    [11:42:39.570] Info: Initializing SDL Window
    [11:42:39.573] Info: Done loading NameGenerator in 0.00399995 seconds
    [11:42:39.574] Info: Loading ObjectDatabase
    [11:42:40.042] Info: Done loading ObjectDatabase in 0.468 seconds
    [11:42:40.042] Info: Loading PlantDatabase
    [11:42:40.136] Info: Done loading PlantDatabase in 0.0939999 seconds
    [11:42:40.136] Info: Loading ProjectileDatabase
    [11:42:40.214] Info: OpenGL version: '4.5.0 NVIDIA 365.10' vendor: 'NVIDIA Corporation' renderer: 'GeForce GTX 680/PCIe/SSE2' shader: '4.50 NVIDIA'
    [11:42:40.214] Info: Created initial window 1920x1080
    [11:42:40.223] Info: Renderer initialized
    [11:42:40.225] Info: Renderer destroyed
    [11:42:40.225] Info: Initializing SDL Window
    [11:42:40.472] Info: OpenGL version: '4.5.0 NVIDIA 365.10' vendor: 'NVIDIA Corporation' renderer: 'GeForce GTX 680/PCIe/SSE2' shader: '4.50 NVIDIA'
    [11:42:40.472] Info: Re-created window 1920x1080
    [11:42:40.473] Info: Renderer initialized
    [11:42:40.474] Info: Loading ImageMetadataDatabase
    [11:42:40.474] Info: Done loading ImageMetadataDatabase in 0 seconds
    [11:42:40.718] Info: Done loading ProjectileDatabase in 0.582 seconds
    [11:42:40.718] Info: Loading MonsterDatabase
    [11:42:40.930] Info: Done loading MonsterDatabase in 0.212 seconds
    [11:42:40.931] Info: Loading NpcDatabase
    [11:42:40.973] Info: Done loading NpcDatabase in 0.0420001 seconds
    [11:42:40.973] Info: Loading StagehandDatabase
    [11:42:40.973] Info: Done loading StagehandDatabase in 0 seconds
    [11:42:40.973] Info: Loading VehicleDatabase
    [11:42:40.975] Info: Done loading VehicleDatabase in 0.00200009 seconds
    [11:42:40.975] Info: Loading PlayerFactory
    [11:42:40.978] Info: Done loading PlayerFactory in 0.00299978 seconds
    [11:42:40.978] Info: Loading EntityFactory
    [11:42:40.978] Info: Loading VersioningDatabase
    [11:42:40.979] Info: Done loading VersioningDatabase in 0.00100017 seconds
    [11:42:40.979] Info: Done loading EntityFactory in 0.00100017 seconds
    [11:42:40.979] Info: Loading ItemDatabase
    [11:42:44.408] Info: Loading FunctionDatabase
    [11:42:44.423] Info: Done loading FunctionDatabase in 0.0150001 seconds
    [11:42:44.425] Info: Loading ParticleDatabase
    [11:42:44.501] Info: Done loading ParticleDatabase in 0.076 seconds
    [11:42:46.876] Info: Done loading ItemDatabase in 5.897 seconds
    [11:42:46.876] Info: Loading MaterialDatabase
    [11:42:46.978] Info: Done loading MaterialDatabase in 0.102 seconds
    [11:42:46.978] Info: Loading TerrainDatabase
    [11:42:47.009] Info: Done loading TerrainDatabase in 0.0310001 seconds
    [11:42:47.010] Info: Loading BiomeDatabase
    [11:42:47.053] Info: Done loading BiomeDatabase in 0.043 seconds
    [11:42:47.053] Info: Loading LiquidsDatabase
    [11:42:47.054] Info: Done loading LiquidsDatabase in 0.00100017 seconds
    [11:42:47.054] Info: Loading StatusEffectDatabase
    [11:42:47.070] Info: Done loading StatusEffectDatabase in 0.0159998 seconds
    [11:42:47.070] Info: Loading DamageDatabase
    [11:42:47.195] Info: Done loading DamageDatabase in 0.125 seconds
    [11:42:47.195] Info: Loading EffectSourceDatabase
    [11:42:47.207] Info: Done loading EffectSourceDatabase in 0.0120001 seconds
    [11:42:47.207] Info: Loading TreasureDatabase
    [11:42:47.237] Info: Done loading TreasureDatabase in 0.03 seconds
    [11:42:47.237] Info: Loading DungeonDefinitions
    [11:42:47.509] Info: Done loading DungeonDefinitions in 0.272 seconds
    [11:42:47.509] Info: Loading TilesetDatabase
    [11:42:47.509] Info: Done loading TilesetDatabase in 0 seconds
    [11:42:47.509] Info: Loading EmoteProcessor
    [11:42:47.509] Info: Done loading EmoteProcessor in 0 seconds
    [11:42:47.509] Info: Loading SpeciesDatabase
    [11:42:47.516] Info: Done loading SpeciesDatabase in 0.00699997 seconds
    [11:42:47.516] Info: Loading QuestTemplateDatabase
    [11:42:47.535] Info: Done loading QuestTemplateDatabase in 0.0190001 seconds
    [11:42:47.535] Info: Loading AiDatabase
    [11:42:47.544] Info: Done loading AiDatabase in 0.00900006 seconds
    [11:42:47.544] Info: Loading TechDatabase
    [11:42:47.551] Info: Done loading TechDatabase in 0.00699997 seconds
    [11:42:47.551] Info: Loading CodexDatabase
    [11:42:47.651] Info: Done loading CodexDatabase in 0.0999999 seconds
    [11:42:47.651] Info: Loading BehaviorDatabase
    [11:42:47.708] Info: Done loading BehaviorDatabase in 0.0569999 seconds
    [11:42:47.708] Info: Loading DanceDatabase
    [11:42:47.710] Info: Done loading DanceDatabase in 0.00200009 seconds
    [11:42:47.710] Info: Loading SpawnTypeDatabase
    [11:42:47.715] Info: Done loading SpawnTypeDatabase in 0.00499988 seconds
    [11:42:47.716] Info: Done fully loading Star::Root
    [11:42:47.726] Info: Renderer destroyed
    [11:42:49.077] Info: Renderer initialized
    [11:42:51.510] Info: Renderer destroyed
    [11:42:51.533] Info: UniverseServer: Acquiring universe lock file
    [11:42:51.538] Info: UniverseServer: Loading settings
    [11:42:51.539] Info: UniverseServer: No default world set; using randomized starter worlds
    [11:42:51.540] Info: UniverseServer: Starting UniverseServer with UUID: 9687e17e3a816f595a1b7f01b4ecc751
    [11:42:51.543] Info: UniverseServer: Logged in player 'Clem Dodger' locally
    [11:42:51.543] Info: UniverseServer: Logged in account '<anonymous>' as player 'Clem Dodger' from address local
    [11:42:51.548] Info: UniverseServer: Reviving player at ClientShipWorld:55f446c041a7c2fafe35754a4c560658
    [11:42:51.548] Info: UniverseServer: Client 'Clem Dodger' <1> (local) connected
    [11:42:51.549] Info: UniverseClient: Joined server as client 1
    [11:42:51.646] Info: UniverseServer: Loading client ship world ClientShipWorld:55f446c041a7c2fafe35754a4c560658
    [11:42:51.797] Info: Renderer initialized
    [11:42:52.162] Info: UniverseServer: Loading celestial world -472048208:502444686:11847332:5:1
    [11:43:02.536] Info: UniverseServer: Stopping world CelestialWorld:-472048208:502444686:11847332:5:1 due to inactivity
    [11:43:02.636] Info: UniverseServer: World thread has stopped due to inactivity, removing world CelestialWorld:-472048208:502444686:11847332:5:1
    [11:43:09.829] Info: Renderer destroyed
    [11:43:09.831] Info: UniverseClient: Client disconnecting...
    [11:43:09.900] Info: Client received world stop packet, leaving: Removed
    [11:43:09.975] Info: UniverseServer: Client 'Clem Dodger' <1> (local) disconnected
    [11:43:10.075] Info: UniverseServer: Stopping UniverseServer
    [11:43:10.197] Info: Renderer initialized
    [11:43:11.398] Info: Renderer destroyed
    [11:43:11.398] Info: Application quitting!
    [11:43:11.398] Info: Client shutdown gracefully
    [11:43:11.849] Info: Shutting down Star::Root
    


    Will be trying out a few other variations now before I go afk some more. Thanks for the help so far. :)
     
  10. C0bra5

    C0bra5 Oxygen Tank

    Shameless plug here but if you are looking for some examples of the LUA API and a bit of documentation I run a website called sblaud.net where I document and give explanations on some parts of the API, it is in dire need of an update though
     
  11. v6ooo

    v6ooo Space Kumquat

    I wanted to revisit this with new information. Thanks to the new item "cropshipper" I finally figured out how to add items to a container gui... I always assumed scripts defined in the object was linked to the gui as well but that's not the case.

    Essentially what you need to know is the object & the gui are separate. If you just need a callback function for the gui without the object doing anything then you do not need message handlers. If you do then you need to add a message handler and let the gui tell the object to do something.


    Here's how the cropshipper communicates between the gui and object. I've cut away most just leaving what you need to know.


    cropshipper.object
    Code:
    .....
      "uiConfig" : "/interface/scripted/cropshipper/cropshippergui.config",
    .....
      "scripts" : [ "/objects/generic/cropshipper/cropshipper.lua" ],
    .....
    

    cropshipper.lua (object lua)
    Code:
    function init()
    .....
      message.setHandler("triggerShipment", startLaunch)
    .....
    end
    

    cropshippergui.config
    Code:
    .....
        "btnShip" : {
          "type" : "button",
          "base" : "/interface/button.png",
          "hover" : "/interface/buttonhover.png",
          "press" : "/interface/buttonhover.png",
          "caption" : "Ship",
          "position" : [96, 26],
          "callback" : "triggerShipment"
        },
    .....
      "scriptWidgetCallbacks" : [
        "triggerShipment"
      ],
    
      "scripts" : ["/interface/scripted/cropshipper/cropshippergui.lua"],
    .....
    

    cropshippergui.lua (gui lua)
    Code:
    function triggerShipment(widgetName, widgetData)
      world.sendEntityMessage(pane.containerEntityId(), "triggerShipment")
    .....
    end
    
     
    Last edited: Jun 1, 2016
  12. Wellbott

    Wellbott Existential Complex

    This line is a problem:
    Code:
    if catalyst and catalyst.name == "crystal" and weapon and weapon.tooltipKind == "sword" then
      weapon.level = weapon.level+1
    end
    
    It needs to be
    Code:
    if catalyst and catalyst.name == "crystal" and weapon and weapon.parameters.tooltipKind and weapon.parameters.tooltipKind == "sword" then
      weapon.parameters.level = weapon.parameters.level+1
    end
    
     
  13. Nujuju299

    Nujuju299 Big Damn Hero

    Doesn't work, sorry. :/ I'm starting to think it's a feature that Starbound doesn't support yet. The log file gives me an error "Attempt to call a nil value (global 'setProperty')" I'm starting to think this is because the variable in the config is set to be global for all X items, rather than individual, so any individual item can't be upgraded because there's "no individual level." :( Whenever I Get back into this I'll have to take a look at some other luas for the randomly generated weapons to see if there's something there; I'm certain they must have individual levels or something considering the random sword blade and handle together stuff.... But who knows.
     
  14. v6ooo

    v6ooo Space Kumquat

    Increasing levels should work but you may have to set if it doesn't exist in parameters already.

    "Attempt to call a nil value (global 'setProperty')"
    You're trying to call a function/variable called setProperty that does not exist.
    If you're trying to save global variables it's world.setProperty (what are you trying to save?)

    Edit: If you're working with item descriptors then the base will contain name, count & parameters BUT parameters will be empty unless the game (or you) have generated specific values for the item.
    The values in parameter overrides the values in the config.

    If you need to read the default value from the config then you can use root.itemConfig("itemname")
     
    Last edited: Jun 5, 2016
  15. Nujuju299

    Nujuju299 Big Damn Hero

    I didn't even pick that up because I was busy with something else. lol, that was from Wellbott's script for weapon.parameters.level+1
    I can pretty much guarantee you I wasn't trying to play with a setProperty+1. So, I figure the reason it's giving that error is because lua is trying to modify the config rather than the item's individual variable.
     
  16. Wellbott

    Wellbott Existential Complex

    I assume that error must come from some other part of the lua; I don't see anything in the snippet you posted that would do it. But all the contents of 'parameters' in an item descriptor are attached to that one instance and supplement or override the item's base config values. Not all can be overridden... I've never been able to make the game use a modified 'description' or 'shortDescription', among others... but 'level' is almost certainly doable. Just make the script delete the weapon in the container and replace it using the data you pulled and modified.
     
  17. v6ooo

    v6ooo Space Kumquat

    @Wellbott, naming items is as simple as parameters.shortdescription = newname. Same for description.

    The tricky part are objects, they re-initialize when broken so you need to add a script for die, object.smash it and spawn it with the name in parameters.
     
  18. Nujuju299

    Nujuju299 Big Damn Hero

    Sorry I've made a mistake. My setProprty was because I had the script as
    Code:
    setProperty(weapon.parameters.level, weapon.parameters.level+1)
    So I fixed that to go with Wellbott's suggestion, properly this time, and the script seems to have run fine. For the most part, anyways.
    Three placeholder checks I have for what stages the scripts run are for crystal, weapon, and both being just fine; all three have returned positive in the log.
    However the log also shows that after the catalyst was consumed, only one, that there's an error with the catalyst. Not huge or important, it would be nice to get rid of that error too, but I looked at my weapon to see that it still did 8 damage. So... 8 damage to 8 damage. :/
    I haven't checked for if it's a new weapon I craft because it could have been the config instead, or something I don't know, because I'm busy with other projects that aren't specifically Starbound. I feel more or less like I'm asking you to do this for me, but regardless any help would indeed be nice, and sorry. :/

    But, with that said, my current script gathering dust is:
    Code:
    function update(dt)
      local catalyst = world.containerItemAt(entity.id(),0)
      local weapon = world.containerItemAt(entity.id(),1)
      if catalyst and catalyst.name == "crystal" and weapon and root.itemHasTag(weapon.name, "weapon") then
        world.logInfo("Passed!")
        weapon.level=weapon.parameters.level+1
        consumecatalyst()
      end
      if catalyst.name == "crystal" then
        world.logInfo("Crystal ok!")
      end
      if root.itemHasTag(weapon.name, "weapon") then
        world.logInfo("Weapon ok")
      end
    end
    
    function consumecatalyst()
      local consumed = world.containerConsumeAt(entity.id(), 0,1)
      return consumed
    end
    
    Oh and just incase someone is interested or wants it, this is the moment of the log file since I don't feel like posting the rest of the startup or making a big long giant list that's unneeded:
    Code:
    [10:30:12.469] Info: UniverseServer: Loading celestial world -472048208:502444686:11847332:5:1
    [10:30:12.492] Error: Exception while invoking lua function 'update'. (LuaException) Error code 2, [string "/objects/Crystal Upgrade/crystalupgrade.lua"]:9: attempt to index a nil value (local 'catalyst')
     
  19. v6ooo

    v6ooo Space Kumquat

    The reason for your catalyst error on line 9 is when the slot is empty and it returns nil. Catalyst is nil and not a table and you're trying to access catalyst.name which is not there.

    As for your weapon level not increasing. You're increasing weapon.level and not weapon.parameters.level.
    Code:
    weapon.parameters.level = (weapon.parameters.level or 1) +1
     
    Peelz likes this.
  20. Nujuju299

    Nujuju299 Big Damn Hero

    It's trivial because it only makes an error in the world log thing, but I was hoping to find a way to prevent an error like that from popping up. Something like "if item exists(catalyst)" kind of thing.
    I must have made another mistake which is probably why it didn't actually spit out an error this time... I'm pretty sure the weapon.parameters.level=X returns an error that I'm trying to set a variable I'm not allowed to set or something.

    ....

    ....

    Ok I'm surprised again, I fixed the missing .parameters. space and it didn't spit out the error I was expecting, it worked, but the weapon in question's damage remains the same. Who knows, maybe the weapon's level did increase but because the weapon already has it's damage it just isn't updating the damage?

    The entire object shuts down when it gets an error which means I'll need to find that fix anyways. Sorry for asking people to do this for me, not my intent, I'm just putting this last line here as a note to anyone who reads it, more or less.
     

Share This Page