Simple property requests (something that exists but has no way to read/write it)

Locked
VortiK
Burner Inserter
Burner Inserter
Posts: 9
Joined: Wed Jan 17, 2018 8:22 pm
Contact:

Re: Simple property requests (something that exists but has no way to read/write it)

Post by VortiK »

Thanks for your reply, I've made a poc mod to show the issue and bug reported it : viewtopic.php?f=7&t=57301

Pandemoneus
Fast Inserter
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)

Post by Pandemoneus »

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.
My RSO+Bob's+Angel's modpack: Farlands (outdated)
Mods (current): Resource Labels
Mods (old): Biter Spires

adamius
Long Handed Inserter
Long Handed Inserter
Posts: 74
Joined: Mon Mar 19, 2018 9:18 am
Contact:

Re: Simple property requests (something that exists but has no way to read/write it)

Post by adamius »

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)

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 4050
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Simple property requests (something that exists but has no way to read/write it)

Post by eradicator »

Pandemoneus 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.
Those two ++2

Rseding91
Factorio Staff
Factorio Staff
Posts: 10764
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Simple property requests (something that exists but has no way to read/write it)

Post by Rseding91 »

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)
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.
If you want to get ahold of me I'm almost always on Discord.

adamius
Long Handed Inserter
Long Handed Inserter
Posts: 74
Joined: Mon Mar 19, 2018 9:18 am
Contact:

Re: Simple property requests (something that exists but has no way to read/write it)

Post by adamius »

Rseding91 wrote:
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)
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.
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?

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.

Rseding91
Factorio Staff
Factorio Staff
Posts: 10764
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Simple property requests (something that exists but has no way to read/write it)

Post by Rseding91 »

adamius wrote:
Rseding91 wrote:
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)
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.
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?

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.
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.
If you want to get ahold of me I'm almost always on Discord.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 4050
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Simple property requests (something that exists but has no way to read/write it)

Post by eradicator »

Runtime API access to:

LuaEntityPrototype.belt_distance
LuaEntityPrototype.container_distance
LuaEntityPrototype.belt_length


to faciliate automated script based loader placement.
Author of: Hand Crank Generator, Screenshot Hotkey 2.0, /sudo
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Kovus
Inserter
Inserter
Posts: 22
Joined: Sat Feb 27, 2016 5:25 pm
Contact:

Re: Simple property requests (something that exists but has no way to read/write it)

Post by Kovus »

I'd like to have runtime read access to ammo item prototype's target damage values. I'm not sure if it would need to expose a large section of data, but it would be of interest to be able to get or calculate the damage that a particular ammo would do.

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.

Avacado
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Fri Jul 22, 2016 3:17 pm
Contact:

Re: Simple property requests (something that exists but has no way to read/write it)

Post by Avacado »

Runtime API read access to:

LuaRecipePrototype.main_product

to help identify what image a recipe is using during runtime. Thanks!

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2603
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Simple property requests (something that exists but has no way to read/write it)

Post by Optera »

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.

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

User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 494
Joined: Tue May 19, 2015 1:56 am
Contact:

Re: Simple property requests (something that exists but has no way to read/write it)

Post by Reika »

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:
Image
Image

Boodals
Fast Inserter
Fast Inserter
Posts: 126
Joined: Sun Feb 11, 2018 7:10 pm
Contact:

Re: Simple property requests (something that exists but has no way to read/write it)

Post by Boodals »

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.

CaveGrinder
Inserter
Inserter
Posts: 28
Joined: Fri Aug 24, 2018 7:42 pm
Contact:

Re: Simple property requests (something that exists but has no way to read/write it)

Post by CaveGrinder »

would be great to get
LuaEntityPrototype:automated_ammo_count (based on the already existing value in the turret data prototype automated_ammo_count)

Schallfalke
Fast Inserter
Fast Inserter
Posts: 141
Joined: Sun Oct 28, 2018 7:57 am
Contact:

Re: Simple property requests (something that exists but has no way to read/write it)

Post by Schallfalke »

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

User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2062
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: Simple property requests (something that exists but has no way to read/write it)

Post by Ranakastrasz »

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.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

Bilka
Factorio Staff
Factorio Staff
Posts: 2481
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Simple property requests (something that exists but has no way to read/write it)

Post by Bilka »

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.

Schallfalke
Fast Inserter
Fast Inserter
Posts: 141
Joined: Sun Oct 28, 2018 7:57 am
Contact:

Re: Simple property requests (something that exists but has no way to read/write it)

Post by Schallfalke »

Bilka wrote:
Tue Mar 19, 2019 7:47 pm
Come on guys, don't revive this topic. There is a reason why it was unpinned.
Sorry for that. Are there better place to post this?
Would be nice if there a pinned thread for these kinds of request, again.

Bilka
Factorio Staff
Factorio Staff
Posts: 2481
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Simple property requests (something that exists but has no way to read/write it)

Post by Bilka »

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.
Just make separate topics.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

sparr
Smart Inserter
Smart Inserter
Posts: 1095
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: Simple property requests (something that exists but has no way to read/write it)

Post by sparr »

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.

Locked

Return to “Implemented mod requests”

Who is online

Users browsing this forum: No registered users