Simple property requests (something that exists but has no way to read/write it)
Re: Simple property requests (something that exists but has no way to read/write it)
Thanks for your reply, I've made a poc mod to show the issue and bug reported it : viewtopic.php?f=7&t=57301
-
- Fast Inserter
- Posts: 127
- Joined: Fri May 08, 2015 2:25 pm
- Contact:
Re: Simple property requests (something that exists but has no way to read/write it)
I'd like to request a read for the total amount of resources in a resource patch (either % yield for infinite or exact amount for finite resources) like it shows in the map when you hover over a patch. I know modders can implement a search for connected resource entites to calculate that amount. I did that, but honestly, it's not that fast, and since the game already shows the amount, could it be accessable please?
Together with or instead of that, it would also be nice if you could get all the resource entites of the resource patch.
Together with or instead of that, it would also be nice if you could get all the resource entites of the resource patch.
My RSO+Bob's+Angel's modpack: Farlands (outdated)
Mods (current): Resource Labels
Mods (old): Biter Spires
Mods (current): Resource Labels
Mods (old): Biter Spires
Re: Simple property requests (something that exists but has no way to read/write it)
game.savename - name of save game .zip as passed to factorio on headless command line. as used by game.server_save() when name is not supplied. (I think)
- eradicator
- Smart Inserter
- Posts: 5207
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Simple property requests (something that exists but has no way to read/write it)
Those two ++2Pandemoneus wrote:I'd like to request a read for the total amount of resources in a resource patch (either % yield for infinite or exact amount for finite resources) like it shows in the map when you hover over a patch. I know modders can implement a search for connected resource entites to calculate that amount. I did that, but honestly, it's not that fast, and since the game already shows the amount, could it be accessable please?
Together with or instead of that, it would also be nice if you could get all the resource entites of the resource patch.
Re: Simple property requests (something that exists but has no way to read/write it)
The save file name is not part of the game state and likely never will be meaning not even the game knows what the name was in mp.adamius wrote:game.savename - name of save game .zip as passed to factorio on headless command line. as used by game.server_save() when name is not supplied. (I think)
If you want to get ahold of me I'm almost always on Discord.
Re: Simple property requests (something that exists but has no way to read/write it)
Does game.server_save() therefore cause a call to something outside, eg the execute core (for want of a better term), to perform the save because that core knows what the filename is when it was not provided?Rseding91 wrote:The save file name is not part of the game state and likely never will be meaning not even the game knows what the name was in mp.adamius wrote:game.savename - name of save game .zip as passed to factorio on headless command line. as used by game.server_save() when name is not supplied. (I think)
For context, I’ve got code right now that benefits from having the save name and server date time. I’ve also been told neither of these are possible due to desync in the game engine. I’m fascinated by the actuality of having something actively working yet being told it is completely impossible.
Re: Simple property requests (something that exists but has no way to read/write it)
The server knows what the name of the save was it loaded and knows where the temporary save directory is and what it would name the next autosave. That information is not stored *in* the save file and is not communicated anywhere with joining players. It exists in memory on the server (and in memory on the client when playing single player) but outside that isn't not available for mods to read.adamius wrote:Does game.server_save() therefore cause a call to something outside, eg the execute core (for want of a better term), to perform the save because that core knows what the filename is when it was not provided?Rseding91 wrote:The save file name is not part of the game state and likely never will be meaning not even the game knows what the name was in mp.adamius wrote:game.savename - name of save game .zip as passed to factorio on headless command line. as used by game.server_save() when name is not supplied. (I think)
For context, I’ve got code right now that benefits from having the save name and server date time. I’ve also been told neither of these are possible due to desync in the game engine. I’m fascinated by the actuality of having something actively working yet being told it is completely impossible.
If you want to get ahold of me I'm almost always on Discord.
- eradicator
- Smart Inserter
- Posts: 5207
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Simple property requests (something that exists but has no way to read/write it)
Runtime API access to:
LuaEntityPrototype.belt_distance
LuaEntityPrototype.container_distance
LuaEntityPrototype.belt_length
to faciliate automated script based loader placement.
LuaEntityPrototype.container_distance
LuaEntityPrototype.belt_length
to faciliate automated script based loader placement.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: Simple property requests (something that exists but has no way to read/write it)
I'm guessing that LuaItemPrototype::action/action_delivery/(source?) target_effects would have to be exposed in some fashion.
Edit:
Appears that this information is already exposed through partially documented methods: LuaItemPrototype.get_ammo_type().action, etc.
Re: Simple property requests (something that exists but has no way to read/write it)
Runtime API read access to:
LuaRecipePrototype.main_product
to help identify what image a recipe is using during runtime. Thanks!
to help identify what image a recipe is using during runtime. Thanks!
Re: Simple property requests (something that exists but has no way to read/write it)
A shortcut get_item_contents() to fetch a list of all equipment's item names similar to how get_contents() fetches all equipment names.
Currently getting all item names for equipment in a grid is rather slow when all you're interested is how many of x there are in the grid.
Currently getting all item names for equipment in a grid is rather slow when all you're interested is how many of x there are in the grid.
Code: Select all
local item_contents = {}
for _, equipment in pairs(grid_equipment) do
local item_name = equipment.prototype.take_result.name
if item_contents[item_name] then
item_contents[item_name] = item_contents[item_name] + 1
else
item_contents[item_name] = 1
end
end
My Mods: mods.factorio.com
Re: Simple property requests (something that exists but has no way to read/write it)
Some way to quickly and easily fetch "damage per shot" of a turret, based on its current ammo type, its owner force tech bonuses, et cetera.
Basically the data used for this info panel:
Basically the data used for this info panel:
Re: Simple property requests (something that exists but has no way to read/write it)
Can we get LuaEntity.beam_source and LuaEntity.beam_target for beam entities? Preferably read/write, but just read would be fine if moving beams is too complex. Should support positions and entities, and maybe a way to tell whether it is an entity or a position.
-
- Inserter
- Posts: 35
- Joined: Fri Aug 24, 2018 7:42 pm
- Contact:
Re: Simple property requests (something that exists but has no way to read/write it)
would be great to get
LuaEntityPrototype:automated_ammo_count (based on the already existing value in the turret data prototype automated_ammo_count)
-
- Fast Inserter
- Posts: 162
- Joined: Sun Oct 28, 2018 7:57 am
- Contact:
Re: Simple property requests (something that exists but has no way to read/write it)
Want to show the unit (e.g., biters, spitters) pollution_to_join_attack values, due to the new pollution handling.
For modded spawners that have a lot of new alien unit types, the info panel of spawners simply cannot show later entries.
Would be nice if my mod can use these values in a custom GUI table.
Guess it should be under LuaEntityPrototype::pollution_to_join_attack
For modded spawners that have a lot of new alien unit types, the info panel of spawners simply cannot show later entries.
Would be nice if my mod can use these values in a custom GUI table.
Guess it should be under LuaEntityPrototype::pollution_to_join_attack
- Ranakastrasz
- Smart Inserter
- Posts: 2173
- Joined: Thu Jun 12, 2014 3:05 am
- Contact:
Re: Simple property requests (something that exists but has no way to read/write it)
Event type
on_player_alert - returns alert_type, and details (location, icon, relevant entity(s))
Purpose. Allow mods to hook into alerts, and, say, allow a history, or a circuit event reaction, or something like that, for alerts.
on_player_alert - returns alert_type, and details (location, icon, relevant entity(s))
Purpose. Allow mods to hook into alerts, and, say, allow a history, or a circuit event reaction, or something like that, for alerts.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Re: Simple property requests (something that exists but has no way to read/write it)
Come on guys, don't revive this topic. There is a reason why it was unpinned.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
-
- Fast Inserter
- Posts: 162
- Joined: Sun Oct 28, 2018 7:57 am
- Contact:
Re: Simple property requests (something that exists but has no way to read/write it)
Sorry for that. Are there better place to post this?
Would be nice if there a pinned thread for these kinds of request, again.
Re: Simple property requests (something that exists but has no way to read/write it)
Just make separate topics.Schallfalke wrote: ↑Tue Mar 19, 2019 7:58 pm Sorry for that. Are there better place to post this?
Would be nice if there a pinned thread for these kinds of request, again.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Re: Simple property requests (something that exists but has no way to read/write it)
You should lock this topic. I only get to it from the Your Posts or Active Topics lists. I had no idea it was unpinned, or even that it had ever been pinned. Whatever you wanted to communicate by unpinning it, that was unsuccessful.