5

I am programming a script for my guards, if the guard can't move, make the guard commit suicide, so my system can spawn a new one again.

But how do I do that? It's not listed in the docs. I am looking for something like this:

creep.commitSuicide();
7

New method Creep.suicide() has been added to the API today (changelog).

  • 1
    Does this make it drop energy too? – joppiesaus Dec 1 '14 at 18:26
  • 2
    Yes it does, the behavior is the same as when it's killed. – artch Dec 2 '14 at 8:12
2
creep = null;

This will make the creep "commit suicide" and dropping all it's energy.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.