-
-
Save tburrows13/687f7dc86da1840624575ba437e86cfa to your computer and use it in GitHub Desktop.
Not mentioned in the change logs: virtual_signal_prototypes has been removed from LuaGameScript
It is in the changelog, albeit not very searchable.
Moved prototypes access from LuaGameScript::X_prototypes to LuaPrototypes::X.
Couldn't find in the change logs, but ItemPrototypeFilter has also changed. The flag and filter fields appear to have been merged ('hidden' flag is now a filter)
It also appears that entity.connect_neighbour has been replaced with some other method
Here is an example of how to do programmatic circuit connections from my Moon Logic patch:
local Terminals = {
red = {
output = defines.wire_connector_id.combinator_output_red,
input = defines.wire_connector_id.combinator_input_red
},
green = {
output = defines.wire_connector_id.combinator_output_green,
input = defines.wire_connector_id.combinator_input_green
}
}
-- Create/connect/remove invisible constant-combinator entities for wire outputs
local function out_wire_connect(e, color)
local core = e.surface.create_entity{
name='mlc-core', position=e.position,
force=e.force, create_build_effect_smoke=false }
local terminals = Terminals[color]
local connectors = {
transmitter = e.get_wire_connector( terminals.output ),
receiver = core.get_wire_connector( terminals.input )
}
local success = connectors.transmitter.connect_to( connectors.receiver, false, defines.wire_origin.script )
if not success then
error(('Failed to connect %s wire outputs to core'):format(color))
end
core.destructible = false
return core
end
local function out_wire_connect_both(e)
return
out_wire_connect(e, "red"),
out_wire_connect(e, "green")
end
NOTE: the core entity is a mod item from Moon Logic. I would recommend replacing it and adding an additional argument for these objects so that the receiver can be arbitrary
Not mentioned in the change logs: virtual_signal_prototypes has been removed from LuaGameScript
It is in the changelog, albeit not very searchable.
Moved prototypes access from LuaGameScript::X_prototypes to LuaPrototypes::X.
If anyone else is losing their mind, because the current docs are incorrect, the old "game.item_prototypes" is now "prototypes.item".
I think there used to be a game.virtual_signal_prototypes, which is now prototypes.virtual_signal.
I'd guess that it's a relatively common thing to fetch stack sizes at runtime, so I hope they fix the docs. (They currently have a dead link from ItemPrototypeFilter to the game object.) I found the name by guessing!
no mention of the 'working_sound' changes and how the new system works - from the changelog:
Added support for sound accents for entities' working_sound. These are short sounds which play at a specific moment in the entity's animation.
Now in my 'KnightRider mod' theme music also plays if the player is in the car and opens the car GUI (BTW - the extension sounds that I add for KITT greeting Michel also sound for the tank and IDK how to remove that, because a 'tank' is also a 'car'...)
Please add a section about how main sounds work now (like why there are multiples defined for the 'car' 'working_sound' and how they are used) and help me fix the issue I mentioned above
@jocker-il I have no idea how sounds work. If the docs aren’t explaining them adequately then please make a documentation improvement request in the official forums.
@jocker-il I have no idea how sounds work. If the docs aren’t explaining them adequately then please make a documentation improvement request in the official forums.
A. thank you for the reply, as you are the second to propose this, it seems I will do that as a first step,
B. I owe you an apology as I (mistakenly?) thought you were part of the development team and I might have come-on too strong here - so please forgive any bad feeling, if I caused any (to anyone else, as well) - I tend to come on strong sometime as I'm a passionate person
It is recommended to open a separate GitHub repository for better maintenance and collaboration with everyone
Thanks for all your comments everyone. The guide has now been moved to a repository and gained some additional guidance for new 2.0 features: https://github.com/tburrows13/factorio-2.0-mod-porting-guide
https://wiki.factorio.com/Data.raw
see also
Not mentioned in the change logs: virtual_signal_prototypes has been removed from LuaGameScript
I believe it has been moved to the virtual_signal field of LuaPrototypes