unit.setcommand()

Place to get help with not working mods / modding interface.
User avatar
rk84
Filter Inserter
Filter Inserter
Posts: 556
Joined: Wed Feb 13, 2013 9:15 am
Contact:

unit.setcommand()

Post 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})
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela

slpwnd
Factorio Staff
Factorio Staff
Posts: 1835
Joined: Sun Feb 03, 2013 2:51 pm
Contact:

Re: unit.setcommand()

Post by slpwnd »

The field name is "destination". I have updated the setcommand description at the wiki: https://forums.factorio.com/wiki/inde ... setcommand

User avatar
rk84
Filter Inserter
Filter Inserter
Posts: 556
Joined: Wed Feb 13, 2013 9:15 am
Contact:

Re: unit.setcommand()

Post 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
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela

User avatar
rk84
Filter Inserter
Filter Inserter
Posts: 556
Joined: Wed Feb 13, 2013 9:15 am
Contact:

Re: unit.setcommand()

Post 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})
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela

Post Reply

Return to “Modding help”