Modding Help The New "Directives"

Discussion in 'Starbound Modding' started by Stormalisk, May 6, 2015.

  1. Stormalisk

    Stormalisk Scruffy Nerf-Herder

    Once upon a time someone posted how to customize armor with scripting a mini mod, since then I have had all sorts of fun with the feature.

    However, now with spirited giraffe some things have changed, and this change I am unable to pinpoint to get the mod to work on starbound.

    I am thinking it is something with the "default blueprints" file but I am not sure. So I am asking if anybody has experimented with this yet and could help me out.

    (I would use SBSE, however, the browser version is extinct and it doesn't run on Linux)
     
  2. Kayuko

    Kayuko Oxygen Tank

    Best Answer
    Sometimes I feel like I'm awesome as fck.
    Then I remember that's not really coding, then I'm sad. :<

    But here you go:

    player.config.patch:

    [
    { "op" : "add" , "path" : "/defaultBlueprints/tier1/-" , "value" : { "item" : "slimechest", "data" : { "directives" : "?replace;C9F080=CDD5EE;2F746E=314993;48A075=4D6BC3;5AD385=8B9ED8"}} },
    { "op" : "add" , "path" : "/defaultBlueprints/tier1/-" , "value" : { "item" : "slimelegs", "data" : { "directives" : "?replace;C9F080=CDD5EE;2F746E=314993;48A075=4D6BC3;5AD385=8B9ED8"}} }
    ]


    001.recipe:

    {
    "input" :[
    { "item" : "money", "count" : 1 }
    ],
    "output" : { "item" : "slimechest", "data" : { "directives" : "?replace;C9F080=CDD5EE;2F746E=314993;48A075=4D6BC3;5AD385=8B9ED8"}, "count" : 1 },
    "groups" : [ "plain", "armors", "all" ]
    }


    002.recipe:

    {
    "input" : [{ "item" : "money", "count" : 1 }],
    "output" : { "item" : "slimelegs", "data" : { "directives" : "?replace;C9F080=CDD5EE;2F746E=314993;48A075=4D6BC3;5AD385=8B9ED8"}, "count" : 1 },
    "groups" : [ "plain", "armors", "all" ]
    }
     
  3. Kayuko

    Kayuko Oxygen Tank

    If you'd at least attach the files you've used or provide a link to them we could probably help you, there was no drastic change to the way custom armors work, to my knowledge.

    That is, if we're talking about Upbeat -> Spirited.
     
  4. Stormalisk

    Stormalisk Scruffy Nerf-Herder

    EX the "recipe"
    { "input" : [ { "item" : "money", "count" : 1 } ], "output" : { "item" : "slimechest", "data" : { "directives" : "?replace;c9f080=cdd5ee;2f746e=314993;48a075=4d6bc3;5ad385=8b9ed8"}, "count" : 1 }, "groups" : [ "plain", "armors", "all" ] }"]


    Now is this still correct? Filename of first item is 001

    I unfortunately lost my blueprint file while tweaking with it. Now how would I approach making it? Since it seems the old style doesnt work.
     
  5. Kayuko

    Kayuko Oxygen Tank

    I've researched about this whole directives thing (didn't know about this, it's extremely nice tho, lol), but sadly I can't find any other mod I could compare this with.
    The lines you posted seems to be correct (MOSTLY).


    {
    "input" : { "item" : "money", "count" : 1 } ,
    "output" : { "item" : "slimechest", "data" : { "directives" : "?replace;c9f080=cdd5ee;2f746e=314993;48a075=4d6bc3;5ad385=8b9ed8"}, "count" : 1 },
    "groups" : [ "plain", "armors", "all" ]
    }

    (no spoiler cuz breakdown)

    If that's what your whole file looked like it would throw a syntax error.

    "
    {
    "input" : [ { "item" : "money", "count" : 1 } ],
    "output" : { "item" : "slimechest", "data" : { "directives" : "?replace;c9f080=cdd5ee;2f746e=314993;48a075=4d6bc3;5ad385=8b9ed8"}, "count" : 1 },
    "groups" : [ "plain", "armors", "all" ]
    }
    "]

    Red ones just don't belong there at all.
    For orange, it's only a single item. Theres no need to create an array (however, it still works with one). THIS FRIGGIN ARRAY IS NEEDED! Dun listen to that noob before.

    The thing is, I'm afraid the gui changed how this is working.
    But, just to be sure, here's the line you'd need to add a blueprint on this item:

    { "op" : "add" , "path" : "/defaultBlueprints/tier1/-" , "value" : { "item" : "slimechest" } }

    The Hex-values look fine, and as I said I have no clue about directives, never ever saw or used them, try those things, maybe it'll help.
     
    Last edited: May 6, 2015
  6. Stormalisk

    Stormalisk Scruffy Nerf-Herder

    What you highlighted in red was some goof from the spoiler thing. I wanted to keep my post shorter but that wasn't happening easily apparently.

    Here is the copy EXACT

    {
    "input" : [
    { "item" : "money", "count" : 1 }
    ],
    "output" : {

    "item" : "slimechest",
    "data" : { "directives" : "?replace;c9f080=cdd5ee;2f746e=314993;48a075=4d6bc3;5ad385=8b9ed8"},
    "count" : 1

    },
    "groups" : [ "plain", "armors", "all" ]
    }

    Also with the blueprints that was my assumption as I was probing mods to help me out.
     
  7. Kayuko

    Kayuko Oxygen Tank

    Looks okay... already tried with replacing the blueprint file?

    [{ "op" : "add" , "path" : "/defaultBlueprints/tier1/-" , "value" : { "item" : "slimechest" } }] <--- player.config.patch in the main mod-directory.
    If you're saying "old" btw, did the old one use the __merge system?
     
  8. Stormalisk

    Stormalisk Scruffy Nerf-Herder

  9. Kayuko

    Kayuko Oxygen Tank

    So, before we spam the whole forum with stuffs.

    What exactly doesnt work?
    Is the item not shown in recipes? (Starbound.log)
    Does the item show up, but it's not recolored? (Starbound.log)
    Does Starbound not even start? (Obviously, the log)

    And you're trying to use that on a slimechest, in the thread however it says it only works on already dyeable items, I'm sure you're aware of that, but just to be even more sure, did you take that into account?
    As you see, in almost every situation in this kind of problem-development, a starbound.log would help a lot.
     
  10. Stormalisk

    Stormalisk Scruffy Nerf-Herder

    Alright it is still crashing starbound. It tries to load then crashes.

    "Start logging at: 2015-05-06 06:57:34.682 [06:57:34.682] Info: Star::Root using bootstrap file '/home/stormalisk/.local/share/Steam/SteamApps/common/Starbound/linux32/sbboot.config' [06:57:34.682] Info: Star::Root using storage directory '/home/stormalisk/.local/share/Steam/SteamApps/common/Starbound/giraffe_storage' [06:57:34.682] Info: Preparing Star::Root... [06:57:34.682] Info: Detected mod 'DirectivesTwo' at '../giraffe_storage/mods/DirectivesTwo/.' [06:57:34.682] Info: Loading Configuration with config file: 'starbound.config' [06:57:34.682] Info: Loading Star::Configuration from 'Just (./../giraffe_storage/starbound.config)' [06:57:34.684] Info: Writing Star::Configuration to './../giraffe_storage/starbound.config' [06:57:34.685] Info: Initializing Star::Root with 3 assets sources [06:57:34.685] Info: Done preparing Star::Root. [06:57:34.685] Info: Client Version 'Beta v. Spirited Giraffe - Update 4' Revision: 50d7c4ce63b249c459f276280225041cc4e745a8 Protocol: 679 [06:57:34.686] Info: Initialized SDL [06:57:34.744] Info: Initialized SDL Video [06:57:34.744] Info: Initialized SDL Joystick [06:57:34.753] Info: Initialized SDL Sound [06:57:34.757] Info: Opened default audio device with 44khz / 16 bit stereo audio, 1024 sample size buffer [06:57:34.757] Info: Loading Assets [06:57:34.757] Info: Loading Star::Assets from: '../assets/packed.pak' [06:57:34.758] Info: Loading Star::Assets from: '../assets/user' [06:57:34.758] Info: Loading Star::Assets from: '../giraffe_storage/mods/DirectivesTwo/.' [06:57:35.268] Info: Done loading Assets [06:57:35.272] Info: Fully loading Star::Root... [06:57:35.273] Info: Loading NameGenerator [06:57:35.280] Info: Loading ObjectDatabase [06:57:35.282] Info: Initializing SDL Window [06:57:35.284] Info: Loading PlantDatabase [06:57:35.285] Info: Loading ProjectileDatabase [06:57:35.286] Info: Loading MonsterDatabase [06:57:35.286] Info: Loading NpcDatabase [06:57:35.288] Info: Loading PlayerFactory [06:57:35.292] Info: Loading EntityFactory [06:57:35.301] Info: Done loading NameGenerator [06:57:35.301] Info: Loading ItemDatabase [06:57:35.301] Info: Done loading PlayerFactory [06:57:35.301] Info: Loading MaterialDatabase [06:57:35.301] Info: Loading ParticleDatabase [06:57:35.482] Info: OpenGL version: '2.1 Mesa 9.1.1' vendor: 'Intel Open Source Technology Center' renderer: 'Mesa DRI Mobile IntelĀ® GM45 Express Chipset x86/MMX/SSE2' shader: '1.20' [06:57:35.482] Info: Created initial window 1000x600 [06:57:35.639] Info: Renderer initialized [06:57:36.267] Info: Done loading ParticleDatabase [06:57:36.532] Info: Done loading NpcDatabase [06:57:36.532] Info: Loading TerrainDatabase [06:57:36.709] Info: Done loading TerrainDatabase [06:57:36.709] Info: Loading BiomeDatabase [06:57:36.970] Info: Done loading PlantDatabase [06:57:36.981] Info: Loading LiquidsDatabase [06:57:37.426] Info: Done loading ProjectileDatabase [06:57:37.426] Info: Loading StatusEffectDatabase [06:57:37.624] Info: Done loading StatusEffectDatabase [06:57:37.625] Info: Loading DamageDatabase [06:57:38.180] Info: Done loading BiomeDatabase [06:57:38.180] Info: Loading EffectSourceDatabase [06:57:38.390] Info: Done loading EffectSourceDatabase [06:57:38.400] Info: Loading FunctionDatabase [06:57:38.469] Info: Done loading FunctionDatabase [06:57:38.469] Info: Loading TreasureDatabase [06:57:38.960] Info: Done loading TreasureDatabase [06:57:38.960] Info: Loading DungeonDefinitions [06:57:39.470] Info: Done loading DamageDatabase [06:57:39.476] Info: Loading EmoteProcessor [06:57:39.476] Info: Done loading EmoteProcessor [06:57:39.476] Info: Loading SpeciesDatabase [06:57:39.483] Info: Done loading MonsterDatabase [06:57:39.485] Info: Loading ImageMetadataDatabase [06:57:39.486] Info: Done loading ImageMetadataDatabase [06:57:39.486] Info: Loading VersioningDatabase [06:57:39.488] Info: Done loading VersioningDatabase [06:57:39.496] Info: Loading QuestTemplateDatabase [06:57:39.605] Info: Done loading SpeciesDatabase [06:57:39.605] Info: Loading AiDatabase [06:57:39.714] Info: Done loading QuestTemplateDatabase [06:57:39.715] Info: Loading TechDatabase [06:57:39.740] Info: Done loading MaterialDatabase [06:57:39.747] Info: Loading CodexDatabase [06:57:39.754] Info: Done loading LiquidsDatabase [06:57:39.782] Info: Done loading TechDatabase [06:57:39.785] Info: Done loading AiDatabase [06:57:39.822] Info: Done loading ObjectDatabase [06:57:39.822] Info: Done loading EntityFactory [06:57:39.994] Info: Done loading CodexDatabase [06:58:01.533] Info: Done loading DungeonDefinitions [06:58:01.537] Error: Exception raised during Root finishLoad: (RecipeException) Recipe missing required ingredient: (JsonException) Improper conversion to JsonArray from object ./starbound(_ZN4Star13StarExceptionC2ESs+0x6f) [0x8d4809f] ./starbound(_ZN4Star15RecipeExceptionC2ESs+0x22) [0x86e7172] ./starbound(_ZNK4Star12ItemDatabase11parseRecipeERKNS_4JsonE+0x87d) [0x86e213d] ./starbound(_ZN4Star12ItemDatabase11scanRecipesEv+0xad) [0x86e46ed] ./starbound(_ZN4Star12ItemDatabaseC1Ev+0x651) [0x86e5a11] ./starbound(_ZN4Star4Root12itemDatabaseEv+0xbc) [0x883725c] ./starbound(_ZNSt17_Function_handlerIFvvEN4Star13SwallowReturnISt5_BindIFSt7_Mem_fnIMNS1_4RootEFSt10shared_ptrIKNS1_12ItemDatabaseEEvEEPS5_EEEEE9_M_invokeERKSt9_Any_data+0x28) [0x8843598] ./starbound() [0x8d4293f] ./starbound(_ZN4Star10WorkerPool12WorkerThread3runEv+0xda) [0x8d433fa] ./starbound(_ZN4Star10ThreadImpl9runThreadEPv+0x1a) [0x8d50aaa] /lib/i386-linux-gnu/libpthread.so.0(+0x6d78) [0xb767ad78] /lib/i386-linux-gnu/libc.so.6(clone+0x5e) [0xb72bc3de] [06:58:01.547] Info: Renderer destroyed [06:58:01.997] Info: Shutting down Star::Root [06:58:02.613] Error: Fatal Exception Caught: (StarException) An error occurred during loading: (RecipeException) Recipe missing required ingredient: (JsonException) Improper conversion to JsonArray from object ./starbound(_ZN4Star13StarExceptionC2ESs+0x6f) [0x8d4809f] ./starbound(_ZN4Star17ClientApplication24postSplashInitializationEv+0x2a4) [0x8473144] ./starbound(_ZN4Star17ClientApplication6updateEv+0x261) [0x8477841] ./starbound(_ZN4Star19StarApplicationBase3runEv+0x1b8) [0x8c83ac8] ./starbound(main+0x82d) [0x84632bd] /lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0xb71e4935] ./starbound() [0x84720f9]"]


    Slimechest is the item name for the slime costume's chest.

    No idea what to do about the cat faces...
     
  11. Kayuko

    Kayuko Oxygen Tank

    Whoa. I'm sorry, but I can't use that. Any way you can format that or attach it? x:
     
  12. Stormalisk

    Stormalisk Scruffy Nerf-Herder

    Maybe this'll work

    Sorry I haven't touched the forum in almost a year.
     

    Attached Files:

  13. Kayuko

    Kayuko Oxygen Tank

    Okay, I know WHERE the problem lies at least.
    One last request and I'm done being annoying. :p

    Any way you can zip the DirectivesTwo folder and attach it here?
     
  14. Stormalisk

    Stormalisk Scruffy Nerf-Herder

    Yea!
     

    Attached Files:

  15. Kayuko

    Kayuko Oxygen Tank

    Okay, so first of all, that comment above was complete and total nonsense, I'm a noob, so thats nothing new.
    Obviously the ingredients have to be in an array.

    It works without the directives, but it doesn't show up in the crafting menu with directives, so I'll take a deeper look at all that.
    Might take a pretty long while tho, so I'll just get back to you when I'm done (or when I gave up / swat mysteriously shows up and tells us directives doesn't work anymore).
     
  16. Stormalisk

    Stormalisk Scruffy Nerf-Herder

    Alright thanks, I know somebody made a script for a command to color armor like directives in-game. I have no idea on how that is accomplished.
     
  17. Kayuko

    Kayuko Oxygen Tank

    Best Answer
    Sometimes I feel like I'm awesome as fck.
    Then I remember that's not really coding, then I'm sad. :<

    But here you go:

    player.config.patch:

    [
    { "op" : "add" , "path" : "/defaultBlueprints/tier1/-" , "value" : { "item" : "slimechest", "data" : { "directives" : "?replace;C9F080=CDD5EE;2F746E=314993;48A075=4D6BC3;5AD385=8B9ED8"}} },
    { "op" : "add" , "path" : "/defaultBlueprints/tier1/-" , "value" : { "item" : "slimelegs", "data" : { "directives" : "?replace;C9F080=CDD5EE;2F746E=314993;48A075=4D6BC3;5AD385=8B9ED8"}} }
    ]


    001.recipe:

    {
    "input" :[
    { "item" : "money", "count" : 1 }
    ],
    "output" : { "item" : "slimechest", "data" : { "directives" : "?replace;C9F080=CDD5EE;2F746E=314993;48A075=4D6BC3;5AD385=8B9ED8"}, "count" : 1 },
    "groups" : [ "plain", "armors", "all" ]
    }


    002.recipe:

    {
    "input" : [{ "item" : "money", "count" : 1 }],
    "output" : { "item" : "slimelegs", "data" : { "directives" : "?replace;C9F080=CDD5EE;2F746E=314993;48A075=4D6BC3;5AD385=8B9ED8"}, "count" : 1 },
    "groups" : [ "plain", "armors", "all" ]
    }
     
  18. Stormalisk

    Stormalisk Scruffy Nerf-Herder

    Yep it works!

    Thank you so much!
     

Share This Page