Pages for this project
Most of the files in SplameiPlay follow the SplameiPlay File Syntax. This syntax needs to be strictly followed otherwise SplameiPlay won’t be able parse the data it needs. Here’s an example of a file’s contents:
Version=1.1
Type=HelloWorld
TypeVersion=1.0
HelloWorld
# Hello World!
/HelloSection
Hello=WorldInitial setup
Firstly, you’ll need a text editor to make the file. You can use the default notepad app on your system or the SplameiPlay SDK to create the file.
This page is for the file syntax 1.1 which means it will not be compatible with versions prior to 5.0 Particle
Manually creating
Making the header
Every SplameiPlay file needs the header. This defines information about the file.
The first line is the file version. It declares what version of the file syntax should be used. Here, we’ll just use version 1.1 so start the file with Version=1.1
Next, we need to define the type and version. This is for you to know if the file is what you want or not. So right after the version declaration, write Type= following by the type (it’s best practice to use CamelCase) then TypeVersion= followed by the version (this should be a float). Now leave an empty line ready for the contents of the file!
Adding the content
To add content of the file, you need to set the value of the declaration. This can only contain alphanumerical characters with no spaces (we recommend using CamelCase). If the declaration doesn’t need a value, you can just add it as a new line. If it should have a value, add an equal ‘=’ sign right after (no spaces) followed by the value. This can be a boolean (lowercase true/false), integer, string or float. Some examples include IntValue=1, StringValue=Hello World and BoolValue=false. You can also create new lines for string values by using the carriage return (\n)
Adding a section
All content at the start of the file will be in the global section until you declare a section. All you need to do is start the line with a slash ‘/’ followed by the section name. Again, this should be in CamelCase and must only contain alphanumerical characters. For example /HelloWorld and /SectionExample
When a section is declared, it can’t be declared again so you should make sure declarations are organised to prevent it
Adding a comment
If you need to comment in the file, you can add one by starting the line with a hash ‘#’. There are no further restrictions with comments so they can contain any character as comment lines are ignored when read by the SDK. A comment could look like this: # This section sets all the required settings needed
Best practices
When making SplameiPlay files, there’s a few conventions that should may want to follow:
- When declaring section, type and key names, you should use CamelCase
- The files saved should end in
.splameiplayto make it clearer to some apps that the file is a SplameiPlay file