10 KiB
ASHES Language Support - HowTo Guide
This guide provides comprehensive instructions for configuring and using the ASHES Language Support extension for Visual Studio Code.
Table of Contents
- Installation & Configuration
- Available Commands & Functionality
- Language Features
- Code Snippets
- Auto-completion & IntelliSense
- Syntax Highlighting
- Troubleshooting
Installation & Configuration
Quick Installation
-
Copy the extension folder to your VS Code extensions directory:
- Linux:
~/.vscode/extensions/ - macOS:
~/.vscode/extensions/ - Windows:
%USERPROFILE%\.vscode\extensions\
- Linux:
-
Rename the folder to
ashes-language-support-0.1.0 -
Reload VS Code or restart the application
-
Verify installation by opening any
.escfile - you should see "ASHES" in the language selector (bottom-right corner)
Development Mode Installation
-
Open VS Code in the extension directory:
cd vscode-extension-ashes code . -
Install dependencies:
npm install -
Compile TypeScript:
npm run compile -
Press F5 to run the extension in a new Extension Development Host window
Configuration Options
The extension automatically configures itself when you open .esc files. No additional configuration is required, but you can customize:
- File associations: Ensure
.escfiles are associated with the ASHES language - Editor settings: Configure indentation, word wrap, etc. in VS Code settings
- Theme compatibility: The extension works with all VS Code themes
Available Commands & Functionality
VSCode Commands
ASHES: Show Command Reference
- Access:
Ctrl+Shift+P→ Type "ASHES: Show Command Reference" - Description: Opens a webview panel with a complete reference of all ASHES commands
- Features:
- Searchable table of commands
- Parameter information
- Command descriptions
ASHES Language Commands
The extension supports 60+ ASHES commands organized by category:
Animation Commands
anim(object_id, animation_name)- Play animation on objectanim_block(object_id, animation_name)- Play animation and wait for completionset_animations(object_id, animations)- Set object animations
Camera Commands
camera_push(x, y)- Push camera to new positioncamera_set_pos(x, y)- Set camera positioncamera_set_target(object_id)- Set camera targetcamera_set_zoom(zoom_level)- Set camera zoom levelcamera_shift(x, y)- Shift camera position
Dialog & Text Commands
say(speaker, text, translation_key, type)- Display dialog textsay_random(speaker, list_id, length)- Say random text from listsay_sequence(speaker, list_id, length, loop)- Say text sequenceblock_say()- Start a block of say commandsend_block_say()- End a block of say commands
Game State Commands
change_scene(scene_path, enable_transition, run_events)- Change to a different scenesave_game(save_name)- Save game stateset_global(variable_name, value, force)- Set global variableset_globals(variables_dict)- Set multiple global variablesinc_global(variable_name)- Increment global variabledec_global(variable_name)- Decrement global variable
Inventory Commands
inventory_add(item_id)- Add item to inventoryinventory_remove(item_id)- Remove item from inventoryitem_count_add(item_id, count)- Add to item countset_item_custom_data(item_id, key, value)- Set item custom data
Object Manipulation Commands
set_active(object_id, active)- Set object active/inactiveset_interactive(object_id, interactive)- Set object interactive stateset_state(object_id, state)- Set object stateset_tooltip(object_id, action, text)- Set object tooltipteleport(object_id, target_id)- Teleport object to targetteleport_pos(object_id, x, y)- Teleport object to positionwalk(object_id, target_id)- Walk object to targetwalk_to_pos(object_id, x, y)- Walk object to position
Audio/Video Commands
play_snd(sound_path, type)- Play sound fileplay_lib_snd(filename, namespace)- Play library soundplay_video(video_path)- Play video filestop_snd(sound_type)- Stop sound
Utility Commands
print(message)- Print debug messagewait(duration)- Wait for specified timetransition(transition_type, duration)- Play transition effectcustom(command_name, ...args)- Execute custom command
Built-in Variables
The extension provides auto-completion for these built-in variables:
CURRENT_PLAYER- Current player objectESC_LAST_SCENE- Last scene identifierESC_CURRENT_SCENE- Current scene identifierFORCE_LAST_SCENE_NULL- Force last scene to nullANIMATION_RESOURCES- Animation resources
Keywords
Auto-completion for ASHES keywords:
var- Local variable declarationglobal- Global variable declarationif,elif,else- Conditional statementswhile- Loop statementbreak,done- Loop controlstop,pass- Flow controltrue,false,nil- Boolean valuesand,or,not- Logical operatorsin,is,active- Special operators
Language Features
Events
:event_name
# Event code here
:event_with_target "target_id"
# Event code here
:event_with_flags | NO_UI | NO_TT
# Event code here
Variables
# Local variables
var my_variable = "value"
# Global variables
global game_state = "playing"
# Global IDs (with $ prefix)
set_active($player, true)
Control Flow
if condition:
# Code here
elif other_condition:
# Code here
else:
# Code here
while condition:
# Code here
break # Exit loop
# or
done # Continue to next iteration
Dialog System
?!
- "Choice 1"
# Code for choice 1
- "Choice 2" [condition]
# Code for choice 2 (only if condition is true)
Comments
# This is a line comment
Code Snippets
The extension provides 20+ code snippets for common ASHES patterns:
Event Snippets
event→ Create new eventeventtarget→ Create event with targeteventflags→ Create event with flagseventflagstarget→ Create event with flags and target
Command Snippets
say→ Say commandsetglobal→ Set global variablechangescene→ Change scenesetactive→ Set object activeteleport→ Teleport objectwalk→ Walk objectplaysnd→ Play soundplayvideo→ Play videoinventoryadd→ Add to inventoryinventoryremove→ Remove from inventory
Control Flow Snippets
if→ If statementifelse→ If-else statementwhile→ While loop
Dialog Snippets
dialog→ Dialog block with choicedialogif→ Dialog choice with condition
Utility Snippets
var→ Local variable declarationglobal→ Global variable declarationcomment→ Add commentprint→ Print debug message
Using Snippets
- Type the snippet prefix (e.g.,
event) - Press
Tabto expand - Use
Tabto navigate between placeholders - Press
EnterorEscapeto finish
Auto-completion & IntelliSense
Trigger Characters
Auto-completion is triggered by:
- Space character (
) - Opening parenthesis (
() - Dollar sign (
$) for global IDs
Command Completion
- Type any ASHES command and press
Ctrl+Space - Commands show with descriptions and parameter hints
- Parameters are automatically inserted with placeholders
Variable Completion
- Built-in variables are automatically suggested
- Global IDs with
$prefix are suggested - Keywords are suggested in appropriate contexts
Hover Information
- Hover over any command to see detailed information
- Shows command description and parameter list
- Works for built-in variables and keywords
Syntax Highlighting
The extension provides comprehensive syntax highlighting:
Color Scheme
- Events (
:event_name) - Blue - Commands (
say,set_global, etc.) - Green - Variables (
var,global) - Orange - Strings (
"text") - Yellow - Comments (
# comment) - Gray - Dialog blocks (
?!) - Special highlighting - Global IDs (
$object_id) - Distinct color
Smart Indentation
- Automatic indentation for events, control flow, and dialog blocks
- Proper outdenting for
break,done,else, etc. - Configurable through VS Code settings
Code Folding
- Events can be folded for better organization
- Dialog blocks can be folded
- Folding markers:
:event_name(start), empty line (end)
Troubleshooting
Extension Not Loading
- Check that the folder is in the correct extensions directory
- Restart VS Code completely
- Check the Developer Console for errors (
Help > Toggle Developer Tools)
Syntax Highlighting Not Working
- Ensure the file has a
.escextension - Check that the language is set to "ASHES" in the bottom-right corner
- Reload the window (
Ctrl+Shift+P→ "Developer: Reload Window")
Auto-completion Not Working
- Press
Ctrl+Spaceto manually trigger completion - Check that the extension is activated (should show in the Extensions panel)
- Ensure you're typing in a
.escfile
Snippets Not Working
- Make sure you're in a
.escfile - Type the snippet prefix and press
Tab - Check that the language is set to "ASHES"
Performance Issues
- Large files may cause slower auto-completion
- Consider splitting large
.escfiles into smaller ones - Disable other extensions if needed
Advanced Usage
Custom Commands
The extension supports custom commands through the custom() function:
custom("my_custom_command", "param1", "param2")
File Organization
- Use multiple
.escfiles for different scenes/characters - Organize events logically within files
- Use comments to document complex logic
Integration with Escoria
- The extension is designed specifically for the Escoria framework
- Commands correspond to Escoria's ASHES implementation
- Global IDs should match your Escoria project structure
Contributing
To contribute to the extension:
- Fork the repository
- Make your changes
- Test thoroughly with
.escfiles - Submit a pull request
Support
For issues or questions:
- Check this HowTo guide first
- Review the main README.md
- Check the installation guide (INSTALL.md)
- Report issues through the project's issue tracker