Page 1 of 1

Create new ore patch command from wiki not working

Posted: Sun Jul 09, 2017 8:16 pm
by marcoevich
I just tried this command from the wiki:

Code: Select all

/c local surface = game.player.surface;
local ore = nil
local size = 5
local density = 10
for y=-size,size do
 for x=-size,size do
  a = (((size+1) - math.abs(x))*10)
  b = (((size+1) - math.abs(y))*10)
  if a < b then
   ore = math.random(((a*density)-(a*(density-8))),((a*density)+(a*(density-8))))
  end
  if b < a then
   ore = math.random(((b*density)-(b*(density-8))),((b*density)+(b*(density-8))))
  end
  surface.create_entity({name="copper-ore", amount=ore, position={game.player.position.x+x, game.player.position.y+y}})
 end
end
It gives me this result:

Image

I first tried with the change of "stone" to "copper-ore". Then I just copied the command from the wiki before taking the screenshot. That command also didn't work.

What is the correct command to create new ore patches?

Edit: I'm using Factorio 0.15.28

Re: Create new ore patch command from wiki not working

Posted: Sun Jul 09, 2017 8:30 pm
by marcoevich
I may have found the cause for this. I open the console with the ` key. The command works when pressing backspace once, just after opening the console. Maybe ` is not a good key for opening the console as it appears to be interferring with the commands?

Re: Create new ore patch command from wiki not working

Posted: Sun Jul 09, 2017 9:04 pm
by Rseding91
Thanks for the report. It looks like you're holding the "`" key down for tool long and it starts typing it in the console.

Re: Create new ore patch command from wiki not working

Posted: Mon Jul 10, 2017 7:33 pm
by marcoevich
This happens even when pressing the key very quickly. I don't think that I'm holding it too long :)

Re: Create new ore patch command from wiki not working

Posted: Mon Jul 10, 2017 8:40 pm
by fakusb
Your keyboard layout may has 'dead keys' activated, so you can press e.g. '`' and then 'e' to type a 'รจ'. The '`' is then 'stored' and either combined with the next letter (if this combination exists) or just emitted right before the next other character.
This may interfere with the copy-paste.

Or maybe not, this is just a guess ;)