Solved Small issue with config.yml

Discussion in 'Plugin Development' started by Firefox365, Oct 6, 2012.

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

    Firefox365

    So Basically I have a plugin and I have a config.yml file. I set the file like this:
    Code:
    # Blow - Configuration File #
     
    #-----------------{ Blow - /blow (player/me) [power] }-------------------#
    # Default Power Can not be higher then 10. If it is It will be reset to 5 #
     
    Default Power: 5
     
    #---------------------------{ Custom Messages }---------------------------#
     
    Suicidal Blow Up: '&aYou Has Blown Urself up!&e =P'
    And when I put the plugin in the server, it turns out like this:
    Code:
    # Blow - Configuration File #
     
    Default Power: 5
    Suicidal Blow Up: '&aYou Has Blown Urself up!&e =P'
    
    Why won't It save The #s after the first line?
    And what do I have to do to make it work?
    Thanks!
     
  2. I can't explain it exactly. It has something to do with... how default values are handled with yaml-files.

    Anyway...
    You should not have any empty lines! At least do # and a space!

    So change this
    Code:
    # Blow - Configuration File #
     
    #-----------------{ Blow - /blow (player/me) [power] }-------------------#
    to this:
    Code:
    # Blow - Configuration File #
    # 
    #-----------------{ Blow - /blow (player/me) [power] }-------------------#
    Also... you can only have comments at the top of the file.
    So this is not allowed
    Code:
    Default Power: 5
     
    #---------------------------{ Custom Messages }---------------------------#
     
  3. Offline

    Firefox365

    If this is true then how can the plugins Essentials have this as there config?

    Code:
    ############################################################
    # +------------------------------------------------------+ #
    # |                      Notes                          | #
    # +------------------------------------------------------+ #
    ############################################################
     
    # If you want to use special characters in this document, such as accented letters, you MUST save the file as UTF-8, not ANSI.
    # If you receive an error when Essentials loads, ensure that:
    #  - No tabs are present: YAML only allows spaces
    #  - Indents are correct: YAML hierarchy is based entirely on indentation
    #  - You have "escaped" all apostrophes in your text: If you want to write "don't", for example, write "don''t" instead (note the doubled apostrophe)
    #  - Text with symbols is enclosed in single or double quotation marks
     
    # If you have problems join the Essentials help support channel: http://tiny.cc/EssentialsChat
     
    ############################################################
    # +------------------------------------------------------+ #
    # |                Essentials (Global)                  | #
    # +------------------------------------------------------+ #
    ############################################################
    
     
Thread Status:
Not open for further replies.

Share This Page