That still won't work without "name" and "position" as keys.DaveMcW wrote:Code: Select all
local tiles = {} for x = 1,10 do for y = 1,10 do table.insert(tiles, {"grass",{x,y}} end end set_tiles(tiles)
Search found 947 matches
- Tue Feb 28, 2017 2:20 pm
- Forum: Modding help
- Topic: Set tiles
- Replies: 10
- Views: 3982
Re: Set tiles
- Tue Feb 28, 2017 2:00 pm
- Forum: Modding help
- Topic: Set tiles
- Replies: 10
- Views: 3982
Re: Set tiles
Emmm... using them in cycle will not work? for x = 1,10 do for y = 1,10 do set_tiles({"grass",{x,y}}) end end From LuaSurface::set_tiles : Note: It is recommended to call this method once for all the tiles you want to change rather than calling it individually for every tile. As the tile ...
- Tue Feb 28, 2017 10:31 am
- Forum: Modding help
- Topic: Set tiles
- Replies: 10
- Views: 3982
Re: Set tiles
LuaSurface::set_tiles
Code: Select all
set_tiles{{name="grass",position={1,1}},{name="grass",position={2,2}},{name="grass",position={3,3}}}
- Sun Feb 26, 2017 7:33 pm
- Forum: Modding help
- Topic: if statement syntax
- Replies: 3
- Views: 1011
Re: if statement syntax
Yes.Bizobinator wrote:Is there something wrong with my syntax? Does the if statement have to be outside of the?Code: Select all
data:extend
- Sun Feb 26, 2017 3:39 pm
- Forum: Modding help
- Topic: printing different messages for each player causes desync
- Replies: 15
- Views: 3184
Re: printing different messages for each player causes desync
I'd rather not add to the button spam. there's way too much of that already. Then find a different way of letting players change things around, like a key binding or whatever. The reasoning behind desync for any print function eludes me. That'd mean a whisper message should also cause desync. The m...
- Sun Feb 26, 2017 1:10 pm
- Forum: Modding help
- Topic: printing different messages for each player causes desync
- Replies: 15
- Views: 3184
Re: printing different messages for each player causes desync
Well, having different settings for different people is a great way to cause desyncs, yes. Everyone needs to agree what everyone else is printing to the console. Maybe use an in game GUI that people can click to change their settings in a way that stays synchronized across clients. Then instead of u...
- Sun Feb 26, 2017 9:59 am
- Forum: Technical Help
- Topic: Cannot select sulfuric acid in chemical plant
- Replies: 8
- Views: 2485
Re: Cannot select sulfuric acid in chemical plant
So how about
Loewchen wrote:I assume you started the map with mods. TryKeep in mind that you will not be able to get achievements from now on.Code: Select all
/c game.forces.player.recipes["sulfuric-acid"].enabled=true
If this does not do it, post the save.
- Thu Feb 23, 2017 7:51 pm
- Forum: Modding help
- Topic: Desync only on Modded Multiplayer - Unknown Cause
- Replies: 11
- Views: 4121
Re: Desync only on Modded Multiplayer - Unknown Cause
Code: Select all
__Oreverhaul__/control.lua:2:
__Oreverhaul__/functions.lua:2:
__Oreverhaul__/oreplacement.lua:1:
__Oreverhaul__/constants.lua:40:
attempt to index global 'game' (a nil value)
- Thu Feb 23, 2017 4:28 pm
- Forum: Modding help
- Topic: No such node (direction_count)
- Replies: 12
- Views: 3527
Re: No such node (direction_count)
layers needs to be a table of tables. You're just missing some {}.
- Tue Feb 21, 2017 10:49 pm
- Forum: Technical Help
- Topic: Observer mode in Multiplayer
- Replies: 2
- Views: 1516
Re: Observer mode in Multiplayer
Something like
(adjust player numbers to taste)
Code: Select all
/c game.player.character=nil script.on_event(defines.events.on_tick, function(event) game.players[2].teleport(game.players[1].position) end)
- Tue Feb 21, 2017 9:13 am
- Forum: Modding help
- Topic: Desync only on Modded Multiplayer - Unknown Cause
- Replies: 11
- Views: 4121
Re: Desync only on Modded Multiplayer - Unknown Cause
This already breaks in single player after a few seconds with
(when commenting out the modded ores so it starts at all.)
Code: Select all
Error while running event on_chunk_generated (ID 12)
__Oreverhaul__/functions.lua:178: bad argument #1 to 'pairs' (table expected, got nil)
- Sat Feb 18, 2017 6:18 pm
- Forum: Modding help
- Topic: Missing Recipe Errors
- Replies: 8
- Views: 3116
Re: Missing Recipe Errors
Don't. This will only cause sadness when updating the game or trying to play with other people. Make a mod and set stuff to nil that you don't want to see in the game anymore.Proxy wrote:Yes.prg wrote:You modified the base game files?Proxy wrote:I already Removed it from all of those Files.
- Fri Feb 17, 2017 5:54 pm
- Forum: Modding help
- Topic: Missing Recipe Errors
- Replies: 8
- Views: 3116
Re: Missing Recipe Errors
You modified the base game files?Proxy wrote:I already Removed it from all of those Files.
- Fri Feb 17, 2017 5:49 pm
- Forum: Modding help
- Topic: Multiply / divide recipe ingredients
- Replies: 7
- Views: 2462
Re: Multiply / divide recipe ingredients
You just use ingredient.amount instead of ingredient[2] in the second case.
Try math.floor() for the conversion problem.
Try math.floor() for the conversion problem.
- Thu Feb 16, 2017 1:08 pm
- Forum: Multiplayer
- Topic: How to disable desync reports?
- Replies: 17
- Views: 4851
Re: How to disable desync reports?
How about you fix the cause of the desync then? If it's caused by the base game, file a bug report. If it's caused by a mod, complain to the author. If it's caused by a piece of code you wrote yourself and have no idea how to fix it, ask in the modding help forum. If you could disable desync reports...
- Sun Feb 12, 2017 10:53 pm
- Forum: Technical Help
- Topic: AssignID error
- Replies: 9
- Views: 4745
Re: AssignID error
Unzip all the mods and search for the string "xlarge-equipment-grid". It must be mentioned somewhere.
- Sun Feb 12, 2017 5:39 pm
- Forum: Resolved Problems and Bugs
- Topic: [0.14.22] Crash in scenario
- Replies: 5
- Views: 6376
Re: [0.14.22] Crash in scenario
If your shitty code results in a segfault/assertion failure/uncaught exception/anything else that produces a stack trace, file a bug report.Chocolatetthunder wrote:wow that is crazy, here i was not wanting to post bugs from the scenario because I thought it was just some shitty code we wrote.
- Sun Feb 12, 2017 12:17 pm
- Forum: Technical Help
- Topic: AssignID error
- Replies: 9
- Views: 4745
Re: AssignID error
In a temporary directory, do the Windows equivalent of
Code: Select all
for mod in /path/to/factorio/mods/*.zip; do unzip "$mod"; done >/dev/null; grep xlarge-equipment-grid -r .
- Sat Feb 11, 2017 11:27 am
- Forum: Modding help
- Topic: Missing Recipe Errors
- Replies: 8
- Views: 3116
Re: Missing Recipe Errors
i can't find anything called "low-density-structure" ANYWHERE in any file... is it hard-Coded? data/base/prototypes $ grep -n low-density-structure -r . ./item/item.lua:781: name = "low-density-structure", ./item/module.lua:116: "low-density-structure", ./technology/te...
- Wed Feb 08, 2017 10:44 pm
- Forum: Modding help
- Topic: Needing some help with control.lua.
- Replies: 11
- Views: 4469
Re: Needing some help with control.lua.
Code like
is simply the easiest way of iterating over all elements of a table. This is the normal way in Lua. There's also a numerical for loop, but it doesn't make this any easier.
Code: Select all
for key, value in pairs(some_table) do ... end