Add information to migrating to Godot 4#11895
Add information to migrating to Godot 4#11895skyace65 wants to merge 1 commit intogodotengine:masterfrom
Conversation
6b1aab0 to
0872c4f
Compare
| - In :ref:`class_@GlobalScope` ``string()`` was renamed to ``str()`` | ||
| - :ref:`class_@GlobalScope`'s enum ``Margin`` has been completely removed |
There was a problem hiding this comment.
String() (uppercase S) and str() both exist in Godot 4. However, there has never been a string() (lowercase S) in Godot. See this 3.6 screenshot:
| - In :ref:`class_@GlobalScope` ``string()`` was renamed to ``str()`` | |
| - :ref:`class_@GlobalScope`'s enum ``Margin`` has been completely removed | |
| - :ref:`class_@GlobalScope`'s enum ``Margin`` has been completely removed. |
| - :ref:`class_@GlobalScope`'s enum ``Margin`` has been completely removed | ||
| - ``get_joy_axis_string()`` was removed from ``Input``. There is no replacement, any code that | ||
| relied on this should be changed to work with ints: `GH-43591 <https://github.com/godotengine/godot/pull/43591>` | ||
| - ``Plus_File()`` was removed. Any code that used it should be changed to manually add a |
There was a problem hiding this comment.
String.plus_file() was replaced with String.path_join(). This should probably be added to the project converter's renames_map_3_to_4.cpp, as it doesn't appear to be there.
| ``make_current()`` | ||
| - ``lerp()`` will **NOT** automatically convert an int to a float anymore. If a float is | ||
| your second value, add a ``.0`` to the int | ||
| - MSAA viewport and project settings have been split up between 2D and 3D |
There was a problem hiding this comment.
The project converter should convert existing MSAA settings/values to msaa_3d, as 2D MSAA did not exist in Godot 3.
| - ``lerp()`` will **NOT** automatically convert an int to a float anymore. If a float is | ||
| your second value, add a ``.0`` to the int |
There was a problem hiding this comment.
I would mention the use of lerpf() instead, as it's typed and always returns a float.
| - Using ``@export`` followed by the type hint in parenthesis, for example | ||
| ``@export (int) var MyVar``, is no longer valid syntax. Please see the :ref:<gdscript exports | ||
| page for correct syntax. | ||
| - ``set_target_fps()`` is now ``set_max_fps()`` |
There was a problem hiding this comment.
We should add this to the project converter renames map. (iterations_per_second -> physics_ticks_per_second is already there.)
|
Committed some of the suggested changes. Looking into other mentioned stuff, need to re-check what made me add these to my converter notes originally. |
|
|
||
| - Materials set in ``MeshInstance`` properties in 3.x will need to be re-assigned in | ||
| 4.0. | ||
| - ``Surface Material Override``s need to be manually set again. |
There was a problem hiding this comment.
| - ``Surface Material Override``s need to be manually set again. | |
| - ``Surface Material Override``\ s need to be manually set again. |
I think to ensure proper formatting
| - ``Surface Material Override``s need to be manually set again. | ||
| - ``Label3D``s will need their fonts re-assigned to them. In addition their font | ||
| size will need to be manually adjusted. | ||
| - The location of your default audio bus may need to be set again in project settings. |
There was a problem hiding this comment.
| - The location of your default audio bus may need to be set again in project settings. | |
| - The location of your default audio bus may need to be set again in the project settings. |
| - In ``_get_property_list()``, the ``noslider`` property hint string is now ``no_slider``. | ||
| - VisualShaderNodeVec4Parameter now takes a :ref:`class_Vector4` as parameter | ||
| instead of a :ref:`class_Quaternion`. | ||
| - In :ref:`class_@GlobalScope` ``string()`` was renamed to ``str()`` |
There was a problem hiding this comment.
| - In :ref:`class_@GlobalScope` ``string()`` was renamed to ``str()`` | |
| - In :ref:`class_@GlobalScope` ``string()`` was renamed to ``str()``. |
For all
| - :ref:`class_@GlobalScope`'s enum ``Margin`` has been completely removed | ||
| - ``get_joy_axis_string()`` was removed from ``Input``. There is no replacement, any code that | ||
| relied on this should be changed to work with ints: `GH-43591 <https://github.com/godotengine/godot/pull/43591>` | ||
| - ``Plus_File()`` was removed. Any code that used it should be changed to manually add a |
There was a problem hiding this comment.
| - ``Plus_File()`` was removed. Any code that used it should be changed to manually add a | |
| - ``plus_file()`` was removed. Any code that used it should be changed to manually add a |
No?
| - ``_unhandled_key_input`` now takes ``InputEvent`` instead of ``InputEventKey`` | ||
| - ``get_font()`` is now ``get_theme_font()`` | ||
| - ``ResourceInteractiveLoader`` has been fully removed | ||
| - in :ref:`class_OS` the arguments for ``execute()`` have changed. ``blocking`` has been removed, |
There was a problem hiding this comment.
| - in :ref:`class_OS` the arguments for ``execute()`` have changed. ``blocking`` has been removed, | |
| - In :ref:`class_OS` the arguments for ``execute()`` have changed. ``blocking`` has been removed, |
| - ``get_font()`` is now ``get_theme_font()`` | ||
| - ``ResourceInteractiveLoader`` has been fully removed | ||
| - in :ref:`class_OS` the arguments for ``execute()`` have changed. ``blocking`` has been removed, | ||
| in Godot 4 blocking the main thread until completion is the default behavior now. Use of |
There was a problem hiding this comment.
| in Godot 4 blocking the main thread until completion is the default behavior now. Use of | |
| in Godot 4 blocking the main thread until completion is now the default behavior. Use of |
| ``intersect_ray()`` arguments must now be provided in the form of | ||
| ``PhysicsRayQueryParameters3D`` or ``PhysicsRayQueryParameters2D``. Within the query | ||
| parameters the order of the collision mask and array arguments have been switched, and | ||
| the ``collide_with_bodies`` and ``Colide_with_areas`` arguments have been removed. |
There was a problem hiding this comment.
| the ``collide_with_bodies`` and ``Colide_with_areas`` arguments have been removed. | |
| the ``collide_with_bodies`` and ``colide_with_areas`` arguments have been removed. |
| Manual resource fixes | ||
| ~~~~~~~~~~~~~~~~~~~~~ | ||
|
|
||
| Some scene resources will need to be manually setup again to look or behave the way |
There was a problem hiding this comment.
| Some scene resources will need to be manually setup again to look or behave the way | |
| Some scene resources will need to be manually set up again to look or behave the way |
"Setup" is a noun
| - Materials set in ``MeshInstance`` properties in 3.x will need to be re-assigned in | ||
| 4.0. | ||
| - ``Surface Material Override``s need to be manually set again. | ||
| - ``Label3D``s will need their fonts re-assigned to them. In addition, their font |
There was a problem hiding this comment.
| - ``Label3D``s will need their fonts re-assigned to them. In addition, their font | |
| - ``Label3D``\ s will need their fonts re-assigned to them. In addition, their font |
| ``PhysicsRayQueryParameters3D`` or ``PhysicsRayQueryParameters2D``. Within the query | ||
| parameters the order of the collision mask and array arguments have been switched, and | ||
| the ``collide_with_bodies`` and ``Colide_with_areas`` arguments have been removed. | ||
| - :ref:`class_Label`'s ``Align`` property is now ``HorizontalAllignment``. |
There was a problem hiding this comment.
| - :ref:`class_Label`'s ``Align`` property is now ``HorizontalAllignment``. | |
| - :ref:`class_Label`'s ``align`` property is now ``horizontal_alignment``. |
These are various changes and issues I discovered while trying to convert the LibreTrainSim project. Unfortunately I had to give up the project due to a lack of time but I wanted to make sure these changes got documented here, would have saved me a lot of time when I first did that project.