Copied from phu54321/eudplib#9 and phu54321/epScript#5
function afterTriggerExec() {
while(Bring(P1, AtLeast, 1, "Zerg Drone", "Anywhere")) {
MoveLocation("loc", "Zerg Drone", P1, "Anywhere");
RemoveUnitAt(1, "Zerg Drone", "loc", P1);
CreateUnit(1, "Zerg Mutalisk", "loc", P1);
}
}
/* __epspy__ makes 3 Triggers for 3 actions, 2 objects are wasted.
It should use 1 DoActions in a series of actions for performance and map file size.
def afterTriggerExec():
if EUDWhile()(Bring(P1, AtLeast, 1, "Zerg Drone", "Anywhere")):
DoActions(MoveLocation("loc", "Zerg Drone", P1, "Anywhere"))
DoActions(RemoveUnitAt(1, "Zerg Drone", "loc", P1))
DoActions(CreateUnit(1, "Zerg Mutalisk", "loc", P1))
EUDEndWhile()
*/
We had partial success on optimizing if block by armoha/eudplib@dfc2569 since euddraft 0.9.3.3. But optimizing trigger actions will improve much more performance than conditions. Unlike conditionals, this is hard to resolve in eudplib so fixing epScript compiler to recognize basic actions to merge would be a way to go.
Stepwise tasks from easiest to hardest one.
Related parser rule:
https://github.com/armoha/eudplib/blob/855a4e8c97b57f4bb432787ef28f05d77d669287/eudplib/epscript/cpp/parser/epparser.lemon#L1193-L1197
Copied from phu54321/eudplib#9 and phu54321/epScript#5
We had partial success on optimizing
ifblock by armoha/eudplib@dfc2569 since euddraft 0.9.3.3. But optimizing trigger actions will improve much more performance than conditions. Unlike conditionals, this is hard to resolve ineudplibso fixingepScriptcompiler to recognize basic actions to merge would be a way to go.Stepwise tasks from easiest to hardest one.
ConstExpr. (example:var += 1; array[0] = 2; SetMemory(db, SetTo, 3);)SeqComputeorVProcif possible.It would be impossible to optimize any
epScriptcode which importeudplibmodule so there should be a way to define and use custom action inepScript.Related parser rule:
https://github.com/armoha/eudplib/blob/855a4e8c97b57f4bb432787ef28f05d77d669287/eudplib/epscript/cpp/parser/epparser.lemon#L1193-L1197