API Documentation

Attention! This documentation is provided as a guide for scripting with the 0m3ga VNE. It will be updated as new features are added.

Engine Configuration

This is a required file for the engine to run.
config.dat Configuration

Title:[GAME TITLE HERE]
Version:[GAME VERSION HERE]
Author:[GAME CREATOR HERE]

What does this do?
This configuration file tells the engine some default information before the main menu shows up.
Example
Title:0m3ga Visual Novel Engine
Version:0.3
Author:qberty

Easy Scripting

Easy Scripting commands are designed for simplifying your entire script with basic functions.
System Manipulation

[WAIT]+{param1}

What does this do?
This command waits for a certain amount of milliseconds before continuing with the script as the engine is running.
How do I use it?
Replace '{param1}' with a number that represents milliseconds (1000 milliseconds = 1 second).
Example
[WAIT]+800
- This will stop running any other commands in the script until 800 milliseconds (about 0.8 seconds) have passed.

[CHOICES]+{param1}+{param2}+{choice1}+{script1}+{choice2}+{script2}

What does this do?
This command allows the user to make a choice that changes the story / script as the engine is running.
How do I use it?
Replace '{param1}' with the question that is being asked for the user to make a choice to.
Replace '{param2}' with "text" or "image". This allows you to specify whether the buttons for the choices are text based or image based.
Replace '{choice1}' with the choice in text form.
Replace '{script1}' with the script filename of the script that is loaded immediately after the choice is made.
You can have a max of 10 choices for 1 question.
Example
[CHOICES]+Should I tell her she doesn't have everything?+text+Tell her+t001_02b.txt+Don't tell her+t001_02c.txt
- This will ask the question "Should I tell her she doesn't have everything?" and display text choice buttons "Tell her" and "Don't tell her" on screen. Selecting "Tell her" will load the script "t001_02b.txt" from the Scripts Folder that is specified in the Engine Configuration file, and selecting "Don't tell her" would load the script "t001_2c.txt" from the Scripts Folder.

[SCRIPT]+{param1}

What does this do?
This command loads a new script immediately as the engine is running.
How do I use it?
Replace '{param1}' with the script filename that you want to load.
Example
[SCRIPT]+t001_2d.txt
- This will immediately load the script file "t001_2d.txt" from the Scripts Folder.

[END]

What does this do?
This command stops all commands and ends the game by quitting to the main menu.
How do I use it?
The [END] command should be used ONLY when the game is over as it abrubtly quits straight to the menu without any warning.
Text Manipulation

[TEXT]+{param1}+{param2}
OR
[TEXT]+{param2}

What does this do?
This command displays text as the engine is running.
How do I use it?
Replace '{param1}' with a title for the text (character name, speakers name).
Replace '{param2}' with the actual text that you want displayed.
Example
[TEXT]+I guess I can't just leave it alone.
- This will display "I guess I can't just leave it alone." directly in to the text box.

[TEXT]+Aeka+You're right... Why didn't I notice...
This will display "You're right... Why didn't I notice..." directly in to the text box while display "Aeka" on top to show who is talking.

[SHOWBG]

What does this do?
This command hides the text box that is displayed as the engine is running.
How do I use it?
Using this command smoothly fade away the text box to reveal the full background image. Using it again will fade the text box back in.
Image Manipulation

[IMG]+{param}

What does this do?
This command displays any image in the background as the engine is running.
How do I use it?
Replace '{param}' with the filename of any image file.
Example
[IMG]+BG_18N.jpg
- This will display the image file "BG_18N.jpg" from the Scenes Folder on the full screen.

[IMGFX]+{param}

What does this do?
This command displays filters and effects on top of any image in the background as the engine is running.
How do I use it?
Replace '{param}' with ("negative" - Inverts the background image.)
Example
[IMGFX]+negative
- This would apply the negative effect on top of the currently displayed background image.

[FADEOUT]+{param}

What does this do?
This command lets you fade out the background image into a solid colour as the engine is running.
How do I use it?
Replace '{param}' with any colour words ("black","orange","blue") OR with RGB values ("193,132,89","255,109,112").
Example
[FADEOUT]+black
- This will fade out the currently displayed image to a solid black.
Character Manipulation

[CHAR]+{param1}+{param2}+{param3}

What does this do?
This command displays a character and positions it on the screen as the engine is running.
How do I use it?
Replace '{param1}' with a position relative to the screen ("left","middle","right").
- You can replace '{param1}' with "hide" for a quick way to make a character image fade out.
Replace '{param2}' with the name of the character to be used by other commands (short names recommended).
Replace '{param3}' with the filename of any image file that will be displayed as a character.
- If you replaced '{param1}' with "hide" then '{param3}' is not used.
Example
[CHAR]+left+misa+STG000
- This will display "misa" on the left with the "STG000" image file from the Characters Folder and "takeshi" on the right with the "STI000" image file from the Characters Folder.
Sound Manipulation

[VOICE]+{param2}
OR
[BGM]+{param1}+{param2}
OR
[SOUNDFX]+{param1}+{param2}

What does this do?
This command allows you to play sound as the engine is running.
How do I use it?
Replace '{param1}' with ("now" - Plays the sound once.) OR ("looping" - Loops the sound indefinitely.)
Replace '{param2}' with the filename of any sound file.
Example
[BGM]+looping+BGM03.mp3
- This will play the "BGM03.mp3" file from the Music Folder in the background and repeat it forever.

[STOPSOUND]
OR
[STOPSOUNDFX]

What does this do?
This command will stop any currently playing sound
How do I use it?
[STOPSOUND] will stop ALL sounds immediately.
[STOPSOUNDFX] will stop ONLY sound that is played using [SOUNDFX]

Advanced Scripting

Advanced Scripting commands are designed for adding more functionality in less lines for your script.
Text Manipulation

[TEXTAFTER]+{param1}+{param2}+{cmd1}+{cmdparams}+{time}+{cmd2}+{cmdparams2}+{time2}+etc...

What does this do?
This command displays text like the normal [TEXT] command but with timed events. You can time an event (character to pop up, more text to display etc...) after a certain amount of time has passed from the displayed text.
How do I use it?
Replace '{param1}' with a title for the text (character name, speakers name).
Replace '{param2}' with the actual text that you want displayed.
Replace '{cmd1}' with any supported command ("[TEXT]" or "[CHAR]"...more will be added later).
Replace '{cmdparams}' with the parameters that go with the command you specified for '{cmd1}'.
Replace '{time}' with the amount of time to wait before running the '{cmd1}' command in milliseconds (1000 = 1 second).
Example
[TEXTAFTER]+Male Student+Yo! Kouhei... +[TEXT]+Male Student+PPFughh!?+1100+[CHAR]+middle+takeshi+STI100+1100
- This will display the text "Yo! Kouhei... " in the text box and display the speaker as "Male Student". After 1.1 seconds the engine will display "PPFughh!?" in the text box and show the character "takeshi" in the middle with the "STI100" image file from the Characters Folder.
Character Manipulation

[CHAR]+{param1}+{char1p}+{char1n}+{char1f}+{char2p}+{char2n}+{char2f}+etc...

What does this do?
This command allows you to display and position more than one character at a time in a single line as the engine is running.
How do I use it?
Replace '{param1}' with the number of characters (2-9999).
Replace '{char1p}' with the position of the character ("left","middle","right")
Replace '{char1n}' with the name of the character (short name recommended)
Replace '{char1f}' with the filename of the image file for the character.
Replace '{char2p}' with the posi.... ahh you get the idea.
Example
[CHAR]+2+left+misa+STG002+right+takeshi+STI100
- This will display 2 characters. "misa" will be displayed on the left with the "STG002" image file from the Characters Folder and "takeshi" will be displayed on the right with the "STI100" image file from the Characters Folder.