Scripting Unleashed - Scripting Basics

Top  Previous  Next

MMBScriptLangHeader

Yeah, just like with any language - there are some rules we must obey to use it.

Compared to human languages, MMB script is one simple & fast-learning language.

Basic Facts

 

1. Scripting is done using lines (rows): as you would type some story (for e.g. detective story about who killed the butler) on a type-writer, you'll in MMB case use keyboard to write MMB script story - and guess what: by default, one sentence per line :)

2. Sentence in MMB script story is called "code line": one line usually represents one command (there are just a few exceptions)

3. You don't have to remember command names ! MMB will help you using commands without knowing their attributes, and it'll provide help in more ways:

syntax completion: MMB keeps watching what you write and if it finds identical command in it's list - completes code line with required syntax - now all you have to do is enter parameters specific to your project
right-click command list menu: quick list of available commands is on your right-click mouse button - select command and move on !
script wizard: using built-in command list in script editor, you really don't have to remember any command name - selection of command will show you it's explanation and enable entering of parameters
MMB help file: every time you want extended explanation of some MMB script command, come here, to MMB Script Manual, and read all about it !

4. Syntax highlighting & formatting: MMB will automatically colorize command parts, making entire code easily readable. In addition to this, it will automatically arrange indent of code lines once you're finished with scripting, further enhancing code readability.

 

Preview of script lines

CodeLines

Here you see what these code lines look like - they're rows of commands that tell the story and depending on situation - perform assigned action.

 

In example above, story goes like this:

After gathering all suspects in one room, detective is ready for his final act.

- Detective reads key evidence, exposing the killer - "Old grandpa"

- Although he's already prepared with line accusing Joe for violent act..

- After reading key evidence, he screams:

 

Oh, now ! Grandpa, how could you !

 

And that's it ! 9-line story & Grandpa's going behind the bars !

Details you can notice on preview displayed above:

names (Old grandpa, Joe) are colored red
Detective's thoughts (if it's Joe / if it's Grandpa) are colored blue
Detective's screaming (So it IS / Grandpa, how could you) are left in black color
indent of every line is arranged to make story/code reading easier