Page 1 of 1

LuaEntity::effect_sources read

Posted: Sat Apr 11, 2020 6:07 am
by raiguard
Currently, there is no easy way to retrieve a list of what beacons are affecting a specific crafter. The method I'm using right now involves taking every beacon in the selection (the mod uses a selection tool), creating a bounding_box that represents its effect area, and iterating over every selected crafter to see if they collide. This is slow, ugly, and expensive.

Ideally it would just be a readable array of LuaEntities, but a function would work too if the game doesn't constantly store and update this information.

Thanks!

Re: LuaEntity::effect_sources read

Posted: Sat Apr 11, 2020 6:29 pm
by Rseding91
Currently that's how the base game does it as well.

There is a "list" but it's not in any order and so isn't deterministic to let mods read it.