Create new ore patch command from wiki not working

Bugs that are actually features.
Post Reply
marcoevich
Inserter
Inserter
Posts: 23
Joined: Sat Jun 24, 2017 3:02 pm
Contact:

Create new ore patch command from wiki not working

Post 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

marcoevich
Inserter
Inserter
Posts: 23
Joined: Sat Jun 24, 2017 3:02 pm
Contact:

Re: Create new ore patch command from wiki not working

Post 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?

Rseding91
Factorio Staff
Factorio Staff
Posts: 13247
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Create new ore patch command from wiki not working

Post 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.
If you want to get ahold of me I'm almost always on Discord.

marcoevich
Inserter
Inserter
Posts: 23
Joined: Sat Jun 24, 2017 3:02 pm
Contact:

Re: Create new ore patch command from wiki not working

Post by marcoevich »

This happens even when pressing the key very quickly. I don't think that I'm holding it too long :)

fakusb
Manual Inserter
Manual Inserter
Posts: 3
Joined: Wed Jul 05, 2017 4:40 pm
Contact:

Re: Create new ore patch command from wiki not working

Post 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 ;)

Post Reply

Return to “Not a bug”