Solved Creating a new field in a YAML file

Discussion in 'Plugin Development' started by 64BFox, Nov 6, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    64BFox

    Hello everyone,
    I've been trying to make a plugin, that as a part of it, will generate a YAML file and fill a heck of a lot a values inside of it. Here's the problem - I've successfully generated the file, but there's nothing inside! I'm was using this:
    Code:
    component.set("block." + args[1] + "." + args[2] + "." + args[3], blockID);
    
    Unfourtionatly, I found that it's trying to set a location that doesn't exist, so it just kind of sits there and does nothing. Then, I tried to use this code:
    Code:
    component.createSection("block." + args[1] + "." + args[2] + "." + args[3]);
    
    However, that didn't do anything and now I'm just pretty much out of ideas. Since the file is going to be all different sizes, I won't be able to just create a standard file and have it write to that, because that would be too large or small. If anyone has any idea how I could fix this, it would be greatly appreciated!

    Thank you,
    - Nicholas
     
  2. Offline

    fireblast709

    64BFox in the first code box: make sure blockID is not null. If it is not, it should be created. Also, as the second case is strange on first sight: do you save the config after that?
     
  3. Offline

    64BFox

    Oh... um... saving the config... kinda slipped my mind... heh...

    Also, thank you for helping me fix my problem!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 29, 2016
Thread Status:
Not open for further replies.

Share This Page