Search found 344 matches

by eduran
Sat Jun 08, 2019 10:37 am
Forum: Mods
Topic: [MOD 0.16] Miniloader
Replies: 395
Views: 158731

Re: [MOD 0.16] Miniloader

I have tried placing belts after them but the ore still doesn't get taken off the train. From the looks of it, the train is not properly parked at a station. If it were, the cargo wagons should be open. Check if the train is in manual mode. One thing I don't get in this: Why is there no ore on the ...
by eduran
Sat Jun 08, 2019 10:32 am
Forum: Modding help
Topic: Dependencies: Are "optional requirements" possible at all?
Replies: 51
Views: 8875

Re: Dependencies: Are "optional requirements" possible at all?

Speaking of which: I've sometimes seen loops such as for _, x in pairs() … I assume "_" was used because you technically need 2 variables but only really care for the second value. In other words, "_" would not be a special variable name but rather a conventional name agreed upo...
by eduran
Sat Jun 08, 2019 8:14 am
Forum: Modding help
Topic: Dependencies: Are "optional requirements" possible at all?
Replies: 51
Views: 8875

Re: Dependencies: Are "optional requirements" possible at all?

Strange, can't reproduce that anymore. Anyway, wouldn't trying to access an element of an empty table (e.g. extract player from game.connected_players and check player.admin) give some error? Depends on how you access the element. local empty_table = {} -- not a problem, because loop body does not ...
by eduran
Fri Jun 07, 2019 5:15 pm
Forum: Modding help
Topic: Change color of rails on map
Replies: 8
Views: 1261

Re: Change color of rails on map

eradicator wrote:
Fri Jun 07, 2019 10:14 am
Try shifting the center of your entity 1/256'th of a tile southwards. Not sure how "off grid" entities behave with map colors...
Tried that, but to no effect. Now I am curious: why 1/256th of a tile?
by eduran
Fri Jun 07, 2019 7:43 am
Forum: Modding help
Topic: Change color of rails on map
Replies: 8
Views: 1261

Re: Change color of rails on map

You could try setting an empty collosion_mask so it doesn't actually collide with anything even if it has a box. Thanks, that works. Weirdly, my test entity can cover curved rails on the map, but not straight rails. No matter what I use as entity type, straight rails beat all of them. The only exce...
by eduran
Fri Jun 07, 2019 7:43 am
Forum: Modding interface requests
Topic: LuaRendering.draw_on_map
Replies: 21
Views: 7875

LuaRendering support for (mini-)map

I would like the ability to draw shapes on the map, similar to what LuaRendering does for the normal view. Maybe via a draw_on_map flag specified at creation.

Why? To show info overlays on the map, for example average train speed on rails as color-coded lines.
by eduran
Fri Jun 07, 2019 5:49 am
Forum: Modding help
Topic: Dependencies: Are "optional requirements" possible at all?
Replies: 51
Views: 8875

Re: Dependencies: Are "optional requirements" possible at all?

Pi-C wrote:
Thu Jun 06, 2019 10:28 pm
game.connected_players doesn't seem to exist in singleplayer mode.
When I test it in singleplayer it works and returns a table with one player, myself.
by eduran
Thu Jun 06, 2019 8:52 pm
Forum: Implemented mod requests
Topic: Add pressed attribute to GuiElement
Replies: 5
Views: 1670

Re: Add pressed attribute to GuiElement

Rseding91 wrote:
Thu Jun 06, 2019 3:10 pm
That's exactly how the base game does it: on selection change the style.
Why do button styles have a selected_graphical_set if it isn't used in the base game?
by eduran
Thu Jun 06, 2019 8:44 pm
Forum: Ideas and Requests For Mods
Topic: spaced railsignal placer
Replies: 2
Views: 1116

Re: spaced railsignal placer

Have a look at https://mods.factorio.com/mod/RailTools. It does a pretty good job of placing evenly spaced signals and creating exit blocks after chain signals.
by eduran
Thu Jun 06, 2019 8:42 pm
Forum: Modding help
Topic: Dependencies: Are "optional requirements" possible at all?
Replies: 51
Views: 8875

Re: Dependencies: Are "optional requirements" possible at all?

if type(admin) == "table" then You don't have to check the type of admin, just if it was passed to the function: if admin then -- good enough to figure out if the argument was passed You could also do something like this in on nth-tick: for _, player in pairs(game.connected_players) do if...
by eduran
Thu Jun 06, 2019 4:56 pm
Forum: Modding help
Topic: Change color of rails on map
Replies: 8
Views: 1261

Re: Change color of rails on map

That sounds like you only want to recolor *some* rails? Because recoloring them all individually dynamically would clearly be unreasonable :p. Yes, just some and in 3-4 different colors. I am aware that any attempt to recolor large numbers of rails dynamically would be a performance hog. Depending ...
by eduran
Thu Jun 06, 2019 2:26 pm
Forum: Modding help
Topic: Storing/Retrieving time resolved data
Replies: 3
Views: 821

Re: Storing/Retrieving time resolved data

Thank you, some good ideas. So this is what I came up with: local function new_flow(bin_length, bin_count) return { bin_length = bin_length, bin_count = bin_count, data = {}, sample_count = {}, } end local function add(flow, key, amount) local timestamp = math.floor(game.tick / flow.bin_length) flow...
by eduran
Thu Jun 06, 2019 2:11 pm
Forum: Modding help
Topic: Change color of rails on map
Replies: 8
Views: 1261

Change color of rails on map

I'd like to change the color of rails on the map during the control stage. I know that map_color is set at the data stage, so my plan was to define one prototype for each color and switch them out as needed. However, rail entities ignore map_color properties and use the utility-constant chart.rail_c...
by eduran
Thu Jun 06, 2019 10:40 am
Forum: Modding help
Topic: How to Create Option Buttons
Replies: 2
Views: 806

Re: How to Create Option Buttons

To get started, have a look at the documentation for LuaGuiElement and LuaGui. With that, try to understand what is happening in some mods with GUIs. I found NewGame+ reasonable easy to understand. Once you have specific questions come back here.
by eduran
Wed Jun 05, 2019 7:32 pm
Forum: Modding help
Topic: Dependencies: Are "optional requirements" possible at all?
Replies: 51
Views: 8875

Re: Dependencies: Are "optional requirements" possible at all?

Uhu. That is interesting. Does that also happen when the host is not game.players[1]? I.e. when you give the savegame to someone else to host it. My statement was not quite accurate. on_player_joined_game is not triggered when the player who saved the game also loads it as the host (same as in sing...
by eduran
Wed Jun 05, 2019 6:21 pm
Forum: Logistic Train Network
Topic: Balancing stations
Replies: 5
Views: 2044

Re: Balancing stations

alercah wrote:
Wed Jun 05, 2019 6:06 pm
Oldest meaning the one that was built first, or the one that's hard longest since a delivery?
Age is set to the time when the request first shows up and reset every time when a delivery is dispatched. So it means longest time since last delivery.
by eduran
Wed Jun 05, 2019 6:16 pm
Forum: Modding help
Topic: Storing/Retrieving time resolved data
Replies: 3
Views: 821

Storing/Retrieving time resolved data

I would like to store time-stamped key-value pairs and be able to retrieve average values for arbitrary time intervals. Example: Read the amount of copper ore in a certain chest once a second and store it. An hour later I want to know what the average amount of copper ore was during every minute of ...
by eduran
Wed Jun 05, 2019 5:58 pm
Forum: Modding help
Topic: Dependencies: Are "optional requirements" possible at all?
Replies: 51
Views: 8875

Re: Dependencies: Are "optional requirements" possible at all?

A couple of notes on the different startup events and how they behave in multiplayer vs singleplayer: on_configuration_changed: runs for every mod whenever mod configuration, any mod version, the game version or startup settings change. In MP, it will only ever run for the host/server. Players join ...
by eduran
Wed Jun 05, 2019 7:09 am
Forum: Modding help
Topic: mouse_button_filter doesn't work?
Replies: 7
Views: 882

Re: mouse_button_filter doesn't work?

Code: Select all

my_button.mouse_button_filter = {"left-and-right", "middle", "button-4"}
by eduran
Tue Jun 04, 2019 6:49 pm
Forum: Modding discussion
Topic: Fixing data stage spam
Replies: 39
Views: 10435

Re: Fixing data stage spam

Mods spamming the log file are annoying for sure, but any solution to that would also hit responsible mod authors who deactivate logging for their release builds. Also, out of curiosity: why is it only data-stage spam that you are worried about and not control stage logging? If you do change it, I v...

Go to advanced search