Drama Scripting โ
You can run C# code directly in a drama sheet using the eval action.
It offers the same scripting power as regular CWL, with these differences:
- Script state is tied to the current drama instance (persists until the drama ends, then auto-resets).
- Shortcuts:
dm= DramaManager,line= current lineDictionary<string, string>,tg= targetChara,pc= playerChara.

Return value behavior:
bool+ validjumptarget โ determines whether to jump.string+jumpcell set toeval_resultโ uses the string as the new jump target.- No return value โ treated as a simple action.
Import a script file from the same folder with: <<<script_snippet.cs
Passing Variables โ
Use the shared Script dictionary:
cs
// First eval
var value = EClass.rnd(100) * 5;
Script["random_value"] = value;
// Later eval
var value = (int)Script["random_value"];Common Examples โ
| Function | Code |
|---|---|
| Jump to step | DramaExpansion.Goto("my_new_step"); |
| Add "Let's chat!" option | DramaExpansion.InjectUniqueRumor(); |
| Add temporary talk | DramaExpansion.AddTempTalk("topic", "actor", "jump"); |
| Get Chara instance | var chara = dm.GetChara("tg"); |
| Recruit to party | chara.MakeAlly(); |
| Modify level | chara.SetLv(chara.LV + 5); |
Need help? Ask on Elona Discord: @freshcloth or reach via email.