Skip to content
This repository was archived by the owner on Dec 8, 2018. It is now read-only.
This repository was archived by the owner on Dec 8, 2018. It is now read-only.

Reduce overuse of DoActions in basic actions #5

@armoha

Description

@armoha
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.
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()
*/

It should use 1 DoActions in a series of actions for performance and map file size.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions