Page 7 of 7

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

Posted: Tue Jan 30, 2018 12:02 am
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

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

Posted: Tue Jan 30, 2018 12:45 am
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.

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

Posted: Sat Jun 02, 2018 8:57 pm
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)

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

Posted: Sat Jun 02, 2018 9:32 pm
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

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

Posted: Sat Jun 09, 2018 9:20 am
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.

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

Posted: Tue Jun 12, 2018 5:33 am
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.

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

Posted: Tue Jun 12, 2018 6:48 am
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.

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

Posted: Wed Jul 11, 2018 7:34 pm
by eradicator
Runtime API access to:

LuaEntityPrototype.belt_distance
LuaEntityPrototype.container_distance
LuaEntityPrototype.belt_length


to faciliate automated script based loader placement.

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

Posted: Tue Jul 17, 2018 9:34 pm
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.

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

Posted: Fri Jul 20, 2018 4:52 pm
by Avacado
Runtime API read access to:

LuaRecipePrototype.main_product

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)

Posted: Sat Jul 28, 2018 7:28 am
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

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

Posted: Thu Aug 30, 2018 8:59 am
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

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

Posted: Wed Sep 12, 2018 7:06 pm
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.

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

Posted: Fri Sep 14, 2018 10:45 am
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)

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

Posted: Tue Mar 19, 2019 7:30 pm
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

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

Posted: Tue Mar 19, 2019 7:34 pm
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.

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

Posted: Tue Mar 19, 2019 7:47 pm
by Bilka
Come on guys, don't revive this topic. There is a reason why it was unpinned.

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

Posted: Tue Mar 19, 2019 7:58 pm
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.

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

Posted: Tue Mar 19, 2019 8:07 pm
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.

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

Posted: Thu Mar 21, 2019 7:46 pm
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.