MAKO Language Guide
MAKO is a lightweight templating language designed for rapid development. This guide explains how to use MAKO syntax and features within your Modularity projects.
Note: This is the MAKO templating language (from getmako.org). ModuMAKO is Modularity's implementation and integration of MAKO as a scripting system.
What is MAKO?
MAKO is a template engine written in Python that provides a simple, yet powerful way to generate dynamic content. While traditionally used for web templating, ModuMAKO brings MAKO's clean syntax and rapid development benefits to game engine scripting.
Key characteristics:
- Simple syntax — Clean, readable code that looks like the language you're already familiar with
- Rapid iteration — No build step, no project files — write and run
- Powerful — Full access to engine APIs and scripting capabilities
- Modular — Build reusable components and libraries
Basic Syntax
Variables and Expressions
MAKO uses Python-like syntax for variables and expressions:
# Define variables
name = "Player"
health = 100
position = Vector3(0, 0, 0)
# Use expressions
speed = 5.0
distance = speed * 2
Control Flow
MAKO supports familiar control structures:
# If/else statements
if health > 0 {
AddLog("Character is alive");
} else {
AddLog("Character is dead");
}
# For loops
for i in range(10) {
AddLog("Count: " + str(i));
}
# While loops
while health > 0 {
TickUpdate();
}
Functions
Define and call functions:
# Define a function
function ApplyDamage(damageAmount) {
health = health - damageAmount;
if health <= 0 {
OnDeath();
}
}
# Call the function
ApplyDamage(25);
Comments
# Single line comment
/* Multi-line
comment */
Engine Integration
Working with Components
Common Patterns
Data Types
Utility Functions
Best Practices
Debugging
Performance Tips
Resources
Troubleshooting
"Script not found" error
- Ensure the script file is in
Assets/Scripts - Check for typos in the script name or class declaration
"Component not found"
- Verify the component is attached to the object
- Check component type spelling (case-sensitive)
Performance issues
- Profile with AddLog to identify slow operations
- Move non-essential code out of TickUpdate()
- Cache expensive lookups
Unexpected behavior
- Add debug logs to trace execution flow
- Check variable types — ensure type consistency
- Review the ModuMAKO scripting documentation for engine-specific behaviors