Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[epScript] Reduce overuse of DoActions in basic actions #9

Open
phu54321 opened this issue Dec 8, 2018 · 0 comments
Open

[epScript] Reduce overuse of DoActions in basic actions #9

phu54321 opened this issue Dec 8, 2018 · 0 comments

Comments

@phu54321
Copy link
Owner

phu54321 commented Dec 8, 2018

Copied from 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.
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant