Page 1 of 1

unit.setcommand()

Posted: Tue Apr 30, 2013 9:57 am
by rk84
Can I has keys of the parameter table for setcommand?

I can't seems to figure out how to give position for gotolocation type command.
Example.

Code: Select all

creep.setcommand({type=defines.command.gotolocation, ?=positiontable, distraction=defines.distraction.byenemy})

Re: unit.setcommand()

Posted: Tue Apr 30, 2013 3:30 pm
by slpwnd
The field name is "destination". I have updated the setcommand description at the wiki: https://forums.factorio.com/wiki/inde ... setcommand

Re: unit.setcommand()

Posted: Tue Apr 30, 2013 4:46 pm
by rk84
slpwnd wrote:The field name is "destination". I have updated the setcommand description at the wiki: https://forums.factorio.com/wiki/inde ... setcommand

haha I tried everything except that. Thanks

Re: unit.setcommand()

Posted: Wed May 01, 2013 4:49 pm
by rk84
eh bad news. Game seems to crash for unknown reason when I try these in console.

Code: Select all

creeper = game.player.character.getselected()

creeper.setcommand({type=defines.command.gotolocation, destination={x=0,y=-40}, distraction=defines.distraction.byenemy})