-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Factorio 2.0 update #1436
Factorio 2.0 update #1436
Conversation
I managed to fix the test suite which was broken in the new API (@grilledham you'll have to take a look at Now we can run tests and 50% of tests are broken. However, all the utils/gui tests pass while the features dont. I think it may be cause by this function used to setup the tests: function Public.modify_lua_object(context, object, key, value)
local old_value = object[key]
rawset(object, key, value)
context:add_teardown(function()
rawset(object, key, old_value)
end)
end
|
I'll look at it later. I think for now it's fine for the tests to not be passing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is amazing work, thanks for taking the time to do this, very much appreciated.
I can't really test this until after SA launches, but the changes look fine to me.
You have my approval to merge this after we update the server to 2.0/SA.
Regarding your comments in the other PR, this one:
Do you want to delete the landfill remover, spidertron control and loader code as part of this PR? |
Honestly I didnt test this part at all. I'm fine keeping it for now (modules may be disabled by default) and come back to check when testing the scenarios to see why it was needed and if new behavior can substitute it or just the entire feature as QoL |
Ok, so do we want to just disable these modules by default in the minimal scenario I made? I can do that if you would prefer? |
I wouldn't remove them without testing. Having them still in 2.0 will not cause any issue, just redundancy if built-in feature will cover 100% of the cases we use them for. Let's just say it'll be a good "first issue" to port or remove code in 2.0 if checking with the scenarios reveals those modules are not needed anymore Edit. There'll be probably many other modules and tasks that havent been updated in years even in recent version of 1.0-1.1 that I didn't catch with the eye at first glance but could now be optimized or removed in 2.0 other than these 2 examples I believe |
Updated code to Factorio 2.0 API
Relevant changes
.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 holdsLuaPlayer::physical_surface, physical_surface_index, physical_vehicle and physical_position
read. AccessingLuaPlayer::position
will return player's remote position, if available. Need to keep an eye on.position
checks. Suggest to useLuaPlayer::character::position
for future works to disambiguate any doubt about wanting to access player's "virtual" position or "physical" position.LuaLogisticPoint
. Added utillogistic_point_util.lua
on_cutscene_waypoint_reached
event's parameter "waypoint_index" to not be zero indexed. Need to test the ported Cutscene module.LuaBootstrap::raise_event()
's andLuaBootstrap::on_event()
's "event" now also accepts event names as string as alternative to their numerical IDs.LuaPlayer::create_local_flying_text
orLuaRendering::draw_text
instead.utila.game.lua
has been updated to replace all instances of it..quality
added to old LuaItemStack. It's generally safe to use ItemStacks in vanilla, asquality = normal
will be set as default.