RedMew icon indicating copy to clipboard operation
RedMew copied to clipboard

Factorio 2.0 update

Open RedRafe opened this issue 4 months ago • 7 comments

Updated code to Factorio 2.0 API

Relevant changes

  • [2.0] Updated .luackeckr with new classes, defines, and methods. game may be a bit out-of-date due to the very long list of methods it still holds
  • [2.0] Type of LuaObjects is now "userdata" instead of "table". Removed __self from the LuaObjects. Intended way of checking if an object is a lua object is to check type is userdata.
  • [2.0] Added new controller type (remote), which is to build space platforms, so it allows ghost building but not any physical manipulation. Added LuaPlayer::physical_surface, physical_surface_index, physical_vehicle and physical_position read. Accessing LuaPlayer::position will return player's remote position, if available. Need to keep an eye on .position checks. Suggest to use LuaPlayer::character::position for future works to disambiguate any doubt about wanting to access player's "virtual" position or "physical" position.
  • [2.0] Changed logistic networks to use LuaLogisticPoint. Added util logistic_point_util.lua
  • [2.0] Changed on_cutscene_waypoint_reached event's parameter "waypoint_index" to not be zero indexed. Need to test the ported Cutscene module.
  • [2.0] Added LuaRenderObject. All LuaRendering methods for manipulating object selected by id were moved to LuaRenderObject.
  • [2.0] LuaBootstrap::raise_event()'s and LuaBootstrap::on_event()'s "event" now also accepts event names as string as alternative to their numerical IDs.
  • [2.0] Removed the "flying-text" entity type. Use LuaPlayer::create_local_flying_text or LuaRendering::draw_text instead. utila.game.lua has been updated to replace all instances of it.
  • [space-age] Removed satellite item & recipe.
  • [space-age] Quality may break many inventory/item manipulations with additional param .quality added to old LuaItemStack. It's generally safe to use ItemStacks in vanilla, as quality = normal will be set as default.

RedRafe avatar Oct 18 '24 10:10 RedRafe