Page 1 of 1

Evil Mass cancel

Posted: Sun Sep 11, 2016 8:25 am
by iterat0r
How can I mass cancel deconstruction commands for objects marked for deconstructrion by assholes joining the public server?

Re: Evil Mass cancel

Posted: Sun Sep 11, 2016 10:47 pm
by psznm
the same way you would mark things for deconstruction, except you hold shift.

Re: Evil Mass cancel

Posted: Mon Sep 12, 2016 12:50 am
by noliVe
yes he asked for a command that clears all the marks in one blow on the whole map.

im sorry i have no clue

Re: Evil Mass cancel

Posted: Mon Sep 12, 2016 1:14 am
by Ranakastrasz
Well, Looking at the API, "cancel_deconstruction(force)" for an entity is clearly the way to go. You need to select all entities effected, and apply it. Not sure how to do that part. Not good with command scripts myself.

Re: Evil Mass cancel

Posted: Mon Sep 12, 2016 1:53 am
by Nexela
Prepare for some potential lag while it runs

/c for _, entity in pairs(game.player.surface.find_entities()) do entity.cancel_deconstruction(game.player.force) end

Re: Evil Mass cancel

Posted: Mon Sep 12, 2016 3:54 pm
by iterat0r
Thanks, all your replies are really useful.