godot-docs icon indicating copy to clipboard operation
godot-docs copied to clipboard

Your first 2D game - 4.0 readying

Open BryanQuigley opened this issue 3 years ago • 5 comments
trafficstars

Your Godot version: 4.0

Issue description: There are a few places where things have changed in 4.x. I'm stuck on a few, but appear to be mostly easy fixes?

https://docs.godotengine.org/en/latest/getting_started/first_2d_game/04.creating_the_enemy.html Many node names have changed slightly.

https://docs.godotengine.org/en/latest/getting_started/first_2d_game/05.the_main_game_scene.html export doesn't work here either, this is where I got stuck

BryanQuigley avatar Jan 06 '22 07:01 BryanQuigley

URL to the documentation page: https://docs.godotengine.org/en/latest/getting_started/first_2d_game/03.coding_the_player.html uses export, tried changing to @export but that didn't work

I found that changing export to @export worked - and I was able to see that variable in the Inspector. You're correct in that it should be shown with the preceding @ symbol in this guide/tutorial.

I'm using the 4.0 build from 20220118 on Windows 11 (64 bit)

TechnicalSoup avatar Jan 20 '22 04:01 TechnicalSoup

Thanks, I think I must have not been inspecting the right thing. That first one works now. The last export I need to find new syntax I guess?

BryanQuigley avatar Jan 20 '22 07:01 BryanQuigley

The last export I need to find new syntax I guess?

I think the format for the second export will be @export var mob_scene: PackedScene although I haven't actually tested that out myself yet. I'll have a go at it in the next few days and let you know if it works.

TechnicalSoup avatar Jan 26 '22 23:01 TechnicalSoup

That worked with one other change: var mob = mob_scene.instantiate() #was instance

Also had to change some rand_range -> randi_range

BryanQuigley avatar Jan 27 '22 02:01 BryanQuigley

There are a few renames needed for the 4.0 beta.

In section 5, "The main game scene":

I made an attempt at a fix, but I haven't tested the C# and C++ changes for origin -> progress_ratio. I'll try to verify those soon and update the PR if needed, but the guesses seem reasonable.

acristin avatar Sep 20 '22 06:09 acristin

This is the last one remaining from making the tutorial code-compatible with 4.0 https://github.com/godotengine/godot-docs/issues/6234

TheYellowArchitect avatar Sep 28 '22 17:09 TheYellowArchitect

This was fixed by multiple PRs, namely https://github.com/godotengine/godot-docs/pull/6275 (wasn't linked properly). If there are any missing renames or examples of outdated syntax, please open new issues.

YuriSizov avatar Feb 04 '23 20:02 YuriSizov