godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.14k stars 21.19k forks source link

The 'get_multiplayer' method cannot obtain the value obtained by the 'set_multiplayer' method #77817

Closed mao437303994 closed 1 year ago

mao437303994 commented 1 year ago

Godot version

4.1.dev

System information

Window 10

Issue description

If the result is what you expect, why not block it when you set the value, the value is successfully set in the Map, but when you get it, it's not what you expect, and you make mistakes. 微信图片编辑_20230604044018

Steps to reproduce

N/A

Minimal reproduction project

N/A

AThousandShips commented 1 year ago

Please provide an MRP to indicate what specific steps you are doing, or at minimum an actual description of what you are doing, without that not only are we unable to tell what's wrong, we also can't tell if you're doing something wrong

The titles on the form are not optional, you have to fill them in

mao437303994 commented 1 year ago

Please provide an MRP to indicate what specific steps you are doing, or at minimum an actual description of what you are doing, without that not only are we unable to tell what's wrong, we also can't tell if you're doing something wrong

The titles on the form are not optional, you have to fill them in

I have set up a custom "Multiplayer API" on scenario A, and also set up a custom "Multiplayer API" on its sub scenario B. However, sub scenario B cannot obtain its own "Multiplayer API", and only obtains scenario A's "Multiplayer API". If I am not allowed to set up a "Multiplayer API" on sub scenario B, why not prevent it. I hope to obtain my own "Multiplayer API" for sub scenes.

AThousandShips commented 1 year ago

Please attach an MRP with your script and scene

small Godot project which reproduces the issue, with no unnecessary files included. Be sure to not include the .godot folder in the archive (but keep project.godot). Required, unless the reproduction steps are trivial and don't require any project files to be followed. In this case, write "N/A" in the field.

mao437303994 commented 1 year ago

Please attach an MRP with your script and scene

small Godot project which reproduces the issue, with no unnecessary files included. Be sure to not include the .godot folder in the archive (but keep project.godot). Required, unless the reproduction steps are trivial and don't require any project files to be followed. In this case, write "N/A" in the field.

https://github.com/mao437303994/test_godot.git

AThousandShips commented 1 year ago

I think I know what might be causing this, will take a look when I have time

AThousandShips commented 1 year ago

Got a fix working, PR is open

mao437303994 commented 1 year ago

Got a fix working, PR is open

If the name of a node changes, the result obtained by "get_multilayer" is also incorrect because the map still stores the previous NodePath

AThousandShips commented 1 year ago

If the name of a node changes, the result obtained by "get_multilayer" is also incorrect because the map still stores the previous NodePath

Oh my bad, that's not covered here nor is it supported atm, not in the bounds of this PR, open a separate issue please

mao437303994 commented 1 year ago

g.

"set_name" changes the name of node Test, and getting the result should not be correct

mao437303994 commented 1 year ago

If the name of a node changes, the result obtained by "get_multilayer" is also incorrect because the map still stores the previous NodePath

Oh my bad, that's not covered here nor is it supported atm, not in the bounds of this PR, open a separate issue please

My SDK of Godot is still old and has bugs that make it difficult to demonstrate

AThousandShips commented 1 year ago

Yes, and I understand you expect it to work this way, but it unfortunately does not, please open an issue for that specifically as it is not within the bounds of the report in this, you don't mention it, and this is about a specific thing, the issue of not getting the path of this, but I will add a comment to the documentation clarifying this is a limitation currently at least

The issue here is that in SceneTree you set the multiplayer associated with a path, and it doesn't require a node to actually exist, so handling the renaming of a node is separate, and you can get other issues if you actually rename it

So, to make it easier to track this, please open a separate issue for that specifically so we can investigate that separately (as it is more involved)

And I'm not convinced it's a bug, as you set it to a path in SceneTree not to a node

AThousandShips commented 1 year ago

Update: This is not a bug, see #77829 for explanation, but the PR now fixes the incorrect assignments that cause this confusion