Search found 101 matches

by betrok
Wed May 16, 2018 9:25 am
Forum: Modding interface requests
Topic: Call LuaLogisticNetwork.get_item_count() without item name
Replies: 3
Views: 1139

Re: Call LuaLogisticNetwork.get_item_count() without item name

I think it will be better to add an optional member argument for get_contents() instead.
by betrok
Tue May 15, 2018 8:01 am
Forum: Mod portal Discussion
Topic: Why does mod portal use Markdown?
Replies: 8
Views: 3007

Re: Why does mod portal use Markdown?

Optera wrote:I was refering to more "advanced" formating like tables with defined text spacing, in line thumbnails or thumbnails as bullet points.
Ok, obviously, we need LaTeX for a brief description of the mod. %)
by betrok
Mon May 14, 2018 5:38 am
Forum: Modding interface requests
Topic: api call to get power drawed from electric network
Replies: 3
Views: 1389

Re: api call to get power drawed from electric network

ownlyme wrote:but you should totally fix that there is no simple way to see if the entity is in a dead electricity network
Eh? There is a way:
Rseding91 wrote:You can simply read entity.energy > 0 to see if it has energy.
Though it will not take into account the priority.
by betrok
Fri May 11, 2018 2:25 am
Forum: Ideas and Suggestions
Topic: Realtime Clock
Replies: 1
Views: 1171

Re: Realtime Clock

What a nice desync source it will be %)
All you need for this case is rcon command in crontab.
by betrok
Fri May 11, 2018 2:14 am
Forum: Modding help
Topic: [Resolved] Connecting and Disconnecting Copper Wires
Replies: 6
Views: 1121

Re: Connecting and Disconnecting Copper Wires - HELP Please

It seems you are doing all this in on build handlers. But do you raise any events when creating hidden poles?
Btw neighbours do not include all possible variants, only already connected ones.
by betrok
Thu May 10, 2018 8:00 am
Forum: Modding help
Topic: How to set up a custom infinite research
Replies: 11
Views: 2651

Re: How to set up a custom infinite research

Villfuk02 wrote:So it looks like I can't access speed or productivity. Is it at least possible to modify a global variable with a research? I could then do some stuff in control.lua
You can se handlers for on_research_finished and on_technology_effects_reset.
by betrok
Wed May 09, 2018 2:41 am
Forum: Resolved Problems and Bugs
Topic: opengl artifacts on water/sand transition
Replies: 8
Views: 2395

Re: opengl artifacts on water/sand transition

Well, your GL driver does not support detecting the amount of VRAM the card has so I assume it's on the driver itself to decide what to do if more is assigned than available. Generally your settings require 3GB VRAM and you need to overwrite the default settings to get this issue in the first place...
by betrok
Wed May 09, 2018 2:31 am
Forum: Modding help
Topic: Increases rates research
Replies: 2
Views: 1193

Re: Increases rates research

For labs and miners you can use "laboratory-productivity" and "mining-drill-productivity-bonus" . With crafting things are more complicated. You can create several prototypes with a single difference in speed and replace old ones on build and finish of research. It's a hacky solu...
by betrok
Sat May 05, 2018 11:26 pm
Forum: Questions, reviews and ratings
Topic: events.on_robot_built_entity
Replies: 2
Views: 1331

Re: events.on_robot_built_entity

Do you really need an accurate player? Why not to use force-wide logic? Anyway something like this could work(untested): function robot_owner(robot) local cells = robot.logistic_network.cells if #cells ~= 1 then return nil end if not cells[1].mobile then return nil end local owner = cells[1].owner i...
by betrok
Sat May 05, 2018 4:08 am
Forum: Implemented Suggestions
Topic: Modding Debug
Replies: 4
Views: 2005

Re: Modding Debug

You can write to the log file with log(). And you actually can throw an error with literally error().
by betrok
Fri May 04, 2018 11:24 pm
Forum: Off topic
Topic: Implementation details on the train pathfinding (same path)
Replies: 2
Views: 1846

Re: Implementation details on the train pathfinding (same path)

I do not know how exactly the pathfinding works in factorio, but basically you have to build the weighted graph from your railroad. The vertexes will represent intersections and possible other notable points such as stops. Weight of the edges can contain length of the section itself and stuff like a...
by betrok
Thu May 03, 2018 3:35 am
Forum: Resolved Problems and Bugs
Topic: [0.16.40] Train signals no longer working
Replies: 33
Views: 16379

Re: [0.16.40] Train signals no longer working

Ok, weird side effect of the signal replacement code snippet, replaced signals can't be removed. On attempt, I get the message: "Enemy structure can't be mined. " I've already edited it, for whoever used command before fix: /c for _, surf in pairs(game.surfaces) do for _, sig in pairs(sur...
by betrok
Thu May 03, 2018 12:03 am
Forum: Resolved Problems and Bugs
Topic: [0.16.40] Train signals no longer working
Replies: 33
Views: 16379

Re: [0.16.40] Train signals no longer working

Command to recreate all signals: /c for _, surf in pairs(game.surfaces) do for _, sig in pairs(surf.find_entities_filtered{name = {"rail-signal", "rail-chain-signal"}}) do local arg = {name = sig.name, position = sig.position, direction = sig.direction, force = sig.force} sig.des...
by betrok
Wed May 02, 2018 11:31 pm
Forum: Modding help
Topic: Iterating through entities in the loaded map
Replies: 2
Views: 1061

Re: Iterating through entities in the loaded map

Iterate over game.surfaces and use find_entities_filtered
by betrok
Wed May 02, 2018 9:33 pm
Forum: Ideas and Requests For Mods
Topic: Trolleys a.k.a. tiny trains
Replies: 17
Views: 3360

Re: Trolleys a.k.a. tiny trains

Deadlock989 wrote:No, not "pretty difficult" - literally impossible.
Well, not impossible. But it requires to implement everything on the lua side -> large codebase and poor performance.
by betrok
Tue May 01, 2018 9:19 am
Forum: Implemented mod requests
Topic: Platform-native JSON parse/encode
Replies: 6
Views: 2864

Re: Platform-native JSON parse/encode

Rseding91 wrote:Why would you ever want to JSON encode/decode inside a mod which is 100% lua?
Because it is more or less standard format for rpc? Although for factorio it's probably better to pass the lua table and eval it.
by betrok
Tue May 01, 2018 9:08 am
Forum: Technical Help
Topic: Version Miss match on a linux server
Replies: 10
Views: 2469

Re: Version Miss match on a linux server

Eh, did you restart server?
by betrok
Tue May 01, 2018 4:10 am
Forum: Resolved Problems and Bugs
Topic: [Rseding91] [for 0.17][0.16.35] Inserting Uranium fuel cell in non reactor fuel slot wrong error
Replies: 5
Views: 2305

Re: [Rseding91] [for 0.17][0.16.35] Inserting Uranium fuel cell in non reactor fuel slot wrong error

The error shows the fuel category name which happens to be chemical for uranium fuel and the error shows the fuel category name not the fuel name. If we made it show the fuel name you'd get the same error when trying to put uranium fuel into the reactor. You could change the fuel category name in t...

Go to advanced search