Skip to content

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 line Dictionary<string, string>, tg = target Chara, pc = player Chara.

Return value behavior:

  • bool + valid jump target โ†’ determines whether to jump.
  • string + jump cell set to eval_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 โ€‹

FunctionCode
Jump to stepDramaExpansion.Goto("my_new_step");
Add "Let's chat!" optionDramaExpansion.InjectUniqueRumor();
Add temporary talkDramaExpansion.AddTempTalk("topic", "actor", "jump");
Get Chara instancevar chara = dm.GetChara("tg");
Recruit to partychara.MakeAlly();
Modify levelchara.SetLv(chara.LV + 5);

Need help? Ask on Elona Discord: @freshcloth or reach via email.

This project is an unofficial documentation site and is not affiliated with, endorsed by, or associated with Elin or Lafrontier / Noa. All trademarks are the property of their respective owners.