A real map script gets by on var and function alone, but open the official compiler tests and the declaration syntax in use is wider. These are also the places where somebody else's code stops making sense.
| static var x = 0; | Keeps its value between calls even inside a function. x.getValueAddr() gives the address the value lives at. |
|---|---|
| var B: Upgrade = "Terran Infantry Weapons"; | With a type annotation you can assign by name string. |
| function f(): EUDArray { } | Annotate the return type. |
| function f(x) : None; | A bodiless declaration: announce the name first when no ordering works. |
| function f(fn: EUDFuncPtr(0, 0)) | Take a function as an argument; an anonymous function can be passed straight in. |
import brings in both other .eps files beside yours and the Python modules in euddraft's lib folder. A leading dot makes it relative to this file, and you can pull in a single name. Two modules importing each other is allowed.
import unitlooper; // 이름 그대로 import customText as ct; // 짧은 이름으로 import .helpers; // 같은 폴더의 helpers.eps import .report.C240903; // 하위 폴더의 한 모듈 import .other.SOME_CONST; // 모듈에서 이름 하나만
py_eval runs Python at compile time and hands back the result. It is computed once while building, not while the map runs, which makes it the way to build a constant table or bake in a build date.
const receives = py_eval('[PVariable() for _ in range(8)]');
import py_datetime;
const stamp = py_eval("int(datetime.datetime.strptime('2026-01-01 00:00:00', '%Y-%m-%d %H:%M:%S').timestamp())");
if (Memory(0x6D0F38, AtLeast, stamp)) { /* 만료 / expired */ }If you write a function whose own name starts with py_, you have to call it as py_py_whatever. The compiler uses the py_ prefix as the doorway to Python.
| 예약어 | static var const object this function return for foreach while switch epdswitch break continue if else once import as true false |
|---|---|
| 파이썬 예약어도 금지 | Variable and constant names also cannot be Python 3 keywords - None, class, lambda, pass and the rest. |
| 한글 이름 | Identifiers do not have to be ASCII: a Korean variable name works as it stands. |
| 15 · 0xf · 0b1111 | Decimal, hexadecimal and binary - all the same number. |
|---|---|
| b"ASCII" · b'ASCII' | A byte literal. It does not end with a \0. |
| $T("sound\\Misc\\PError.WAV") | Makes a map string - what you use for something handed to the game, such as a sound path. |
There are data structures too. EUDQueue(n)() and EUDDeque(n)() have .length and .append(x), and something like PVariable(list(...)) can be created with initial values. Compound assignment on an array element - %=, &=, ^=, |=, <<= - works as written.
