-
Notifications
You must be signed in to change notification settings - Fork 122
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
fix: prevents duplicate item registration and also ensures that the p… #587
Conversation
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.
If 2 ESCItems have the same global ID this fails correctly. I've found 2 issues though :
-
I create 2 ESCItems (ESCItem1 and ESCItem2). I create an ESCLocation as a child of ESCItem2 and give it the same Global ID as ESCItem1. Running the scene does not cause it to crash.
-
The error message "Object with global id button_main_change_scene in room (room14, 1931) already registered" tells me that the IDs should be globally unique. If I have ESCItem1 in room 1 with the ID ESCItem1_ID and create an object in room 2 with the same ID ("ESCItem1_ID") it doesn't crash as I go back and forth between room 1 and 2.
So we can discuss that error message, as well as if/how we want to police global ID uniqueness, if at all. @StraToN you may want to weigh in on this as well. |
Indeed there is no strong rule about objects' The downside of this is that you cannot differentiate the 2 items when calling an ESC command on that |
Is there any reason we can't make them globally unique? If something with the name "global" it's not going to be a globally unique identifier then to me it's like if you were programming using a "const" and changed its value. (The alternative would be renaming it "object_id" but I think that's a bigger task than anyone wants to take on :D ) If the decision stays that you can have a global_id that isn't "global", then can this PR include documentation updates to clarify that please. There is also still this issue - "I create 2 ESCItems (ESCItem1 and ESCItem2). I create an ESCLocation as a child of ESCItem2 and give it the same Global ID as ESCItem1. Running the scene does not cause it to crash." @StraToN, I believe this is waiting on your input ("ESCLocation also forces registration. @StraToN I'm assuming there's a reason for this but maybe you can answer authoritatively?") |
Objects Manager "knows" about objects that were already met while playing. Escoria has no way to know every ESCItem defined in the game because these are defined in different scenes, which Escoria cannot monitor. We could forbid having 2 objects globally sharing the same
This should not happen in that case. 2 objects in the same room should not share the same global_id, even if both are not the same type and force registration. You can make a character walk towards an ESCItem or towards an ESCLocation, both walk cases are treated the same. Therefore I'd just stick to the rule: having 2 objects sharing the same global_id in the same room is an error. Also just fyi: ""global_id" is just a historic name from old Escoria. We just didn't change it. |
Thanks @StraToN. We can make the documentation say that the global_id is unique to each scene and not to the whole game. If anyone's looking for me, I will be sitting here grumbling to myself about how I disagree with the poor naming of "global" IDs 😠 😆 We still have a bug therefore. I've created an ESCLocation in room 3 and given it the same Global ID as the left door exit, and it doesn't break Escoria. |
@balloonpopper the bug makes sense since @StraToN do we need to force registration for |
I think we can safely remove the "force registration" in
I am not married to "global_id" :) (especially since I didn't set this name myself in the first time). |
The global_id name isn't urgent, we can worry about that another time. I also can't create a child ESCLocation with the same name as another ESC Item now, so that's been fixed. Is there anything else that needs to be tested? |
…layer is forcibly registered
Fixes godot-escoria/escoria-issues#203