Modding Help Need help with new sapling object

Discussion in 'Starbound Modding' started by Nemasys, May 27, 2017.

  1. Nemasys

    Nemasys Cosmic Narwhal

    I am attempting to make a new type of sapling that can be planted on any surface, but can only be placed under water. I'd rather not just patch the existing sapling file in order to keep all normal saplings functioning like they normally do. I have copied the sapling.object file and renamed/altered it accordingly, but when I use my new sapling object as a drop all I get is a PGI...

    Alternately, I am able to spawn in a working sapling by using the following admin command example:
    Code:
    /spawnitem newsapling 1 '{"stemName":"newstem","stemHueShift":0,"foliageName":"newfoliage","foliageHueShift":-50}'
    But for some reason, trying to get it to drop when the tree is cut down is not working.

    I have also tried making a "testsapling" object that is otherwise identical to the normal saplings, but I get the same result - a PGI. Am I possibly missing something with how the saplings are handled? Granted, these things are pretty weird. Maybe some form of the spawn command can possibly be used in the object file for the drop? I honestly don't know why this thing isn't dropping correctly.
    Any insight would be greatly appreciated.
     
    Last edited: May 31, 2017
  2. bk3k

    bk3k Oxygen Tank

    Your log probably tells you the problem. Especially when you're dropping PGIs.

    Look there and if you can't make sense of it, post it here(within spoiler and code tags).
     
  3. Nemasys

    Nemasys Cosmic Narwhal

    Yeah, I do get an error, but I was confused as to why a manual admin command can spawn one just fine, but it won't drop from the actual tree...

    Here's the error I get:
    Code:
    [Error] Could not instantiate item '[newsapling, 1, {}]'. (LuaException) Error code 2, [string "/items/buildscripts/buildsapling.lua"]:7: (LuaConversionException) Error converting LuaValue to type 'class Star::String'
    [0] 7ff656784403 Star::captureStack
    Unfortunately, I don't know enough about Lua to be able to decipher that.
     
  4. bk3k

    bk3k Oxygen Tank

    There may very well be more in the log that that. I mean to say post the whole log.

    But that error tells you it couldn't convert a LuaValue to a C++ string. Which means it didn't get a LUA string. What's a LUA value?
    boolean (true or false)
    string
    number (float or integer are treated mostly the same)
    table
    function
    userdata
    thread
    nil

    And between those, I'd bet on nil.

    Do you have "stemName" defined in your object?
     
  5. Nemasys

    Nemasys Cosmic Narwhal

    Here's the entire log:
    Code:
    [19:49:59.166] [Info] Root: Preparing Root...
    [19:49:59.166] [Info] Root: Done preparing Root.
    [19:49:59.166] [Info] Client Version 1.2.3b (windows x86_64) Source ID: 69bc1c906122a1c61453c6cff15aa088b613db78 Protocol: 729
    [19:49:59.166] [Info] Root: Scanning for asset sources in directory '..\assets\'
    [19:49:59.440] [Info] Root: Scanning for asset sources in directory '..\mods\'
    [19:49:59.491] [Warn] Root: Overriding duplicate asset source '..\assets\Orcana.pak' named 'Orcana' with higher or equal priority source '..\mods\Orcana
    [19:50:00.005] [Warn] Root: Unrecognized file in asset directory 'mods_go_here', skipping
    [19:50:00.005] [Info] Root: Detected asset source named 'base' at '..\assets\packed.pak'
    [19:50:00.005] [Info] Root: Detected asset source named 'Orcana' at '..\mods\Orcana'
    [19:50:00.005] [Info] Root: Detected asset source named 'argonian' at '..\mods\argonian'
    [19:50:00.005] [Info] Root: Detected asset source named 'Felins' at '..\mods\felins'
    [19:50:00.005] [Info] Root: Detected asset source named 'felinsobjectplus' at '..\mods\felin_objplus'
    [19:50:00.005] [Info] Root: Detected asset source named 'Geode Race' at '..\mods\geode.pak'
    [19:50:00.005] [Info] Root: Detected asset source named 'Elithian_Races_Mod' at '..\mods\avikan'
    [19:50:00.005] [Info] Root: Detected unnamed asset source at '..\assets\user'
    [19:50:00.005] [Info] Loading assets from: '..\assets\packed.pak'
    [19:50:00.335] [Info] Loading assets from: '..\mods\Orcana'
    [19:50:00.418] [Info] Loading assets from: '..\mods\argonian'
    [19:50:00.517] [Info] Loading assets from: '..\mods\felins'
    [19:50:00.566] [Info] Loading assets from: '..\mods\felin_objplus'
    [19:50:00.847] [Info] Loading assets from: '..\mods\geode.pak'
    [19:50:00.852] [Info] Loading assets from: '..\mods\avikan'
    [19:50:01.231] [Info] Loading assets from: '..\assets\user'
    [19:50:04.025] [Info] Assets digest is c63b574880296c6118822381953df626924a3b4046432443b5ab206dd7ae64f0
    [19:50:04.025] [Info] Root: Loaded Assets in 4.85866 seconds
    [19:50:04.028] [Info] Application: Initializing SDL Video
    [19:50:04.037] [Info] Application: Initializing SDL Joystick
    [19:50:04.076] [Info] Application: Initializing SDL Sound
    [19:50:04.185] [Info] Initialized Steam services
    [19:50:04.185] [Info] Application: Creating SDL Window
    [19:50:04.661] [Info] Application: Enabling VSync with late swap tearing
    [19:50:04.701] [Info] Application: Opened default audio device with 44.1khz / 16 bit stereo audio, 2048 sample size buffer
    [19:50:04.706] [Info] OpenGL version: '4.5.0 NVIDIA 378.92' vendor: 'NVIDIA Corporation' renderer: 'GeForce GTX 680/PCIe/SSE2' shader: '4.50 NVIDIA'
    [19:50:04.738] [Info] Application: initialization...
    [19:50:04.739] [Info] Root: Loaded Configuration in 0.000933968 seconds
    [19:50:04.742] [Info] Application: renderer initialization...
    [19:50:04.743] [Info] detected supported OpenGL texture size 16384, using atlasNumCells 128
    [19:50:04.743] [Info] detected supported OpenGL texture size 16384, using atlasNumCells 64
    [19:50:04.744] [Info] Root: Loaded ImageMetadataDatabase in 4.51773e-06 seconds
    [19:50:04.760] [Info] Application: main update loop...
    [19:50:04.762] [Info] Loading mods from user generated content with id '731067634' from directory 'C:\Program Files (x86)\Steam\steamapps\workshop\content\211820\731067634'
    [19:50:04.762] [Info] Loading mods from user generated content with id '729675474' from directory 'C:\Program Files (x86)\Steam\steamapps\workshop\content\211820\729675474'
    [19:50:04.762] [Info] Loading mods from user generated content with id '729558042' from directory 'C:\Program Files (x86)\Steam\steamapps\workshop\content\211820\729558042'
    [19:50:04.762] [Info] Loading mods from user generated content with id '729467376' from directory 'C:\Program Files (x86)\Steam\steamapps\workshop\content\211820\729467376'
    [19:50:04.762] [Info] Loading mods from user generated content with id '729426722' from directory 'C:\Program Files (x86)\Steam\steamapps\workshop\content\211820\729426722'
    [19:50:04.762] [Info] Loading mods from user generated content with id '729428280' from directory 'C:\Program Files (x86)\Steam\steamapps\workshop\content\211820\729428280'
    [19:50:04.762] [Info] Loading mods from user generated content with id '740750449' from directory 'C:\Program Files (x86)\Steam\steamapps\workshop\content\211820\740750449'
    [19:50:04.762] [Info] Loading mods from user generated content with id '850109963' from directory 'C:\Program Files (x86)\Steam\steamapps\workshop\content\211820\850109963'
    [19:50:04.762] [Info] Reloading to include all user generated content
    [19:50:04.762] [Info] Root: Reloading from disk
    [19:50:04.762] [Info] Root: Writing runtime configuration to '..\storage\starbound.config'
    [19:50:04.805] [Info] Root: Loaded Configuration in 0.000917403 seconds
    [19:50:04.805] [Info] Root: Scanning for asset sources in directory '..\assets\'
    [19:50:05.069] [Info] Root: Scanning for asset sources in directory '..\mods\'
    [19:50:05.116] [Warn] Root: Overriding duplicate asset source '..\assets\Orcana.pak' named 'Orcana' with higher or equal priority source '..\mods\Orcana
    [19:50:05.579] [Warn] Root: Unrecognized file in asset directory 'mods_go_here', skipping
    [19:50:05.579] [Info] Root: Scanning for asset sources in directory 'C:\Program Files (x86)\Steam\steamapps\workshop\content\211820\731067634'
    [19:50:05.580] [Info] Root: Scanning for asset sources in directory 'C:\Program Files (x86)\Steam\steamapps\workshop\content\211820\729675474'
    [19:50:05.580] [Info] Root: Scanning for asset sources in directory 'C:\Program Files (x86)\Steam\steamapps\workshop\content\211820\729558042'
    [19:50:05.595] [Info] Root: Scanning for asset sources in directory 'C:\Program Files (x86)\Steam\steamapps\workshop\content\211820\729467376'
    [19:50:05.598] [Info] Root: Scanning for asset sources in directory 'C:\Program Files (x86)\Steam\steamapps\workshop\content\211820\729426722'
    [19:50:05.598] [Info] Root: Scanning for asset sources in directory 'C:\Program Files (x86)\Steam\steamapps\workshop\content\211820\729428280'
    [19:50:05.600] [Info] Root: Scanning for asset sources in directory 'C:\Program Files (x86)\Steam\steamapps\workshop\content\211820\740750449'
    [19:50:05.600] [Info] Root: Scanning for asset sources in directory 'C:\Program Files (x86)\Steam\steamapps\workshop\content\211820\850109963'
    [19:50:05.642] [Warn] Root: Overriding duplicate asset source '..\mods\avikan' named 'Elithian_Races_Mod' with higher or equal priority source 'C:\Program Files (x86)\Steam\steamapps\workshop\content\211820\850109963\contents.pak
    [19:50:05.643] [Info] Root: Detected asset source named 'base' at '..\assets\packed.pak'
    [19:50:05.643] [Info] Root: Detected asset source named 'xbawks' at 'C:\Program Files (x86)\Steam\steamapps\workshop\content\211820\729426722\contents.pak'
    [19:50:05.643] [Info] Root: Detected asset source named 'Orcana' at '..\mods\Orcana'
    [19:50:05.643] [Info] Root: Detected asset source named 'argonian' at '..\mods\argonian'
    [19:50:05.643] [Info] Root: Detected asset source named 'Felins' at '..\mods\felins'
    [19:50:05.643] [Info] Root: Detected asset source named 'felinsobjectplus' at '..\mods\felin_objplus'
    [19:50:05.643] [Info] Root: Detected asset source named 'Geode Race' at '..\mods\geode.pak'
    [19:50:05.643] [Info] Root: Detected asset source named 'Drumsticks & Tail Feathers (No hands)' at 'C:\Program Files (x86)\Steam\steamapps\workshop\content\211820\731067634\contents.pak'
    [19:50:05.643] [Info] Root: Detected asset source named 'Avali' at 'C:\Program Files (x86)\Steam\steamapps\workshop\content\211820\729558042\contents.pak'
    [19:50:05.643] [Info] Root: Detected asset source named 'Avali Alternate Ship' at 'C:\Program Files (x86)\Steam\steamapps\workshop\content\211820\729675474\contents.pak'
    [19:50:05.643] [Info] Root: Detected asset source named 'Tanz Lighting Overhaul' at 'C:\Program Files (x86)\Steam\steamapps\workshop\content\211820\729467376\contents.pak'
    [19:50:05.643] [Info] Root: Detected asset source named 'Crew race/gender display' at 'C:\Program Files (x86)\Steam\steamapps\workshop\content\211820\740750449\contents.pak'
    [19:50:05.643] [Info] Root: Detected asset source named 'Elithian_Races_Mod' at 'C:\Program Files (x86)\Steam\steamapps\workshop\content\211820\850109963\contents.pak'
    [19:50:05.643] [Info] Root: Detected asset source named 'GardenBot2' at 'C:\Program Files (x86)\Steam\steamapps\workshop\content\211820\729428280\contents.pak'
    [19:50:05.643] [Info] Root: Detected unnamed asset source at '..\assets\user'
    [19:50:05.643] [Info] Loading assets from: '..\assets\packed.pak'
    [19:50:05.977] [Info] Loading assets from: 'C:\Program Files (x86)\Steam\steamapps\workshop\content\211820\729426722\contents.pak'
    [19:50:05.978] [Info] Loading assets from: '..\mods\Orcana'
    [19:50:06.061] [Info] Loading assets from: '..\mods\argonian'
    [19:50:06.162] [Info] Loading assets from: '..\mods\felins'
    [19:50:06.212] [Info] Loading assets from: '..\mods\felin_objplus'
    [19:50:06.497] [Info] Loading assets from: '..\mods\geode.pak'
    [19:50:06.499] [Info] Loading assets from: 'C:\Program Files (x86)\Steam\steamapps\workshop\content\211820\731067634\contents.pak'
    [19:50:06.499] [Info] Loading assets from: 'C:\Program Files (x86)\Steam\steamapps\workshop\content\211820\729558042\contents.pak'
    [19:50:06.518] [Info] Loading assets from: 'C:\Program Files (x86)\Steam\steamapps\workshop\content\211820\729675474\contents.pak'
    [19:50:06.518] [Info] Loading assets from: 'C:\Program Files (x86)\Steam\steamapps\workshop\content\211820\729467376\contents.pak'
    [19:50:06.524] [Info] Loading assets from: 'C:\Program Files (x86)\Steam\steamapps\workshop\content\211820\740750449\contents.pak'
    [19:50:06.524] [Info] Loading assets from: 'C:\Program Files (x86)\Steam\steamapps\workshop\content\211820\850109963\contents.pak'
    [19:50:06.579] [Info] Loading assets from: 'C:\Program Files (x86)\Steam\steamapps\workshop\content\211820\729428280\contents.pak'
    [19:50:06.580] [Info] Loading assets from: '..\assets\user'
    [19:50:08.455] [Info] Assets digest is ef55ae2c1f9f69d9831cb334a8601074c6cacf4aa74868715c88aced3e909889
    [19:50:08.455] [Info] Root: Loaded Assets in 3.64957 seconds
    [19:50:08.473] [Info] Root: Loaded NameGenerator in 0.0181475 seconds
    [19:50:08.482] [Info] Root: Loaded ImageMetadataDatabase in 4.81892e-06 seconds
    [19:50:08.492] [Error] OpenGL errors this frame:  GL_INVALID_VALUE
    [19:50:08.586] [Info] Root: Loaded PlantDatabase in 0.111844 seconds
    [19:50:08.986] [Info] Root: Loaded ObjectDatabase in 0.531262 seconds
    [19:50:09.104] [Info] Root: Loaded MonsterDatabase in 0.117422 seconds
    [19:50:09.148] [Info] Root: Loaded NpcDatabase in 0.0439564 seconds
    [19:50:09.150] [Info] Root: Loaded StagehandDatabase in 0.00133303 seconds
    [19:50:09.154] [Info] Root: Loaded VehicleDatabase in 0.0038455 seconds
    [19:50:09.159] [Info] Root: Loaded PlayerFactory in 0.00542099 seconds
    [19:50:09.189] [Info] Root: Loaded ProjectileDatabase in 0.603148 seconds
    [19:50:09.191] [Info] Root: Loaded VersioningDatabase in 0.00180047 seconds
    [19:50:09.191] [Info] Root: Loaded EntityFactory in 0.0315911 seconds
    [19:50:09.228] [Info] Root: Loaded ParticleDatabase in 0.0372593 seconds
    [19:50:09.459] [Info] Root: Loaded MaterialDatabase in 0.268637 seconds
    [19:50:09.462] [Info] Root: Loaded TerrainDatabase in 0.00332446 seconds
    [19:50:09.489] [Info] Root: Loaded BiomeDatabase in 0.0266017 seconds
    [19:50:09.490] [Info] Root: Loaded LiquidsDatabase in 0.000599655 seconds
    [19:50:09.495] [Info] Root: Loaded StatusEffectDatabase in 0.00525745 seconds
    [19:50:09.699] [Info] Root: Loaded DamageDatabase in 0.204181 seconds
    [19:50:09.703] [Info] Root: Loaded EffectSourceDatabase in 0.00387954 seconds
    [19:50:09.706] [Info] Root: Loaded FunctionDatabase in 0.00267842 seconds
    [19:50:09.729] [Info] Root: Loaded TreasureDatabase in 0.0229935 seconds
    [19:50:09.954] [Info] Root: Loaded DungeonDefinitions in 0.224776 seconds
    [19:50:09.954] [Info] Root: Loaded TilesetDatabase in 3.52384e-05 seconds
    [19:50:09.955] [Info] Root: Loaded StatisticsDatabase in 0.00142369 seconds
    [19:50:09.955] [Info] Root: Loaded EmoteProcessor in 5.12011e-05 seconds
    [19:50:09.965] [Info] Root: Loaded SpeciesDatabase in 0.00985952 seconds
    [19:50:09.976] [Info] Root: Loaded QuestTemplateDatabase in 0.0106552 seconds
    [19:50:09.979] [Info] Root: Loaded AiDatabase in 0.00294225 seconds
    [19:50:09.980] [Info] Root: Loaded TechDatabase in 0.000611702 seconds
    [19:50:09.985] [Info] Root: Loaded CodexDatabase in 0.00546255 seconds
    [19:50:10.219] [Info] Root: Loaded BehaviorDatabase in 0.233418 seconds
    [19:50:10.221] [Info] Root: Loaded DanceDatabase in 0.00239199 seconds
    [19:50:10.225] [Info] Root: Loaded SpawnTypeDatabase in 0.00390002 seconds
    [19:50:10.228] [Info] Root: Loaded RadioMessageDatabase in 0.00241187 seconds
    [19:50:12.650] [Info] Root: Loaded ItemDatabase in 3.46129 seconds
    [19:50:12.789] [Info] Root: Loaded CollectionDatabase in 2.56149 seconds
    [19:50:13.541] [Info] detected supported OpenGL texture size 16384, using atlasNumCells 256
    [19:50:16.178] [Info] UniverseServer: Acquiring universe lock file
    [19:50:16.179] [Info] UniverseServer: Loading settings
    [19:50:16.181] [Info] UniverseServer: Starting UniverseServer with UUID: 6c10c1eec3ceebfbd087bce33cb04165
    [19:50:16.193] [Info] UniverseServer: Logged in player 'Poopelius' locally
    [19:50:16.193] [Info] UniverseServer: Logged in account '<anonymous>' as player 'Poopelius' from address local
    [19:50:16.204] [Info] UniverseServer: Reviving player at CelestialWorld:370250566:702718120:-70872850:9
    [19:50:16.204] [Info] UniverseServer: Client 'Poopelius' <1> (local) connected
    [19:50:16.209] [Info] UniverseClient: Joined server as client 1
    [19:50:16.300] [Info] UniverseServer: Loading celestial world 370250566:702718120:-70872850:9
    [19:50:16.300] [Info] UniverseServer: Loading client ship world ClientShipWorld:ccb8c25db39127afaae210aca0c40bb5
    [19:50:16.437] [Info] detected supported OpenGL texture size 16384, using atlasNumCells 64
    [19:50:16.437] [Info] detected supported OpenGL texture size 16384, using atlasNumCells 128
    [19:50:16.444] [Info] detected supported OpenGL texture size 16384, using atlasNumCells 256
    [19:50:16.444] [Info] detected supported OpenGL texture size 16384, using atlasNumCells 256
    [19:50:16.444] [Info] Setting steam rich presence connection as steam id 76561197976036147
    [19:50:16.448] [Error] Cannot set Steam achievement kill10poptops
    [19:50:16.448] [Error] Cannot set Steam achievement trashpet
    [19:50:16.448] [Error] Cannot set Steam achievement dismisscrewmember
    [19:50:16.508] [Info] UniverseServer: Warping player 1 to CelestialWorld:370250566:702718120:-70872850:9=2095.19.887
    [19:50:17.161] [Info] UniverseServer: Flying player 1 ship to starter world 370250546:702718061:63587395:2
    [19:50:17.161] [Info] UniverseServer: Loading celestial world 370250546:702718061:63587395:2
    [19:50:17.196] [Info] UniverseServer: Stopping idle world ClientShipWorld:ccb8c25db39127afaae210aca0c40bb5
    [19:50:17.964] [Info] UniverseServer: Loading client ship world ClientShipWorld:ccb8c25db39127afaae210aca0c40bb5
    [19:50:18.621] [Info] UniverseServer: Arriving ship for player 1 at 370250546:702718061:63587395:2
    [19:50:18.653] [Info] UniverseServer: Stopping idle world CelestialWorld:370250546:702718061:63587395:2
    [19:50:18.788] [Info] UniverseServer: Stopping idle world ClientShipWorld:ccb8c25db39127afaae210aca0c40bb5
    [19:50:37.930] [Error] Could not instantiate item '[newsapling, 1, {}]'. (LuaException) Error code 2, [string "/items/buildscripts/buildsapling.lua"]:7: (LuaConversionException) Error converting LuaValue to type 'class Star::String'
    [0] 7ff656784403 Star::captureStack
    [1] 7ff65678318e Star::StarException::StarException
    [2] 7ff65674f0cb Star::LuaConversionException::LuaConversionException
    [3] 7ff65674a8d6 Star::LuaConversionException::format<char const * __ptr64>
    [4] 7ff65684b605 Star::luaTo<Star::String>
    [5] 7ff656852684 Star::LuaDetail::ArgGet<Star::String>::get
    [6] 7ff656dad586 <lambda_850bff6e97bd544773af2639e13df43a>::operator()
    [7] 7ff656da26af std::_Invoker_functor::_Call<<lambda_850bff6e97bd544773af2639e13df43a> & __ptr64,Star::LuaEngine & __ptr64,unsigned __int64,Star::Variant<Star::Empty,bool,__int64,double,Star::String,Star::LuaTable,Star::LuaFunction,Star::LuaThread,Star::LuaUserData> * __ptr64>
    [8] 7ff656da5cc0 std::invoke<<lambda_850bff6e97bd544773af2639e13df43a> & __ptr64,Star::LuaEngine & __ptr64,unsigned __int64,Star::Variant<Star::Empty,bool,__int64,double,Star::String,Star::LuaTable,Star::LuaFunction,Star::LuaThread,Star::LuaUserData> * __ptr64>
    [9] 7ff656da4969 std::_Invoke_ret<Star::Variant<Star::Variant<Star::Empty,bool,__int64,double,Star::String,Star::LuaTable,Star::LuaFunction,Star::LuaThread,Star::LuaUserData>,Star::LuaVariadic<Star::Variant<Star::Empty,bool,__int64,double,Star::String,Star::LuaTable,Star::LuaFunction,Star::LuaThread,Star::LuaUserData> > >,<lambda_850bff6e97bd544773af2639e13df43a> & __ptr64,Star::LuaEngine & __ptr64,unsigned __int64,Star::Variant<Star::Empty,bool,__int64,double,Star::String,Star::LuaTable,Star::LuaFunction,Star::LuaThread,Star::LuaUserData> * __ptr64>
    [10] 7ff656daf84b std::_Func_impl<<lambda_850bff6e97bd544773af2639e13df43a>,std::allocator<int>,Star::Variant<Star::Variant<Star::Empty,bool,__int64,double,Star::String,Star::LuaTable,Star::LuaFunction,Star::LuaThread,Star::LuaUserData>,Star::LuaVariadic<Star::Variant<Star::Empty,bool,__int64,double,Star::String,Star::LuaTable,Star::LuaFunction,Star::LuaThread,Star::LuaUserData> > >,Star::LuaEngine & __ptr64,unsigned __int64,Star::Variant<Star::Empty,bool,__int64,double,Star::String,Star::LuaTable,Star::LuaFunction,Star::LuaThread,Star::LuaUserData> * __ptr64>::_Do_call
    [11] 7ff656751e8d std::_Func_class<Star::Variant<Star::Variant<Star::Empty,bool,__int64,double,Star::String,Star::LuaTable,Star::LuaFunction,Star::LuaThread,Star::LuaUserData>,Star::LuaVariadic<Star::Variant<Star::Empty,bool,__int64,double,Star::String,Star::LuaTable,Star::LuaFunction,Star::LuaThread,Star::LuaUserData> > >,Star::LuaEngine & __ptr64,unsigned __int64,Star::Variant<Star::Empty,bool,__int64,double,Star::String,Star::LuaTable,Star::LuaFunction,Star::LuaThread,Star::LuaUserData> * __ptr64>::operator()
    [12] 7ff656750f24 <lambda_a03bcae4599b53751a446949639a4d5e>::operator()
    [13] 7ff6566db6a8 luaD_precall
    [14] 7ff6566f4451 luaV_execute
    [15] 7ff6566db1b3 luaD_call
    [16] 7ff6566db98b luaD_rawrunprotected
    [17] 7ff6566db3c0 luaD_pcall
    [18] 7ff6566d18d4 lua_pcallk
    [19] 7ff656758ed0 Star::LuaEngine::pcallWithTraceback
    [20] 7ff6568ede58 Star::LuaEngine::callFunction<Star::String,Star::Json,Star::Json,Star::Maybe<float>,Star::Maybe<unsigned __int64> >
    [21] 7ff6568efa73 Star::LuaFunction::invoke<Star::LuaTupleReturn<Star::Json,Star::Json>,Star::String,Star::Json,Star::Json,Star::Maybe<float>,Star::Maybe<unsigned __int64> >
    [22] 7ff6568f01fe Star::LuaContext::invokePath<Star::LuaTupleReturn<Star::Json,Star::Json>,Star::String,Star::Json,Star::Json,Star::Maybe<float>,Star::Maybe<unsigned __int64> >
    [23] 7ff6568fcbc1 Star::ItemDatabase::itemConfig
    [24] 7ff6568fc646 Star::ItemDatabase::item
    [25] 7ff656903f9d Star::ItemDrop::createRandomizedDrop
    [26] 7ff656a3c3e6 Star::PlantDrop::update
    [27] 7ff656cbd32e <lambda_5251ea3b435705ab973fc9e3a86aa323>::operator()
    [28] 7ff6568bb5e7 Star::EntityMap::updateAllEntities
    [29] 7ff656cdddc2 Star::WorldServer::update
    [30] 7ff656ce5c42 Star::WorldServerThread::update
    [31] 7ff656ce56a8 Star::WorldServerThread::run
    [32] 7ff656780f2e Star::ThreadImpl::runThread
    [33] 7ff816ba2774 BaseThreadInitThunk
    [34] 7ff817030d61 RtlUserThreadStart
    stack traceback:
        [C]: in ?
        [C]: in field 'treeStemDirectory'
        [string "/items/buildscripts/buildsapling.lua"]:7: in function <[string "/items/buildscripts/buildsapling.lua"]:3>
    

    I just noticed that bit at the bottom. Anything helpful there?

    I did not define stemName. I copied the sapling.object file and altered it. There are no definitions for stemName or foliageName in there.
     
    Last edited: May 27, 2017
  6. Cyel

    Cyel Scruffy Nerf-Herder

    I didn't really played with trees but it seems the "sapling" item is just a "template" object that files in /plants/trees use as a "base" and store additional parameters when generating them? I can't seem to find anywhere where trees would pass their parameters into the sapling item tho, so maybe that's an hardcoded functionality?

    Did you defined a "sapling" in your /spawnitem's .modularfoliage file? (newfoliage) Like what the /plants/trees/alien/foliage/alienbigleaf/alienbigleaf.modularfoliage file does:
    Code:
    "dropConfig" : {
      "drops" : [
      [ { "item" : "sapling" }, { "item" : "alienfruit" } ]
      ],
     
  7. Nemasys

    Nemasys Cosmic Narwhal

    That same thought crossed my mind as well, but seems strange considering how moddable everything else is in the game.

    I did do that, but it drops a PGI instead of my new sapling. using a normal sapling works fine though, so I know my stem and foliage files are fine. But I would like the altered features of my new sapling object instead.
     
  8. Cyel

    Cyel Scruffy Nerf-Herder

    There's quite a few things that are hardcoded, actually. Stumbling upon them is mostly always kind of confusing


    Could we have the log for when said PGI is dropped? What do you mean by "a normal sapling"? One spawned with the /spawnitem command you've mentionned above? Which "altered features" are you refering to?
     
  9. Nemasys

    Nemasys Cosmic Narwhal

    I posted that log above.
    By normal sapling I mean a default Starbound sapling object. Those work just fine with my new tree. I have made a new sapling object by copying the sapling.object file, renaming the appropriate stuff, and adding the ability to plant it on any surface, but only underwater. I can spawn in this new sapling type with the admin command, but it does not work as a drop.
     
  10. Cyel

    Cyel Scruffy Nerf-Herder

    Ah, I got confused and thought that log was when you were spawning your copied sapling.object, my bad
     
  11. Nemasys

    Nemasys Cosmic Narwhal

    Well, I actually get the same error even with a copied and renamed sapling with no other changes.
     
  12. bk3k

    bk3k Oxygen Tank

    That's the thing, saplings aren't stand-alone objects. They're template objects that always have parameters added to define stems etc. Look in /plants/trees/ to see the parts available(you can make more parts of course). The parameters are used by the builder script to output the sort of saplings you can actually use.

    Look in the boime files too, you see things like this (forest biome)
    Code:
          {
            "mode" : "floor",
            "priority" : 2.0,
            "variants" : 1,
            "distribution" : "/biomes/distributions.config:denseLarge",
    
            "type" : "tree",
            "treeFoliageHueShiftMax" : 180,
            "treeStemHueShiftMax" : 15,
            "treeStemList" : [ "birch", "cocoa", "fleshy", "grumpy", "pine", "roottree", "slimey", "something", "spikey", "twisted", "wood", "slobby", "pineytree" ],
            "treeFoliageList" : [ "rose", "bubbles", "cloudy", "frumpy", "greenleaves", "hanging", "leafy", "lotus", "lushgreen", "orangeflower", "pinefoliage", "redleaves", "scraggy", "spikeyfoliage" ]
          },
    It will choose a stem and foliage from this. So what you probably need isn't to clone the sapling object, but to make new stems/foliage and add them to a biome. Short of that, you can clone the sapling but add in the needed info.
     
  13. Nemasys

    Nemasys Cosmic Narwhal

    Thanks, but I understand all of that. What I am wanting to do is create a new type of sapling object that functions a little differently than normal saplings. In order to do this I made a new version of the sapling.object file (renamed of course) to include the ability to be planted on any kind of block, but with the restriction of needing to be planted underwater. Using this newsapling.object as the drop is what's not working.
     
    Last edited: May 29, 2017
  14. G.Xyon

    G.Xyon Space Kumquat

    Tracking down the error in the buildsapling.lua, it references this line:

    Code:
     table.insert(config.inventoryIcon, {
          image = string.format("%s?hueshift=%s", util.absolutePath(root.treeStemDirectory(parameters.stemName), "saplingicon.png"), parameters.stemHueShift or 0) --this one
        })
    
    According to this, part of the issue could be that it cannot generate part of the inventory icon as it cannot find the specified stem, or perhaps the saplingicon.png itself. It's to be noted that the script calls for saplingicon.png as its default icon name; if you have the icon renamed differently, there is a big possibility that it will throw out an error. Additionally, double-check that the stem and foliage images are placed in their proper directories (plants > trees > [customtreename] > stem/foliage).
     
  15. Nemasys

    Nemasys Cosmic Narwhal

    Yeah, I've made sure naming is what it should be. The more I try to get this working the more I think there is something hard coded that's preventing it from working right...
     
  16. bk3k

    bk3k Oxygen Tank

    try this within "dropConfig" of either the stem or foliage
    Code:
      "drops" : [
          [
            {
              "item" : "sapling",
              "count" : 2,
              "parameters" : {
                "stemName" : "newstem",
                "stemHueShift" : 0,
                "foliageName" : "newfoliage",
                "foliageHueShift" : -50,
                "requireSoilAnchors" : false
              }
            }
          ]
        ],
    
    Just for starters. Maybe trade "sapling" for your new object's name? Start with "sapling" though. Try adding in all the things you need different into "parameters"

    edit:
    Now because this could get tedious if you are planning to make a lot of stuff, you might profit from an altered build script. Such that it builds this information for you.
     
    G.Xyon likes this.
  17. Nemasys

    Nemasys Cosmic Narwhal

    Thanks. That was a good thought. I hadn't tried that yet. Unfortunately adding those parameters in had no affect on the drops at all. The custom parameters didn't seem to be used at all.

    A custom build script would probably be my next step, but I know next to nothing about Lua coding. I guess I'll just have to stick with default sapling functionality for now.
     
    Last edited: May 30, 2017
  18. Cyel

    Cyel Scruffy Nerf-Herder

    The buildsappling.lua script is only used to set the inventoryIcon and it's hueShift value, so you could probably do without
     
  19. bk3k

    bk3k Oxygen Tank

    Yeah but you could make your own build script that builds the parameters of the drops, etc. Maybe not worth doing for an one or two items, but if planning many then I'd say so. That's what I meant in any case.
     
  20. G.Xyon

    G.Xyon Space Kumquat

    That's decent idea. Try spawning the sapling without the buildscript first and see if it works to your liking. If it does, then it would be only a matter of finding what's making the original script tick and clean it up as to have your own buildscript for it, much like @bk3k mentioned.
     

Share This Page