Page 1 of 1

Most used console commands?

Posted: Mon Aug 24, 2015 8:28 am
by Peter34
I know I've asked this before, but I didn't archive the answers properly.

This time I promise I'll do that...

What is the console command to give an item, or a quantity of a particular item, to one self?

And what is the console command to disable or enable peaceful mode? And is there a console command to check what the mode is without altering it?

Also, are there any other highly useful, widely used console commands, that warrant inclusion into an Unofficial FAQ? I'm unhappy with the existing official one here on these forums, so I plan on writing, publishing and maintaining an unofficial one, but I don't want to include 20-30 different console commands. Only the very most useful.

Re: Most used console commands?

Posted: Mon Aug 24, 2015 9:07 am
by Smarty

Re: Most used console commands?

Posted: Mon Aug 24, 2015 9:15 am
by Peter34
Thanks at lot, that article is much shorter than I expected! Packed with goodies!

It doesn't seem to contain a console command to inquire as to whether peaceful_mode is on or off.

Re: Most used console commands?

Posted: Mon Aug 24, 2015 11:45 am
by FishSandwich
Peter34 wrote:It doesn't seem to contain a console command to inquire as to whether peaceful_mode is on or off.

Code: Select all

/c game.player.print(game.peaceful_mode)
or something similar should do it.

Re: Most used console commands?

Posted: Mon Aug 24, 2015 1:19 pm
by DaveMcW
player.print() can't handle booleans, you need to convert it first.

Code: Select all

/c game.player.print(tostring(game.peaceful_mode))

Re: Most used console commands?

Posted: Mon Aug 24, 2015 2:17 pm
by Peter34
Thanks!

I remember the Factorio Wiki had an article containing all the console names for items, but I've been unable to re-find it. Sometimes the console name for items are what you'd assume they are, like iron-plate, but not in all cases, so that page was very useful. Anyone have a link?

Re: Most used console commands?

Posted: Tue Aug 25, 2015 7:51 am
by Peter34
Peter34 wrote:Thanks!

I remember the Factorio Wiki had an article containing all the console names for items, but I've been unable to re-find it. Sometimes the console name for items are what you'd assume they are, like iron-plate, but not in all cases, so that page was very useful. Anyone have a link?
I found it: https://forums.factorio.com/wiki/inde ... e=Data.raw