Version: 1.0.1
Purpose: SDL (Spell Description Language) is a procedural extension language for creating, manipulating, and maintaining magical effects in a tabletop RPG or fantasy environment. Each spell script consists of lines (or operators), which together form a dynamic magical effect.
SDL scripts are composed of operators (keywords) and arguments. Operators include words
such as create, move, if, then, else, repeat,
until, interrupt, bind, and so on. Arguments typically indicate what to create, where
to move an effect, and any relevant distances or shapes.
SDL is case-insensitive in its keywords, but examples typically use lowercase for operators
(e.g., create Fire). Whitespace and line breaks separate operators; each new operator generally occupies a
new line. Operators such as if...then...else or repeat...until can be written in block form
with indentation for clarity, though indentation is not strictly required.
Classic SDL does not specify a formal comment syntax. If you adopt a house-ruled version, you might designate lines
beginning with # or // as comments. Otherwise, textual commentary is not recognized by the parser.
An SDL script must begin with a spell name, followed by a colon (:). This identifier labels
the spell for reference in advanced operations (e.g., interrupt).
firewall:
create Fire
...
Syntax:
<spellname>:
where <spellname> is an alphanumeric identifier (e.g., “torch”, “boltbox”, etc.).
Following the spell name, each line contains exactly one operator, plus any arguments. Certain operators
(if, repeat) may contain nested operators. The script processes lines in sequence
unless altered by flow control operators.
When a script is cast, SDL parses and executes each line from top to bottom. Operators like wait,
if, and repeat can alter the sequence or timing of execution.
An effect is the fundamental magical phenomenon manipulated by SDL. It might be elemental (e.g., Fire, Water) or
arcane (e.g., Illusion, Darkness). You typically use create <effect> to initialize it, then manipulate it
with other operators (move, scale, etc.).
Events are conditions or triggers that can suspend or redirect spell flow. Examples: an orc approaching, a phrase spoken, or
the script being interrupted. In SDL, events follow a format such as:
<object> <action> <proximity>
<object> "<phrase>" <proximity>
For instance, orc "help" 30' triggers if an orc says “help” within 30 feet.
Basic operators create or directly manipulate an effect. Each operator typically occupies one line.
createcreate <effect> [<name>]
create Fire myflame
This creates a fire effect labeled "myflame."
destroydestroy [<name>]
destroy myflame
movemove [<name>] to <distance> pointdir
move [<name>] to lookat <target>
move [<name>] to <x>x <y>y <z>z
move myflame to lookat orc
move myflame to 10' pointdir
move myflame to 5'x 10'y 15'z
rotaterotate [<name>] <ang>x <ang>y <ang>z [origin <reference>]
lookat orc).rotate firewall 90y origin lookat orc
scalescale [<name>] <x>x <y>y <z>z
scale myflame 2'x 2'y 2'z
shapeshape [<name>] <pathop1>
[<pathop2>]
...
lineto,
fill, volume, etc.). When shape is applied, any prior scaling or shaping is overridden
by the new form, though position is retained.shape mywind
surface 1'thick lookat chest
These operators must be used inside a shape block to define geometry.
linetolineto <thickness>thick <distance> pointdir [smooth]
lineto <thickness>thick lookat <object> [smooth]
lineto <thickness>thick trace
lineto 2"thick 10' pointdir
fillfill
lineto commands in the shape block.surfacesurface <thickness>thick [lookat] <object>
volumevolume [lookat] <object>
halthalt
if...then...elseif <eventop1>
[<eventop2>]
...
then
<operator1>
[<operator2>]
...
[else
<operator1>
...
]
else block otherwise.if (orc "charge" 20')
then create Electricity
else create Fire
repeat...untilrepeat
<operator1>
[<operator2>]
...
until <eventop1>
[<eventop2>]
...
waitwait <time>
wait until <eventop1>
[<eventop2>]
...
wait 10 sec
wait until orc "bang" 10'
SDL can detect real-time events (e.g., creatures speaking, movement within a radius, or interrupted conditions)
and respond via conditionals.
and, or, not)These are used to combine event checks. For instance:
(man "help" 10') and (kobold "go" 10')
interruptedif interrupted [by <being>]
then ...
Triggers if the current spell has been forcibly changed via interrupt.
<object> <action> <proximity>
<object> "<phrase>" <proximity>
Where object is any creature or effect, action is an observable event (e.g., “move,” “charge,” “attack,” or saying "phrase"), and proximity is a distance or range expression (e.g., “10'”).
These advanced commands allow for binding spells to objects, transferring ownership, or dynamically adjusting power and range.
bindbind [<spellname>] to touch <object>
range or location are relative to that object rather than
the caster’s position.interruptinterrupt <spellname> at "<breakpoint>" [revert]
<operator1>
[<operator2>]
...
makeownermakeowner <spellname> touch <newcaster>
range / powerrange <spellname> <mult>
power <spellname> <mult>
resumeresume [<spellname>] at "<breakpoint>"
interrupt.
Often used in conjunction with if interrupted checks.
Each operator line typically costs 1 resource unit (e.g., 1 spell point) when the spell is cast. The total
lines in the script equal the total cost, though some lines (like <spellname>:) may be free or cost
adjusted, depending on the exact house rules.
If a script persists indefinitely (e.g., via repeat with no exit condition), those resources stay
allocated until the spell ends.
A script runs until all lines have executed or a halt is reached. If a repeat loop is used, it
may continue for as long as conditions dictate. Typically, the caster must remain within range unless the spell
is bind to an object or location.
When an SDL effect inflicts damage or a detrimental condition, targets typically make saving throws appropriate to the effect (e.g., DEX, CON, WIS), per the game system’s rules.
torch:
bind to touch staffend
create Fire
scale 1"x 1"y 1"z
repeat
move to staffend
wait 6 sec
until me "off"
Explanation: Binds the script to a staffend, creates a small flame, and repeatedly repositions it at the staff’s tip every 6 seconds. It ends when the caster says “off.”
firewall:
create Fire myflame
move myflame to 30' pointdir
shape myflame
lineto 10' pointdir
fill
scale myflame 10'x 10'y 1"z
wait 3 rounds
destroy myflame
Explanation: Creates a firewall 10 feet high and 10 feet wide, sustaining it for 3 rounds before destroying it.
boltbox:
bind to touch crate
repeat
if (orc or kobold) 30'
then if orc 30'
then create Fire bolt
move bolt to lookat orc
scale bolt 1'x 1'y 1'z
else create Electricity bolt
move bolt to lookat kobold
scale bolt 1'x 1'y 1'z
wait 2 sec
destroy bolt
wait 1 sec
until me "off"
Explanation: Any time an orc or kobold approaches within 30 feet of the bound crate, the script creates a bolt of either Fire or Electricity, launches it, then destroys the bolt after 2 seconds. The loop continues until the caster ends it.
End of SDL Reference Manual.
This manual outlines the syntax, operators, and structures used to create spells in the Spell Description Language, allowing flexible, event-driven magic with procedural shaping and real-time alterations.