euddraft Reference
Reference:
http://www.staredit.net/topic/17037/
Basic configuration
-
Create a configuration file with the extension .eds/.edd
.eds format means it will be compiled only once .edd format means it will run in daemon mode, monitoring the project and automatically recompiling whenever files in the current directory change[main]input : Enter the file name of the input map hereoutput : Enter the file name of the output map here[Plugin name 1]:: Plugin input parametersKey 1 : Value 1Key 2 : Value 2[Plugin name 2]:: If the plugin has no parameters, nothing needs to be written[Plugin name 3] -
Compile using the configuration in the configuration file
Possible usages are:euddraft.exe Config-file.edsOr like this:
euddraft.exe Config-file.edd -
On success, the output map will be generated; on failure, error messages will be displayed.
euddraft has built-in several plugins[dataDumper]:: ZergAI.bin will be transferred to memory location 0x68C104ZergAI.bin : 0x68C104, copy[unlimiter]:: Remove bullet limit, no parameters required[eudTurbo]:: Greatly reduce the trigger polling interval to accelerate EUD polling[MSQC]:: Many parameters, hard to explain briefly[freeze]freeze : false
Script/Plugin Writing
euddraft uses scripts to write EUD triggers. There are two ways to write scripts:
One is to use Python pseudo-syntax to call eudplib directly
The other is to use epScript, which is specifically designed for this purpose (it will be compiled into Python pseudo-syntax and ultimately also calls eudplib to complete the work)
-
Python Pseudo-Syntax
from eudplib import *# Variable definition.a = EUDVariable() # Create a reference to a variable that can be used in Starcraft, with an initial value of 0b = EUDVariable(1) # Create a reference to a variable that can be used in Starcraft, with an initial value of 1# IMPORTANT : Every variable is static.c = a + b # Create a reference to a variable that can be used in Starcraft with the result of a + b, and assign it to cc << a * b # Assign the value of a * b to the variable referenced by c, not to c itself, but to the variable referenced by c# Almost every C operator works here too, with division being // instead of /# -----------------------------------------------------------------------------# Ifif EUDIf()([cond1, cond2, cond3]):pass # Codeif EUDElseIf()(cond4):pass # codeif EUDElse()():passEUDEndIf()# While / LoopNif EUDWhile()(conds):pass # CodeEUDEndIf()# EUDLoopListfor ptr, epd in EUDLoopList(ptr):pass# EUDLoopRangefor i in EUDLoopRange(0, 100):pass# EUDLoopUnitfor ptr, epd in EUDLoopUnit():pass# EUDLoopUnit2for ptr, epd in EUDLoopUnit2():pass# EUDLoopCUnitfor cunit in EUDLoopCUnit():pass# EUDLoopNewUnitfor ptr, epd in EUDLoopNewUnit():pass# EUDLoopNewCUnitfor cunit in EUDLoopNewCUnit():pass# EUDLoopPlayerUnitfor ptr, epd in EUDLoopPlayerUnit(player):pass# EUDLoopPlayerCUnitfor cunit in EUDLoopPlayerCUnit(player):pass# Break & Continue# While / LoopNif EUDWhile()(conds):EUDBreak() # Break outEUDBreakIf(cond) # Break ifEUDContinue() # Goto continue pointEUDContinueIf(cond) # Continue if# Some codesEUDSetContinuePoint() # Here is continue point.# Do some i++ thing herepass # CodeEUDEndWhile() # NOT EUDEndIf# there's also EUDWhileNot, EUDIfNot, EUDBreakIfNot, EUDContinueIfNot etc.if EUDLoopN()(100):pass # codeEUDEndLoopN()if EUDPlayerLoop()():pass # codeEUDEndPlayerLoop()EUDSwitch(variable) # OR EPDSwitch(epd_address)# you can add bitmask on EUDSwitch too: like EUDSwitch(variable, 0xFF)if EUDSwitchCase()(0):pass # codeEUDBreak()if EUDSwitchCase()(1, 2):pass # codeEUDBreak()if EUDSwitchCase()(3, 4, 5, 6):pass # codeEUDBreak()EUDEndSwitch()# Function definition. no recursion allowed@EUDFuncdef funcname(arg1, arg2):# Use arguments to do stuff.# All arguments are EUDVariable type# EUDReturn to return valueEUDReturn(arg1 + arg2)# Legacy support, but use this only on the very end of the function.return arg1 + arg2# -----------------------------------------------------------------------------# Resource declarationa = Db(4) # Create empty space with size 4bytea = Db(b'\x04\x01\x06\x08') # Create memory with initial value 04 01 06 08 -
epScript
Running Mode
Script File Extension Differences
-
For
.pyformat scripts, the file extension can be omitted in the .eds/.edd file..epsformat scripts must include the extension.[main]input: basemap.scxoutput: outputmap.scx[eudTurbo]:: It actually loads a script named eudTurbo.py[main.eps]:: Load it like this if it is .eps format
Load Order
-
The order of plugin names in the configuration file determines their loading order after the game starts. After the game starts, onPluginStart() in the script will be executed once, and beforeTriggerExec(), triggers, and afterTriggerExec() will be executed cyclically on all players' machines.
For example, with the following main.edd configuration:
[main]input: in.scxoutput: out.scx[eudTurbo][a.eps][b.eps]The execution order after the game starts is:
eudTurbo.onPluginStart()a.onPluginStart()b.onPluginStart()Executed cyclically every frame:eudTurbo.beforeTriggerExec()a.beforeTriggerExec()b.beforeTriggerExec()SCMD triggersb.afterTriggerExec()a.afterTriggerExec()eudTurbo.afterTriggerExec()