BigBang1112 / nations-converter

Map conversion tool from TMS/TMNESWC/TMUF/TM² Stadium to TM®. Powered by GBX.NET. We are coming back soon.
GNU General Public License v3.0
36 stars 1 forks source link

Incorrect Waypoint Tags for Ring CP's from TMUF #20

Closed CognitiveMist closed 3 years ago

CognitiveMist commented 3 years ago

Ring CP waypoints for TMUF maps are given the tag "Goal", while the correct value should be "Checkpoint".

This currently has no known negative effects, but it might cause problems for certain game modes / editor plugins / openplanet plugins.

This was brought to my attention via this map: Turbulence.zip

While I am somewhere between unfamiliar and rusty with C-Sharp, and I am unfamiliar with GBX.NET, I believe the lines that must change are: https://github.com/BigBang1112/nations-converter/blob/40b26e23aadb55e341f10802a0215aabdd07e01a/NationsConverter/Stages/BlockConverter.cs#L456-L457 And the new code could look something like:

                if (referenceBlock.WaypointSpecialProperty != null)
                {
                    block.WaypointSpecialProperty = referenceBlock.WaypointSpecialProperty;
                    if (block.WaypointSpecialProperty.Tag == "Goal" && block.Name.Contains("Checkpoint"))
                        block.WaypointSpecialProperty.Tag = "Checkpoint";
                }

...though there is likely a better way of differentiating CPs from Finishes that I'm not seeing.

Newer game versions (I checked TMT and TM2) use the values which all match with TM2020.

Linked CPs are not a concern here, since they were introduced with TM2.

BigBang1112 commented 3 years ago

Thank you for reporting that. It's likely I noticed this issue already but haven't fixed it for some reason. The solution must be a little complex than this. I don't believe all blocks have the full name checkpoint inside. There also needs to be considered chunk conversion that happens from the old game version to the new version. The name "Goal" could be assigned from the actual game when recognizing the old TMUF chunk. I will look at this sometime soon.

CognitiveMist commented 3 years ago

Yeah, I am fully aware that I am just shooting in the dark here, which is why I didn't write this as a PR.

Thanks for the response 👍

BigBang1112 commented 3 years ago

Thanks for pointing the Contains solution out in the end. Checkpoint blocks don't give any signs of being the checkpoint other than in a name. The bug is now fixed. fa8fe0be5f2c50ebc86e4370dbb158b1ac92c603