SCRMaps
/
Sign in

Writing it in Python instead

Using eudplib directly instead of epScript brings Python's own syntax with it.

6 min read

epScript is a language laid on top of eudplib. Go one level down and you use eudplib from Python directly, which brings all of Python with it - lists, dictionaries, functions, modules - for building the map.

Trigger(
    players=[P1],
    conditions=[Accumulate(P1, AtLeast, 50, Ore)],
    actions=[SetResources(P1, Subtract, 50, Ore)],
    preserved=True,
)
The same shape as a classic trigger, produced by Python code.

The confusing part is which code runs when. Python's own if and for run at compile time and decide how many triggers get made. To decide during the game you need eudplib's own - EUDIf, EUDWhile. Mix them up and it compiles and then nothing happens in game.

The library lives under Data/eudplibdata in the euddraft folder. When an argument order is unclear, opening that beats any document - all the more because a call with the arguments in the wrong order compiles quietly.

eudplib: triggers and control flow
Sign in to track your progress