LuaScriptArea more features

Things that we aren't going to implement
Post Reply
User avatar
LuziferSenpai
Filter Inserter
Filter Inserter
Posts: 339
Joined: Tue Jul 08, 2014 10:06 am
Contact:

LuaScriptArea more features

Post by LuziferSenpai »

Hey,

so it would be nice if we could get this for LuaScriptArea, so its more useful then already.
First make it a own Class.
With that we could use with Stuff like this:

LuaScriptArea::name → string [Read-Write]
LuaScriptArea::id → uint [Read-only]
LuaScriptArea::area → BoundingBox [Read-Write]
LuaScriptArea::color → Color [Read-Write]
LuaScriptArea::get_polution() → double
LuaScriptArea::get_entities() → array of LuaEntity
LuaScriptArea::get_entities_filtered{name=…, type=…, ghost_name=…, ghost_type=…, direction=…, collision_mask=…, force=…, to_be_upgraded=…, limit=…, invert=…} → array of LuaEntity
LuaScriptArea::get_tiles_filtered{name=…, limit=…, has_hidden_tile=…, collision_mask=…} → array of LuaTile
LuaScriptArea::count_entities_filtered{name=…, type=…, ghost_name=…, ghost_type=…, direction=…, collision_mask=…, force=…, limit=…, invert=…} → uint
LuaScriptArea::count_tiles_filtered{name=…, limit=…, has_hidden_tile=…, collision_mask=…} → uint
LuaScriptArea::find_non_colliding_position(name, precision, force_to_tile_center) → Position
LuaScriptArea::find_enemy_units(force) → array of LuaEntity
LuaScriptArea::find_units{force=…, condition=…} → array of LuaEntity
LuaScriptArea::pollute(amount)
LuaScriptArea::deconstruct_area{force=…, player=…, skip_fog_of_war=…, item=…}
LuaScriptArea::cancel_deconstruct_area{force=…, player=…, skip_fog_of_war=…, item=…}
LuaScriptArea::upgrade_area{force=…, player=…, skip_fog_of_war=…, item=…}
LuaScriptArea:cancel_upgrade_area{force=…, player=…, skip_fog_of_war=…, item=…}
LuaScriptArea::destroy_decoratives{position=…, name=…, limit=…, invert=…}
LuaScriptArea:get_decoratives_filtered{name=…, limit=…, invert=…} → array of DecorativeResult
LuaScriptArea::get_resource_counts() → dictionary string → uint

ONLY eventually LuaScriptArea::clone_script_area{destination_area=…, destination_surface=…, destination_force=…, clone_tiles=…, clone_entities=…, clone_decoratives=…, clear_destination_entities=…, clear_destination_decoratives=…, expand_map=…}

LuaScriptArea::clone_brush{destination_offset=…, destination_surface=…, destination_force=…, clone_tiles=…, clone_entities=…, clone_decoratives=…, clear_destination_entities=…, clear_destination_decoratives=…, expand_map=…, manual_collision_mode=…}

Greetz,

Luzifer
Coding is awesome!
Animes are love!
Factorio is life!

My MODs:
Click

Greetz,

Senpai

posila
Factorio Staff
Factorio Staff
Posts: 5202
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: LuaScriptArea more features

Post by posila »

What would be benefit of duplicating bunch of functions that already exist on LuaSurface onto some other class though?

User avatar
LuziferSenpai
Filter Inserter
Filter Inserter
Posts: 339
Joined: Tue Jul 08, 2014 10:06 am
Contact:

Re: LuaScriptArea more features

Post by LuziferSenpai »

Some of these functions DONT support Area and we dont need to go down in a table just to get the area, so it would be less script.
Coding is awesome!
Animes are love!
Factorio is life!

My MODs:
Click

Greetz,

Senpai

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

Re: LuaScriptArea more features

Post by Rseding91 »

LuziferSenpai wrote:
Tue May 19, 2020 1:02 pm
Some of these functions DONT support Area ...
Some of those functions aren't even meant to exist outside of our own development purposes but we left them because "maybe someone will find them handy"
LuziferSenpai wrote:
Tue May 19, 2020 1:02 pm
... and we dont need to go down in a table just to get the area, so it would be less script.
That's exactly what you're supposed to do. As Posila said; I don't see the point in copy-pasting all of that code into another area just so someone can write a few less lines of Lua.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Won't implement”