Jump to content

Config help - excluding a section - How?


GazCBG

Recommended Posts

Hi,

 

I am just creating game config and am currently doing the .xml config files but would like to know how to exclude a section from the config when it is written, if a setting is picked.

 

So let say the config is like

{
 "sessions": [
   {
     "hour": 18,
     "day": 29,
     "Type": "P",
     "Minutes": 15
   },
   {
     "hour": 18,
     "day": 29,
     "Type": "Q",
     "Minutes": 15
   },
   {
     "hour": 18,
     "day": 29,
     "Type": "R",
     "Minutes": 15
   }
 ]
}

 

 

If I don't want to include the below in the config for example, how would I tell TCAdmin to not add it?

 

   {
     "hour": 18,
     "day": 29,
     "Type": "P",
     "Minutes": 15
   },

Link to comment
Share on other sites

If you use the configuration editor, you can setup a variable. Add this variable to the editor as a checkbox. Enter this in the 'On' field:

{

"hour": 18,

"day": 29,

"Type": "P",

"Minutes": 15

},

Leave the Off value blank.

 

It will be incorrectly formatted, but that shouldn't mean anything.

 

 

Use this as your template for the file:

{
 "sessions": [
   ![MyVariable]
   { 
     "hour": 18,
     "day": 29,
     "Type": "Q",
     "Minutes": 15
   },
   {
     "hour": 18,
     "day": 29,
     "Type": "R",
     "Minutes": 15
   }
 ]
}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Who's Online   0 Members, 0 Anonymous, 87 Guests (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use