To make it more accurate in YAML, a few changes:
* Documents should begin with --- and may end with ...
* Use - to indicate ordered lists.
* a tree structure is achieved by starting the parent node's value with a newline, not a value
* As such, the value should be given a variable, which I will call 'Group Id'
* The linux-friendly id-name (e.g. 'beginstep') can either stay (in which case it'd be largely lost as simply an element) or become a scalar value belonging to a variable.
* Multiline blocks should either use pipe or right angle bracket, depending on if you wish to preserve newlines and spacing, or replace newlines with spaces (e.g. a simple block of quoted text), respectively, and each line of the block should be indented
* To avoid complications with [] and such in code, code should either use the multiline block mentioned above, or single quote the code, doubling any internal single quotes (that is, two single quotes, not a double quote): 'wtf''quote'
---
-beginstep:
Group Id: 3
Group: Step
Name: Begin Step
Mode: Special
Case: 1
-alarm:
Group Id: 2
Group: Alarm
Name: Alarm %1
Mode: Stacked
Sub Check: '{ if ((alarm[%1] == -1) or (alarm[%1]--)) return 0; }'
# Keyboard events. These are simple enough.
-keyboard:
Group Id: 5
Group: Keyboard
Name: Keyboard <%1>
Type: Key
Mode: Stacked
Super Check: keyboard_check(%1)
#...
-step:
Group Id: 3
Name: Step
Mode: Special
Case: 0
Constant: |
{
x += hspeed, y += vspeed;
speed -= friction;
vspeed += sin(gravity_direction * pi/180),
hspeed += cos(gravity_direction * pi/180);
}
#...
-collision:
Group Id: 4
Group: Collision
Name: %1
Type: Object
Mode: Stacked
Super Check: instance_number(%1)
Sub Check: place_meeting(x,y,%1)
...