Q: data.raw in game and minimap markers

Place to get help with not working mods / modding interface.
Post Reply
osuf
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sun Dec 14, 2014 10:25 am
Contact:

Q: data.raw in game and minimap markers

Post by osuf »

I am happy about how extensive Factorio's scripting functionalities are but I have failed to figure out two issues and would greatly appreciate some pointers.

1. I would like to have (read-only) access to recipes in game, not merely enabling or disabling them. One can access data.raw in a mod's data.lua file but I cannot figure out how to do the same in, say, control.lua. Additionally, io is disabled during the loading phase and the global environment is replaced between loading and playing. I am probably missing something easy. Presently I am preprocessing the data folders but this is not without downsides. Suggestions?

2. Is it possible for entities other than stations and resources to show on the minimap? Named markers like the train stations would be ideal but even colors would do. Adding map_color to containers does not seem to suffice, for instance.

Thanks in advance and looking forward to try all the community content.

User avatar
Xecutor
Filter Inserter
Filter Inserter
Posts: 260
Joined: Mon Jun 23, 2014 10:15 am
Contact:

Re: Q: data.raw in game and minimap markers

Post by Xecutor »

osuf wrote: 1. I would like to have (read-only) access to recipes in game, not merely enabling or disabling them. One can access data.raw in a mod's data.lua file but I cannot figure out how to do the same in, say, control.lua. Additionally, io is disabled during the loading phase and the global environment is replaced between loading and playing. I am probably missing something easy. Presently I am preprocessing the data folders but this is not without downsides. Suggestions?
As far as I know there is no obvious way to pass arbitrary data from data.lua to control.lua
testmod uses styles to pass some data.
For one time dump on mac os or linux you can run executable with output redirection and use default print function.

Post Reply

Return to “Modding help”