Strange. Could have sworn I posted this, but now I can't find my post. Quite frustrating, since I spent so much time on it. Oh well, guess I'll have to write it again. I hope this is in the right place, if not please feel free to move it elsewhere.
These are a few API changes that I, personally, would find quite useful. Most are things others have already requested, but here I would like to explain in more detail why, at least for me, they would be useful and some ways to perhaps implement them. There are some ways to work around the lack of these API, but not all of them can be worked around nor are any of the solutions elegant. There are a few mods that people have requested that I would be happy to explore, and some of them I might work on anyway. These changes would make some mods easier to build, while allow others to exist at all.
1. Entity rotation. More specifically, the ability to graphically represent rotation for more/every entity. This is especially relevant to me right now, since I am having to write an extremely awkward work-around this very moment. The benefits are pretty self-explanatory and well requested, so I won't push further. All that would be needed is a way to tie multiple png's to the same animation, one for each direction. Most of the prototypes I've been working with already have and keep track of their direction, they just don't do anything with it nor do they show it. At the moment, the solution I've found is to create an entirely separate copy of the prototype for each direction, tie the 4 png's to those prototypes, and then through scripts manually destroy the entities and then create the new one with the right directional png every time my entity is rotated. Not efficient or easy to work with.
2. Some way to intercept or modify the game.caninsert() function (or it's 0.12 equivalent). As far as I know, caninsert() is what is used by inserters and the like to determine whether it can place an item in it's hand into a given inventory. Being able to intercept this and add further, custom conditionals would be quite useful. In fact, Lost Ninja has requested a mod with chests that only allow certain items to be placed in them. Aside from the necessary GUI elements to control the filter, this would be a simple matter to implement were I able to add an additional conditional statement to caninsert() based upon the ItemStack parameter. I don't know if there is an easy way for lua to pass conditionals to parents or if it's even possible, but I was thinking there could be an insertconditions read/write property for Lua/inventory that contains a function. caninsert() would, in addition to it's normal programming, add an "and inventory.insertconditions(itemstack)" passing the itemstack to the cuntion contained in insertconditions and then check itself against what that function returns as to whether or not it was also true before inserting the stack. By default, the function inside insertconditions ignores itemstack and always evaluates to true, causing caninsert() to function as normal. However, now either through the prototype definition or more importantly though scripts, modders can change the function contained inside insertconditions to one that uses itemstack and/or whatever else at it's disposal to determine exactly when an inventory can be inserted into and what can be placed in it.
3. A full file read/write system. From what I've seen, one can read from a custom lua file in control.lua much in the same way that it reads from defines.lua. This can be used to have a system of custom config files, however afaik these can't be written to properly from within control.lua. game.makefile() doesn't seem to work in the way I expected it to (or work in any way that I can see at all) and even still it isn't a way to more coherently control what actually is placed in the file nor how it's structured. It would be nice to be able to build complex save files that are unique to each save-game, but at the very least it would be nice to be able to change configurations in-game through a gui, and that option (again, afaik) is not possible.
4. Ability for entity prototypes that use electricity to not, and for more/all entity prototypes that previously could not use electricity to be able to through the definitions. Pretty self-explanatory. A lot of times I need to use certain entity prototypes in ways that they were clearly not meant to be used in order to gain the functionality I need. Having more control over it's power consumption would be quite nice. Sometimes I might want to make a high-tier chest that has a ton of storage, but I want to balance it beyond simply making the recipe more difficult. I might, therefore, want to require that it be hooked up to an electrical grid in order to be accessible. Other times I might want to use a higher-tier entity prototype like an assembler as a base for a lower-tier one, like a simple transport belt attachment. I don't necessarily want that item to take power, since it's supposed to be used earlier on in the game. One can constantly refill the entity's buffer via scripts, but that's inefficient and inelegant. As for entities that don't normally consume power, I suppose one could create an invisible and non-colliding "dummy" entity that consumes power in place of the real one, but again, complicated and inelegant. A simple implementation could be that if electricity use is not specified in the prototype definition, no electricity is consumed (kind of like fluidboxes). Perhaps a new parent/child placement near entitywithhealth called entitywithpower or a modification of entitywithhealth to include electricity.
I'm relatively new to modding factorio, and I'm only one person, so these requests may not carry much weight, but I'm certain that at least a few mods would exist were even one of these things implemented.
Expanded API requests
Things that we aren't going to implement
Jump to
- General
- ↳ Releases
- ↳ News
- ↳ General discussion
- ↳ Multiplayer
- ↳ Find Servers / Tools / Guides
- ↳ Show your Creations
- ↳ Videos
- ↳ Combinator Creations
- ↳ Mechanical Throughput Magic (circuit-free)
- ↳ Railway Setups
- ↳ Energy Production
- ↳ Medium/Big/Gigantic Sized Structures
- ↳ Fan Art
- ↳ Gameplay Help
- ↳ Spread the Word
- ↳ Off topic
- ↳ This Forum
- ↳ Celebration Party
- Support
- ↳ Gameplay Help
- ↳ Discover Factorio Wiki
- ↳ Discover Others Creations
- ↳ Discover Mods
- ↳ Discover Tools Around Factorio
- ↳ Technical Help
- ↳ Bug Reports
- ↳ Resolved for the next release
- ↳ Assigned
- ↳ Not a bug
- ↳ Pending
- ↳ 1 / 0 magic
- ↳ Duplicates
- ↳ Minor issues
- ↳ Desyncs with mods
- ↳ Won't fix.
- ↳ Resolved Problems and Bugs
- Factorio Direction
- ↳ Ideas and Suggestions
- ↳ Outdated/Not implemented
- ↳ Frequently Suggested / Link Collections
- ↳ Implemented Suggestions
- ↳ Implemented in 2.0
- ↳ Development Proposals
- ↳ Balancing
- Contributions
- ↳ Mods
- ↳ Download mods
- ↳ Mod portal Discussion
- ↳ Mods
- ↳ Mod Packs / Libs / Special Interest
- ↳ 5dim's mod
- ↳ Angels Mods
- ↳ Atomic Power
- ↳ Bob's mods
- ↳ DyWorld
- ↳ F.A.R.L
- ↳ Fentus Challenge & Tool Mods
- ↳ Logistic Train Network
- ↳ MoMods
- ↳ Reika's Mods
- ↳ Resource Spawner Overhaul
- ↳ Yuoki Industries
- ↳ PyMods
- ↳ Questions, reviews and ratings
- ↳ Modding Discussions
- ↳ Modding discussion
- ↳ Modding help
- ↳ Ideas and Requests For Mods
- ↳ Modding interface requests
- ↳ Implemented mod requests
- ↳ Already exists
- ↳ Won't implement
- ↳ Documentation Improvement Requests
- ↳ Resolved Requests
- ↳ Development tools
- ↳ Tools
- ↳ Mod and installation managers
- ↳ Cheatsheets / Calculators / Viewers
- ↳ Development tools
- ↳ Special interest mods and libraries
- ↳ Modding Development
- ↳ Multiplayer / Dedicated Server
- ↳ Multiplayer Board
- ↳ Archive
- ↳ Maps and Scenarios
- ↳ Translations
- ↳ Texture Packs
- ↳ Fan Art
- ↳ Wiki Talk
- ↳ To be sorted
- ↳ Campaign / Scenario suggestions